var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var YUC=YAHOO.util.Connect;var $=YUD.get;var loginErrors={"111":"\u901a\u884c\u8bc1\u4e0d\u80fd\u4e3a\u7a7a","112":"\u901a\u884c\u8bc1\u8f93\u5165\u9519\u8bef","113":"\u901a\u884c\u8bc1\u5df2\u88ab\u51bb\u7ed3","114":"\u901a\u884c\u8bc1\u4e0d\u5b58\u5728","115":"\u901a\u884c\u8bc1\u957f\u5ea6\u9519\u8bef","121":"\u901a\u884c\u8bc1\u5bc6\u7801\u9519\u8bef","122":"\u901a\u884c\u8bc1\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a","123":"\u901a\u884c\u8bc1\u5bc6\u7801\u957f\u5ea6\u9519\u8bef","141":"\u53c2\u6570\u9519\u8bef\u6216\u8f93\u5165\u4e0d\u5b8c\u6574"};(function(d){var f={linear:function(c,j,a,b){return a*c/b+j},easeIn:function(c,j,a,b){return a*(c/=b)*c+j},easeOut:function(c,j,a,b){return -a*(c/=b)*(c-2)+j},easeBoth:function(c,j,a,b){if((c/=b/2)<1){return a/2*c*c+j}return -a/2*((--c)*(c-2)-1)+j},easeInStrong:function(c,j,a,b){return a*(c/=b)*c*c*c+j},easeOutStrong:function(c,j,a,b){return -a*((c=c/b-1)*c*c*c-1)+j},easeBothStrong:function(c,j,a,b){if((c/=b/2)<1){return a/2*c*c*c*c+j}return -a/2*((c-=2)*c*c*c-2)+j},elasticIn:function(m,o,a,b,n,c){if(m===0){return o}if((m/=b)==1){return o+a}if(!c){c=b*0.3}if(!n||n<Math.abs(a)){n=a;var l=c/4}else{var l=c/(2*Math.PI)*Math.asin(a/n)}return -(n*Math.pow(2,10*(m-=1))*Math.sin((m*b-l)*(2*Math.PI)/c))+o},elasticOut:function(m,o,a,b,n,c){if(m===0){return o}if((m/=b)==1){return o+a}if(!c){c=b*0.3}if(!n||n<Math.abs(a)){n=a;var l=c/4}else{var l=c/(2*Math.PI)*Math.asin(a/n)}return n*Math.pow(2,-10*m)*Math.sin((m*b-l)*(2*Math.PI)/c)+a+o},elasticBoth:function(m,o,a,b,n,c){if(m===0){return o}if((m/=b/2)==2){return o+a}if(!c){c=b*(0.3*1.5)}if(!n||n<Math.abs(a)){n=a;var l=c/4}else{var l=c/(2*Math.PI)*Math.asin(a/n)}if(m<1){return -0.5*(n*Math.pow(2,10*(m-=1))*Math.sin((m*b-l)*(2*Math.PI)/c))+o}return n*Math.pow(2,-10*(m-=1))*Math.sin((m*b-l)*(2*Math.PI)/c)*0.5+a+o},backIn:function(j,k,a,b,c){if(typeof c=="undefined"){c=1.70158}return a*(j/=b)*j*((c+1)*j-c)+k},backOut:function(j,k,a,b,c){if(typeof c=="undefined"){c=1.70158}return a*((j=j/b-1)*j*((c+1)*j+c)+1)+k},backBoth:function(j,k,a,b,c){if(typeof c=="undefined"){c=1.70158}if((j/=b/2)<1){return a/2*(j*j*(((c*=(1.525))+1)*j-c))+k}return a/2*((j-=2)*j*(((c*=(1.525))+1)*j+c)+2)+k},bounceIn:function(c,j,a,b){return a-f.bounceOut(b-c,0,a,b)+j},bounceOut:function(c,j,a,b){if((c/=b)<(1/2.75)){return a*(7.5625*c*c)+j}else{if(c<(2/2.75)){return a*(7.5625*(c-=(1.5/2.75))*c+0.75)+j}else{if(c<(2.5/2.75)){return a*(7.5625*(c-=(2.25/2.75))*c+0.9375)+j}}}return a*(7.5625*(c-=(2.625/2.75))*c+0.984375)+j},bounceBoth:function(c,j,a,b){if(c<b/2){return f.bounceIn(c*2,0,a,b)*0.5+j}return f.bounceOut(c*2-b,0,a,b)*0.5+a*0.5+j}};d.Motion=function(b,a){this.duration=a||1000;this.tween=b||"linear"};d.Motion.getTweens=function(){return f};var e=50;d.Motion.prototype=(function(){var b=function(j,k){var l=Array.prototype.slice.call(arguments).slice(2);if(typeof j=="function"){try{return j.apply(k||this,l)}catch(c){k.errors=k.errors||[];k.errors.push(c)}}};var a=function(){b(this.onTweening,this);if(this.current>=this.frames){this.stop();return b(this.onComplete,this)||this}else{++this.current;var c=arguments.callee,j=this;this.timer=setTimeout(function(){c.call(j)},e)}};return{init:function(){this.fps=this.fps||35;this.frames=Math.ceil((this.duration/1000)*this.fps);if(this.frames<1){this.frames=1}this.equation=(function(){var c=("function"==typeof this.tween)?this.tween:f[this.tween]||f.linear,j={};return function(g,h){var m=[(this.current/this.frames)*this.duration,g,h-g,this.duration];var l="flag_"+m.join("_");return j[l]||(j[l]=c.apply(this,m))}}).call(this);e=this.duration/this.frames;b(this.onInit,this)},start:function(c){if(!this.paused){this.init();this.current=1;b(this.onStart,this)}var h=this;this.timer=setTimeout(function(){a.call(h)},e);return this},stop:function(){clearTimeout(this.timer)},sleep:function(){this.stop();this.paused=true;return b(this.onSleep,this)||this},wakeup:function(){this.start();this.paused=false;return b(this.onWakeup,this)||this}}})()})(window);var game_form="idGameForm";var dial_server="idDialServers";var login_btn_arr="idUserLoginBtn";var loginout_btn_arr=["idLoginoutBtn","idLoginoutBtn2"];var login_form="idLoginForm";var active_servers_id="idActiveServers";var vip_id="idVipInfo";var safe_id="idSafeInfo";var integrity_id="idIntegrityInfo";var levelInfo={vip:"",security:"",integrity:""};var integMsg={safeTitle:"\u8d26\u6237\u5b89\u5168",safeMsg:{"0":'<font class="c-0">\u5371\u9669</font>\u2014\u2014\u60a8\u7684\u8d26\u53f7\u5f88\u5371\u9669\uff0c\u9700\u8981\u5b8c\u5584\u4fdd\u62a4\u4fe1\u606f',"1":'<font class="c-1">\u4e2d\u7b49</font>\u2014\u2014\u60a8\u7684\u8d26\u8d26\u53f7\u4e0d\u591f\u5b89\u5168\uff0c\u9700\u8981\u5b8c\u5584\u4fdd\u62a4\u4fe1\u606f',"2":'<font class="c-2">\u5b89\u5168</font>\u2014\u2014\u60a8\u7684\u8d26\u53f7\u5f88\u5b89\u5168\uff0c\u5efa\u8bae\u5b9a\u671f\u4fee\u6539\u5bc6\u7801'},integTitle:"\u4e2a\u4eba\u4fe1\u606f",integBaseMsg:['<font class="c-0">',"</font>\u2014\u2014\u60a8\u7684\u4e2a\u4eba\u4fe1\u606f\u5b8c\u6210\u5ea6","\u8865\u5145\u5b8c\u6574\u4fe1\u606f\u53ef\u4ee5\u9886\u53d6\u610f\u5916\u5956\u54c1\u3002"],integMsg:function(c){var a=String(Number(c)*25)+"%";var b=Number(c)<4?"\uff0c"+this.integBaseMsg[2]:"\u3002";return this.integBaseMsg[0]+a+this.integBaseMsg[1]+a+b}};var server_list_arr=YUD.getElementsByClassName("server_list_a");var newsTab=YUD.getElementsByClassName("tab","li","news-tab");var gamedataTab=YUD.getElementsByClassName("tab","li","gamedata-tab");var yxTab=YUD.getElementsByClassName("tab","li","yx-tab");var wjTab=YUD.getElementsByClassName("tab","li","wj-tab");var newsListTab=YUD.getElementsByClassName("tab","li","news-list-tab");var zlTab=YUD.getElementsByClassName("tab","a","zl-tab");var planList=YUD.getElementsByClassName("tab","a","plan-list");var gamelinks=YUD.getElementsByClassName("server_list_a","a");var selectServerLine=function(c){if($("idUname").innerHTML==""){return}YUE.preventDefault(c);var b=this.name;var a=this.href;window.location="http://passport.lezi.com/user/action/game_redirect.php?forward="+a};var showUserTip=function(a){YUE.preventDefault(a);var b=this.id;if(b=="idSafeInfo"){$("loginTipTitle").innerHTML=integMsg.integTitle;if(YUD.hasClass("loginTip","ztip-2")){YUD.replaceClass("loginTip","ztip-2","ztip-1")}$("loginTipMag").innerHTML=integMsg.safeMsg[$(b).className.substring(4,5)]}else{if(b=="idIntegrityInfo"){$("loginTipTitle").innerHTML=integMsg.safeTitle;if(YUD.hasClass("loginTip","ztip-1")){YUD.replaceClass("loginTip","ztip-1","ztip-2")}$("loginTipMag").innerHTML=integMsg.integMsg($(b).className.substring(6,7))}}YUD.removeClass("loginTip","hide")};var hideUserTip=function(){YUD.addClass("loginTip","hide")};var mouseEnterHandler=function(d,c){var b=$(this.id);var a=YUE.getRelatedTarget(d);if(a!==b&&!YUD.isAncestor(b,a)){c()}};var mouseLeaveHandler=function(d,c){var b=$(this.id);var a=YUE.getRelatedTarget(d);if(a!==b&&!YUD.isAncestor(b,a)){c()}};if(typeof pet!="undefined"){var petItem=YUD.get("pet");var pets="";var petTexts="";var petItems=[];var petTItems=[];var randomArray=[];for(i=0;i<pet.length;i++){randomArray[i]=i}randomArray.sort(function(){return Math.random()>0.5?-1:1});for(i=0;i<pet.length;i++){pet[randomArray[i]].url=petUrl+pet[randomArray[i]].url;pets=pets+"<a href='"+pet[randomArray[i]].url+"' id='pet"+i+"' class='pet' target='_blank'><img src='"+imgUrl+pet[randomArray[i]].img+"' alt='"+pet[randomArray[i]].name+"' /></a>";petTexts=petTexts+'<a id="pet-text'+i+'" href="'+pet[randomArray[i]].url+'" target="_blank">'+pet[randomArray[i]].name+"</a>";petItems[i]="pet"+i;petTItems[i]="pet-text"+i}var petSlider={pre:function(b,a){if(!a){a=petSlider}a.motion1.stop();a.motion2.stop();a.motion1.onTweening=function(){if(document.all){YUD.get(petItems[a.nowpet]).style.filter="alpha(opacity="+this.equation(100,0)+")"}else{YUD.get(petItems[a.nowpet]).style.opacity=this.equation(1,0)}};a.motion1.start();a.motion1.onComplete=function(){YUD.removeClass(YUD.get(petItems[a.nowpet]),"show");YUD.removeClass(YUD.get(petTItems[a.nowpet]),"show");a.nowpet=a.nowpet>0?a.nowpet-1:a.petlen;if(document.all){YUD.get(petItems[a.nowpet]).style.filter="alpha(opacity=0)"}else{YUD.get(petItems[a.nowpet]).style.opacity=0}YUD.addClass(YUD.get(petItems[a.nowpet]),"show");YUD.addClass(YUD.get(petTItems[a.nowpet]),"show");a.motion2.onTweening=function(){if(document.all){YUD.get(petItems[a.nowpet]).style.filter="alpha(opacity="+this.equation(0,100)+")"}else{YUD.get(petItems[a.nowpet]).style.opacity=this.equation(0,1)}};a.motion2.start()}},next:function(b,a){if(!a){a=petSlider}a.motion1.stop();a.motion2.stop();a.motion1.onTweening=function(){if(document.all){YUD.get(petItems[a.nowpet]).style.filter="alpha(opacity="+this.equation(100,0)+")"}else{YUD.get(petItems[a.nowpet]).style.opacity=this.equation(1,0)}};a.motion1.start();a.motion1.onComplete=function(){YUD.removeClass(YUD.get(petItems[a.nowpet]),"show");YUD.removeClass(YUD.get(petTItems[a.nowpet]),"show");a.nowpet=a.nowpet<a.petlen?a.nowpet+1:0;if(document.all){YUD.get(petItems[a.nowpet]).style.filter="alpha(opacity=0)"}else{YUD.get(petItems[a.nowpet]).style.opacity=0}YUD.addClass(YUD.get(petItems[a.nowpet]),"show");YUD.addClass(YUD.get(petTItems[a.nowpet]),"show");a.motion2.onTweening=function(){if(document.all){YUD.get(petItems[a.nowpet]).style.filter="alpha(opacity="+this.equation(0,100)+")"}else{YUD.get(petItems[a.nowpet]).style.opacity=this.equation(0,1)}};a.motion2.start()}},fade:function(){},init:function(){petItem.innerHTML=petItem.innerHTML+pets;$("pet-text").innerHTML=$("pet-text").innerHTML+petTexts;YUD.addClass(YUD.get(petItems[0]),"show");YUD.addClass(YUD.get(petTItems[0]),"show");this.nowpet=0;this.petlen=petItems.length-1;this.motion1=new Motion("linear",500);this.motion2=new Motion("linear",500);YUE.on("pet-pre","click",this.pre,this);YUE.on("pet-next","click",this.next,this);startRun=setInterval(this.next,2500);var a=["pet-pre","pet-next"];a=a.concat(petItems);YUE.on(a,"mouseover",mouseEnterHandler,function(){clearInterval(startRun)});YUE.on(a,"mouseout",mouseLeaveHandler,function(){startRun=setInterval(petSlider.next,2500)})}};petSlider.init()}var toogleTab3=function(b){YUE.preventDefault(b);var a=YUD.getNextSiblingBy(this);if(YUD.hasClass(a,"hide")){YUD.removeClass(a,"hide")}else{YUD.addClass(a,"hide")}};var hover=function(b,a){var c=this.id;if(a=="in"){YUD.addClass(c,"hover")}else{YUD.removeClass(c,"hover")}};var hide=function(b,a){YUE.preventDefault(b);YUD.addClass(a,"hide")};var show=function(b,a){YUE.preventDefault(b);YUD.removeClass(a,"hide")};var toogleTab=function(d,a){YUE.preventDefault(d);var b=this.id;var c="-list";if(YUD.hasClass(b,"active")){return}var f=YUD.getElementsByClassName("active","li",a);YUD.addClass(b,"active");YUD.removeClass(f[0].id,"active");YUD.addClass(f[0].id+c,"hide");YUD.removeClass(b+c,"hide")};var toogleTab2=function(c){YUE.preventDefault(c);var a=this.id;var b="-list";if(YUD.hasClass(a,"active")){YUD.addClass(a+b,"hide");YUD.removeClass(a,"active")}else{YUD.removeClass(a+b,"hide");YUD.addClass(a,"active")}};var bookmark=function(){var c=document.title;var b=window.location.protocol+"//"+window.location.host;if(window.sidebar){window.sidebar.addPanel(c,b,"")}else{if(window.opera&&window.print){var a=document.createElement("a");a.setAttribute("rel","sidebar");a.setAttribute("href",b);a.setAttribute("title",c);a.click()}else{if(document.all){window.external.AddFavorite(b,c)}}}};var resetUserForm=function(a){a.userid.value="";a.pwd.value=""};var setUserInfo=function(b){if(typeof has_dial_servers!="undefined"){if(b){YUD.removeClass(dial_server,"hide")}else{YUD.addClass(dial_server,"hide")}$("idDialUname").innerHTML=b?b.uname:"";if($("idDialUname").innerHTML){YUD.removeClass("idDialUnameP","hide")}else{YUD.addClass("idDialUnameP","hide")}}YUD.setStyle($("idUserLogin"),"display",(b?"none":"block"));YUD.setStyle($("idUserLogined"),"display",(b?"block":"none"));var e=$(active_servers_id);if(e){var f=b.areas;if(f){var h="";var g=McServers.get_actives(f);for(var d=0,a=g.length;d<a;d++){h+=g[d]}e.innerHTML=h}else{e.innerHTML="<li>\u60a8\u5c1a\u672a\u767b\u9646\u8fc7\u6e38\u620f\u670d\u52a1\u5668</li>"}}$("idUname").innerHTML=b?b.uname:"";var c=function(k,p,j,l){var n=$(k);if(n){var o=b[p];var m=o?l+o:l+"0";n.className="";YUD.addClass(n,m);levelInfo[j]=String(o)}};if(b){c(vip_id,"level","vip","vip");c(safe_id,"security","security","safe");c(integrity_id,"integrity","integrity","strong")}else{resetUserForm($(login_form))}};var login=function(h){YUE.preventDefault(h);var g=login_form;var c=$(g);var f={minlen:4,maxlen:20,cklength:function(k,e){if(k.replace(/[^\x00-\xff]/g,"**").length<this.minlen||k.replace(/[^\x00-\xff]/g,"**").length>this.maxlen){alert("\u60a8\u8f93\u5165\u7684"+e+"\u5b57\u7b26\u4e32\u4e0d\u7b26\u5408\u957f\u5ea6\u9650\u5236\uff01");return false}return true},ckField:function(n,e,m){var l=n.value;if(l){if(!this.cklength(l,e)){return false}var k=/\W/;if(m&&k.test(l)){alert(e+"\u53ea\u5141\u8bb8\u8f93\u5165\u82f1\u6587\u548c\u6570\u5b57!");return false}return true}n.focus();alert(e+"\u4e0d\u80fd\u4e3a\u7a7a\uff01");return false},ckValid:function(){var e={userid:"\u767b\u5f55ID\u53f7",pwd:"\u5bc6\u7801"};var k=c.userid;var l=c.pwd;if(!this.ckField(k,e[k.name])){return false}if(!this.ckField(l,e[l.name])){return false}return true}};var d=function(){var l="";var k=function(m){if(!m.value){return false}return true};var e=function(m){l+=(l?"&":"")+m.name+"="+m.value};YUD.getElementsBy(k,"input",g,e);return l};if(!f.ckValid()){return false}var j=d();var a={success:function(l){try{messages=YAHOO.lang.JSON.parse(l.responseText)}catch(k){alert("\u6570\u636e\u8f6c\u6362\u5931\u8d25\uff01");return false}if(typeof(messages.type)!="undefined"){if(messages.type=="loginok"){setUserInfo(messages.datas)}else{if(loginErrors[messages.code]!="undefined"){alert(loginErrors[messages.code])}else{alert("\u767b\u9646\u5931\u8d25!")}switch(messages.type){case"userid":c.userid.focus();break;case"pwd":c.pwd.focus();break;case"error":break;default:break}}}},failure:function(e){alert("\u7f51\u7edc\u901a\u4fe1\u4e2d\u65ad\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01")},timeout:5000};var b=YUC.asyncRequest("POST",do_ajax+"login.php",a,j);return false};var loginout=function(d){YUE.preventDefault(d);var c=do_ajax+"loginout.php";var a={success:function(e){if(e.responseText==0){setUserInfo("")}else{alert("\u9000\u51fa\u5931\u8d25\uff01")}},failure:function(e){}};var b=YUC.asyncRequest("POST",c,a)};YUE.on(login_form,"submit",login);YUE.on(loginout_btn_arr,"click",loginout);YUE.on(newsTab,"mousemove",toogleTab,"news-tab");YUE.on(gamedataTab,"mousemove",toogleTab,"gamedata-tab");YUE.on(yxTab,"mousemove",toogleTab,"yx-tab");YUE.on(wjTab,"mousemove",toogleTab,"wj-tab");YUE.on(newsListTab,"click",toogleTab,"news-list-tab");YUE.on(zlTab,"click",toogleTab2);YUE.on(planList,"click",toogleTab3);YUE.on("gdyx","mousemove",hover,"in");YUE.on("gdyx","mouseout",hover,"out");YUE.on("show-popup-fwq","click",show,"idDialServers");YUE.on("hide-popup-fwq","click",hide,"idDialServers");YUE.addListener(gamelinks,"click",selectServerLine);
