function getTop(a){for(var c=0;a;)c+=a.offsetTop,a=a.offsetParent;return c}function getLeft(a){for(var c=0;a;)c+=a.offsetLeft,a=a.offsetParent;return c}
function notactive(a,c,b){if(1==b)b=document.createElement("div"),b.id="reporttxt",b.style.position="absolute",b.style.border="1px solid #b46600",b.style.background="#fffad2",b.style.width="183px",b.style.height="38px",b.style.padding="3px",a.id="tmpme",b.style.top=$("#tmpme").pos().y-48+"px",b.style.left=$("#tmpme").pos().x+"px",a.id="",b.innerHTML=c,document.body.appendChild(b);else try{document.body.removeChild($("#reporttxt").get()[0])}catch(d){}return!1}
function m3(a,c,b){if(1==b){if("noDATAcss"==a){a=$(".IMG-E42").attr("id");var d="noDATAcss"}b=document.createElement("div");b.id="m3txt";b.style.position="absolute";b.style.border="1px solid #b46600";b.style.background="#fffad2";b.style.padding="3px";b.style.top=$("#"+a).pos().y+130+"px";b.style.left=$("#"+a).pos().x+39+"px";b.innerHTML=c;"collectNew"==a.substr(0,10)?b.style.top=$("#"+a).pos().y-26+"px":"pushdaren_"==a.substr(0,10)?(b.style.left=$("#"+a).pos().x+3+"px",b.style.top=$("#"+a).pos().y-
42+"px"):"acgVoteBox"==a?(b.style.top=$("#"+a).pos().y+70+"px",b.style.left=$("#"+a).pos().x-3+"px"):"noDATAcss"==d&&(c=[,[]],c[1][1]="IMG-E37",c[1][2]="IMG-E38",c[1][3]="IMG-E36",c[1][4]="IMG-E35",c[2]=[],c[2][1]="IMG-E41",c[2][2]="IMG-E38",c[2][3]="IMG-E39",c[2][4]="IMG-E40",c[4]=c[2],c[8]=c[2],b.style.top=$("#"+a).pos().y-5+"px",b.style.left=$("#"+a).pos().x+70+"px",$(".IMG-E42").attr("onclick","").click(function(){alert("\u60a8\u5df2\u7d93\u6536\u85cf\u4e86\u5594\uff5e")}),$(".IMG-E42").attr("className",
c[a.charAt(9)][a.charAt(11)]));document.body.appendChild(b);setTimeout("m3('','','2')",3E3)}else try{document.body.removeChild($("#m3txt").get()[0])}catch(e){}return!1}
function open_default(a,c,b){""==a&&(a="\u8a0a\u606f");$.lightbox.close();a='<div class="open_win">'+('<h1 class="open_wintitle"><img src="http://i2.bahamut.com.tw/h1_img.gif" />'+a+"</h1>");a+="<div>"+c+"</div>";a+='<p class="open_winbtn">'+b+"</p>";a+="</div>";$.lightbox.open(a,{hide:"select, object, embed, iframe"});$("div[class=open_win]").css("text-align","left");$.lightbox.refresh()}
function playstatus(a,c){$.ajax({url:"/ajax/myplaystatus.php",success:replaystatus,param:"s="+a+"&w="+c,method:"GET"})}
function replaystatus(a){var c=a.getElementsByTagName("errMsg"),b="";if(c.length)b=c[0].firstChild.nodeValue,open_default("",b,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />');else{var d=c="",e="",g="";a.getElementsByTagName("want2play").length&&(c="checked");a.getElementsByTagName("playing").length&&(d="checked");a.getElementsByTagName("played").length&&(e="checked");a.getElementsByTagName("favorite").length&&(g="checked");var h=a.getElementsByTagName("acg_sn")[0].firstChild.nodeValue,
f=a.getElementsByTagName("word")[0].firstChild.nodeValue;a=a.getElementsByTagName("where")[0].firstChild.nodeValue;b=b+"\u8a2d\u5b9a\u4f5c\u54c1\u72c0\u614b\uff1a<br>"+('<input type="radio" name="play" id="play_wp" '+c+">\u6211\u60f3"+f+"<br>");b+='<input type="radio" name="play" id="play_p" '+d+">\u6b63\u5728"+f+"<br>";b+='<input type="radio" name="play" id="play_pd" '+e+">\u5df2"+f+"\u904e<br>";b+='<input type="checkbox" id="favorite" '+g+"> \u9019\u662f\u6211\u6700\u559c\u6b61\u7684\u4f5c\u54c1\u4e4b\u4e00";
open_default("",b,'<input type="button" value="\u78ba\u5b9a" onclick="changeplay('+h+",'"+a+'\');" /><input type="button" value="\u53d6\u6d88" onclick="$.lightbox.close();" />')}}
function changeplay(a,c,b,d){if(void 0==b&&void 0==d){var e=$("#play_wp").get();1==e[0].checked&&(b=1);e=$("#play_p").get();1==e[0].checked&&(b=2);e=$("#play_pd").get();1==e[0].checked&&(b=3);e=$("#favorite").get();1==e[0].checked&&(d=1)}$.lightbox.close();$.ajax({url:"/ajax/changeplay.php",success:rechangeplay,param:"s="+a+"&p="+b+"&f="+d+"&w="+c,method:"GET"});return!1}
function rechangeplay(a){var c=a.getElementsByTagName("errMsg"),b=a.getElementsByTagName("okMsg"),d=$("acg_sn",a).val(),e="";if(c.length)e=c[0].firstChild.nodeValue,open_default("",e,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />');else if(b.length)e=a.getElementsByTagName("where")[0].firstChild.nodeValue,"a"==e?(a=a.getElementsByTagName("html")[0].firstChild.nodeValue,$("#newscore"+d).html(a),m3("newscore"+d,'\u5b8c\u6210\u8a2d\u5b9a\uff0c\u5df2\u6536\u85cf\u81f3<a href="http://home.gamer.com.tw/acgbox.php?owner='+
$.cookie.get("BAHAID")+'" target="_blank" style="color:blue"> \u904a\u6232\u52d5\u6f2b\u6ac3</a>',"1")):"ap"==e?(a=a.getElementsByTagName("html")[0].firstChild.nodeValue,$("#playlist").html(a)):"noDATA"==e?m3("noDATAcss",'\u5df2\u6536\u85cf\u81f3<a href="http://home.gamer.com.tw/acgbox.php?owner='+$.cookie.get("BAHAID")+'">\u904a\u6232\u52d5\u6f2b\u6ac3</a>\uff01\u4e4b\u5f8c\u53ef\u5728\u300c<a href="http://home.gamer.com.tw/bahawall.php?owner='+$.cookie.get("BAHAID")+'">\u52d5\u614b\u4e2d\u5fc3</a>\u300d\u6301\u7e8c\u6536<br>\u5230\u672c\u4f5c\u54c1\u76f8\u95dc\u8cc7\u8a0a\u3002<a href="javascript:window.location.reload(true);">\u66f4\u65b0\u672c\u9801\u5167\u5bb9</a>',
"1"):"button4"==e?(a=a.getElementsByTagName("html")[0].firstChild.nodeValue,$("#acgVoteBox").html(a),m3("acgVoteBox",'\u5b8c\u6210\u8a2d\u5b9a\uff0c\u5df2\u6536\u85cf\u81f3<a href="http://home.gamer.com.tw/acgbox.php?owner='+$.cookie.get("BAHAID")+'" target="_blank" style="color:blue"> \u904a\u6232\u52d5\u6f2b\u6ac3</a>',"1")):(d=a.getElementsByTagName("acg_sn")[0].firstChild.nodeValue,"Y"==a.getElementsByTagName("hide")[0].firstChild.nodeValue&&(showDetal_destroy(),$("#acgbox_"+d).hide()));else{var c=
a.getElementsByTagName("olddata")[0].firstChild.nodeValue,d=a.getElementsByTagName("acg_sn"),b=a.getElementsByTagName("title"),g=a.getElementsByTagName("word")[0].firstChild.nodeValue;a=a.getElementsByTagName("type")[0].firstChild.nodeValue;e=("p"==a?e+('\u8a2d\u5b9a\u70ba<span class="BH-tcolor1">\u6b63\u5728'+g+"</span>\u7684\u4f5c\u54c1\u5df2\u9054\u5341\u6b3e\u4e0a\u9650\uff0c\u60a8\u5fc5\u9808\u53d6\u6d88\u4ee5\u4e0b\u5176\u4e2d\u4e00\u6b3e\u4f5c\u54c1\u7684\u72c0\u614b\u3002<br>"):e+'\u8a2d\u5b9a\u70ba<span class="BH-tcolor1">\u6700\u559c\u6b61</span>\u7684\u4f5c\u54c1\u5df2\u9054\u5341\u6b3e\u4e0a\u9650\uff0c\u60a8\u5fc5\u9808\u53d6\u6d88\u4ee5\u4e0b\u5176\u4e2d\u4e00\u6b3e\u4f5c\u54c1\u7684\u72c0\u614b\u3002<br>')+
"<table border=0>";for(i=0;i<d.length;i+=2)e+='<tr><td><input type="radio" name="delACG" value="'+d[i].firstChild.nodeValue+'">'+b[i].firstChild.nodeValue+'</td><td><input type="radio" name="delACG" value="'+d[i+1].firstChild.nodeValue+'">'+b[i+1].firstChild.nodeValue+"</td></tr>";e+="</table>";open_default("",e,'<input type="button" value="\u78ba\u5b9a" onclick="changeplay2(\''+c+"','"+a+'\');" /><input type="button" value="\u53d6\u6d88" onclick="$.lightbox.close();" />')}}
function changeplay2(a,c){var b=$(":radio[name=delACG]").filter("[checked]").val();if("undefined"==b)return alert("\u8acb\u9078\u64c7\u8981\u53d6\u6d88\u7684\u4f5c\u54c1"),!1;$.lightbox.close();$.ajax({url:"/ajax/changeplay.php",success:rechangeplay,param:a+"&ds="+b+"&dt="+c,method:"GET"})}function nextStep(){location.reload()}function acgfeature(a,c){$.ajax({url:"/ajax/get_acgfeature.php",success:function(b){acgfeature_rs(b,a)},param:"s="+a+"&star="+(c||0),cache:!1,method:"GET"})}
function acgfeature_rs(a,c){var b=a.getElementsByTagName("errMsg"),d="";if(b.length)d+=b[0].firstChild.nodeValue,open_default("",d,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />');else{var b=a.getElementsByTagName("star")[0].firstChild.nodeValue,e="",g=" \u5dee \u666e\u901a \u597d \u76f8\u7576\u512a\u79c0 \u9019\u662f\u6211\u5fc3\u76ee\u4e2d\u5c6c\u4e00\u5c6c\u4e8c\u7684\u795e\u4f5c".split(" ");for(i=1;5>=i;i++)e+='<span onmouseover="Star_func('+i+",'"+g[i]+'\')" onmouseout="Star_func('+
i+",'')\" onClick=\"Star_set("+i+')"><img src="http://i2.bahamut.com.tw/acg/icon_star1a.gif" border="0" widht="15" height="15" id="star'+i+'"></span>&nbsp;&nbsp;';var h="",f="",d=d+('<span style="font-weight:bolder;font-size:16px;">\u7e3d\u8a55\u50f9\uff1a</span>'+e+'<span id="area_star"></span>\u3000<span id="star_explan"></span>')+'<br style="margin:20px;"><span style="font-weight:bold;font-size:13px;">\u4f60\u8a8d\u70ba\u672c\u4f5c\u54c1\u7684\u7279\u8272\u662f...(\u6700\u591a<span style="color:red;">\u4e94\u9805</span>)</span><br>',
e=a.getElementsByTagName("idata");if(e.length)for(fi=0;fi<e[0].childNodes.length;fi++){var k="";e[0].childNodes[fi].childNodes[2].childNodes.length&&(k="1"==e[0].childNodes[fi].childNodes[2].firstChild.nodeValue?" checked":"");h=e[0].childNodes[fi].childNodes[1].firstChild.nodeValue;f="";for(space_i=h.length;5>space_i;space_i++)f+="\u3000";d+='<input type="checkbox" name="fc[]" onClick="return chk_feature()" value="'+e[0].childNodes[fi].childNodes[0].firstChild.nodeValue+'"'+k+"> "+h+f+(0==(fi+1)%
4?"<br>":"\u3000")}d=d+'<input type="hidden" name="star" value="'+b+'"><input type="hidden" name="fini">';open_default("\u4f5c\u54c1\u8a55\u50f9",d,'<input type="button" value="\u78ba\u5b9a" onclick="chkdata('+c+')" />\u3000<input type="button" value="\u53d6\u6d88" onclick="$.lightbox.close();" />');1<=b&&($("#star_explan").get()[0].innerHTML=g[b],$(":input[name=fini]").get(0).value=1,Star_set(b))}}
function Star_set(a){if(1==$(":input[name=fini]").get(0).value||$(":input[name=star]").get(0).value!=a)Star_func(a,$("#star_explan").get()[0].innerHTML),$(":input[name=star]").get(0).value=a}
function Star_func(a,c){if(1==$(":input[name=fini]").get(0).value||$(":input[name=star]").get(0).value!=a){$("#star_explan").get()[0].innerHTML=c;for(j=1;5>=j;j++)$("#star"+j).get()[0].src=c&&j<=a?"http://i2.bahamut.com.tw/acg/icon_star1.gif":"http://i2.bahamut.com.tw/acg/icon_star1a.gif";$(":input[name=star]").get(0).value=0;$(":input[name=fini]").get(0).value=0}}
function chk_feature(){return 5<$("[name=fc\\[\\]]:checked").size()?(alert("\u7279\u8272\u6700\u591a\u53ea\u80fd\u9078\u64c7\u4e94\u9805\uff0c\u8acb\u4fee\u6b63\u3002"),!1):!0}
function chkdata(a){if(!$(":input[name=star]").get(0).value||0==$(":input[name=star]").get(0).value)return alert("\u8acb\u7d66\u500b\u8a55\u50f9\u5594"),!1;if(!chk_feature())return!1;var c="";$(":checkbox[name=fc\\[\\]]").filter("[checked]").size()&&(c=$(":checkbox[name=fc\\[\\]]").filter("[checked]").val(),c=1<c.length?c.join("&fc[]="):c,c="&fc[]="+c);$.ajax({url:"/ajax/acgfeaturea.php",success:function(b){acgfeaturea_rs(b,a)},param:"s="+a+"&star="+$(":input[name=star]").get(0).value+c,method:"POST"})}
function acgfeaturea_rs(a,c){$.lightbox.close();var b=a.getElementsByTagName("errMsg"),d="";if(b.length)d+=b[0].firstChild.nodeValue,open_default("",d,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />');else{try{showDetal_destroy()}catch(e){}b=a.getElementsByTagName("fin");d+=b[0].firstChild.nodeValue;b=a.getElementsByTagName("star")[0].firstChild.nodeValue;$("#star_"+c).get(0)&&drawStar(c,parseInt(b,10));open_default("\u4f5c\u54c1\u8a55\u50f9\u3000\u3000\u3000\u3000",d,
'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />');$("#newscore"+c).size()&&(d=a.getElementsByTagName("html")[0].firstChild.nodeValue,$("#newscore"+c).html(d))}}function platform_gather(a,c){$.lightbox.close();$.ajax({url:"/ajax/collectNew.php",success:function(b){collectNew_rs(b,a)},param:"s="+c,method:"POST"})}
function collectNew_rs(a,c){var b=a.getElementsByTagName("errMsg"),d=a.getElementsByTagName("fin"),e="";b.length?(e=b[0].firstChild.nodeValue,open_default("",e,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />')):(d.length&&(b=a.getElementsByTagName("html")[0].firstChild.nodeValue,$("#collectNewArea").html(b),$("#collectNewNum").get(0).innerHTML=parseInt($("#collectNewNum").get(0).innerHTML,10)+1),m3("collectNew"+c,'\u5b8c\u6210\u8a2d\u5b9a\uff0c\u5df2\u6536\u85cf\u81f3<a href="http://home.gamer.com.tw/platformbox.php?owner='+
$.cookie.get("BAHAID")+'" target="_blank" style="color:blue">\u904a\u6232\u52d5\u6f2b\u6ac3</a>',"1"))}function want2play(a){$.ajax({url:"/ajax/want2play.php",param:"s="+a,cache:!1,success:function(c){rewant2play(c,a)},method:"GET"});return!1}function want2play2(a){$.ajax({url:"/ajax/want2play.php",param:"s="+a,cache:!1,success:function(c){rewant2play2(c,a)},method:"GET"});return!1}
function rewant2play(a,c){var b=a.getElementsByTagName("errMsg"),d=a.getElementsByTagName("okMsg");b.length?(msg=b[0].firstChild.nodeValue,open_default("",msg,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />')):d.length&&($("#w2pnum_"+c).html(parseInt($("#w2pnum_"+c).html(),10)+1),m4("w2p_"+c,'\u5b8c\u6210\u8a2d\u5b9a\uff0c\u5df2\u6536\u85cf\u81f3<a href="http://home.gamer.com.tw/acgbox.php?owner='+$.cookie.get("BAHAID")+'&status=0" target="_blank" style="color:blue"> \u904a\u6232\u52d5\u6f2b\u6ac3</a>',
"1"),$("#w2p_"+c).attr("onclick","").click(function(){return m4("w2p_"+c,"\u5df2\u8ffd\u8e64\uff0c\u5f8c\u7e8c\u60c5\u5831\u5c07\u6703\u4e3b\u52d5\u901a\u77e5\u60a8!","1")}).attr("href","javascript:;"),"undefined"!=typeof egg("#w2p_manyacg").get(0)&&egg("#w2p_manyacg").html(parseInt($("#w2p_manyacg").html(),10)+1))}
function rewant2play2(a,c){var b=a.getElementsByTagName("errMsg"),d=a.getElementsByTagName("okMsg");b.length?(msg=b[0].firstChild.nodeValue,open_default("",msg,'<input type="button" value="\u78ba\u5b9a" onclick="$.lightbox.close();" />')):d.length&&($("#span_want2paly_"+c).html(parseInt($("#span_want2paly_"+c).html(),10)+1),m4("a_want2play_"+c,'\u5b8c\u6210\u8a2d\u5b9a\uff0c\u5df2\u6536\u85cf\u81f3<a href="http://home.gamer.com.tw/acgbox.php?owner='+$.cookie.get("BAHAID")+'&status=0" target="_blank" style="color:blue"> \u904a\u6232\u52d5\u6f2b\u6ac3</a>',
"1"),$("#a_want2play_"+c).attr("onclick","").click(function(){return m4("a_want2play_"+c,'\u4f60\u5df2\u7d93\u6536\u85cf\u904e\uff0c\u524d\u5f80<a href="http://home.gamer.com.tw/acgbox.php?owner='+$.cookie.get("BAHAID")+'&status=0" target="_blank" style="color:blue"> \u904a\u6232\u52d5\u6f2b\u6ac3</a>',"1")}).attr("href","javascript:;"))}
function m4(a,c,b){if(1==b)b=document.createElement("div"),b.id="m4txt",egg(b).attr("className","BH-note"),egg(b).css({top:$("#"+a).pos().y-32+"px",left:$("#"+a).pos().x+"px","z-index":"100"}),$(b).html(c),$(b).appendTo(document.body),setTimeout("m4('','','2')",3E3);else try{document.body.removeChild($("#m4txt").get(0))}catch(d){}return!1}
function Star_now(a,c,b,d,e){$("[name=ACGStar]").get(0).className="ACG-Star"+a;$("[name=ACGStar]").get(1).className="ACG-Star"+c;$("[name=ACGStar]").get(2).className="ACG-Star"+b;$("[name=ACGStar]").get(3).className="ACG-Star"+d;$("[name=ACGStar]").get(4).className="ACG-Star"+e};