(function(){function i(j){return document.getElementById(j)}$jwevent={getEvent:function(j){return j||event},getCharCode:function(j){var j=this.getEvent(j);return j.keyCode||j.charCode||0}};$jwdom={getY:function(j){var k=j.offsetTop;if(j.offsetParent!=null){k+=this.getY(j.offsetParent)}return k},getX:function(j){var k=j.offsetLeft;if(j.offsetParent!=null){k+=this.getX(j.offsetParent)}return k},getXY:function(j){return{x:this.getX(j),y:this.getY(j)}}};function c(j){return j.replace(/(^\s*)|(\s*$)/g,"")}var f={dlcbix:0,dlcbs:{},downloadJs:function(j,m,s,r){var o=document.getElementsByTagName("head")[0];var n=document.createElement("script");n.type="text/javascript";var q=[];for(var k in m){q.push([k,"=",m[k]].join(""))}f.dlcbix++;var l="cb_"+f.dlcbix;f.dlcbs[l]=function(p){s.call(r,p)};n.src=j+q.join("&")+"&cb=NetJs.dlcbs.cb_"+f.dlcbix+"&v="+Math.random();o.appendChild(n)}};NetFSO={dlcbix:0,dlcbs:{},downloadFile:function(k,n,s,r){var q=[];for(var l in n){q.push([l,"=",n[l]].join(""))}NetFSO.dlcbix++;var m="cb_"+NetFSO.dlcbix;NetFSO.dlcbs[m]=function(p){s.call(r,p)};var o=document.createElement("div");var j="jwnetfso"+NetFSO.dlcbix;o.innerHTML='<iframe id="'+j+'" onload="NetFSO.dlcbs.'+m+'(this.window || this.contentWindow);" style="display:none;"></iframe>';document.getElementsByTagName("body")[0].appendChild(o);document.getElementById(j).src=k+q.join("&")+"&v="+Math.random()}};function g(o,k){g.jwid++;this.id=g.jwid;var m={};var n=this.id;var j=0;var l=o.replace(/__NAME__="(\w{0,})"/ig,function(q,p){j++;var r=p+"_"+n+"_"+j;if(typeof m[p]=="undefined"){m[p]=[];m[p].push(j)}else{m[p].push(j)}return'id="jw_'+r+'"'});document.getElementById(k).innerHTML=l;this._els=m;this.rts={}}g.jwid=0;g.prototype={getEL:function(o,p,n){if(typeof this._els[o]=="undefined"){return null}var l=[];for(var m=0,j=this._els[o].length;m<j;m++){var k=p.call(n,document.getElementById("jw_"+o+"_"+this.id+"_"+this._els[o][m]));l.push(k)}return l},getEL1:function(j){return document.getElementById("jw_"+j+"_"+this.id+"_"+this._els[j][0])},addRt:function(j){var l=this;var k=this.getEL(j,function(m){if(typeof l.rts[j]=="undefined"){l.rts[j]=m.innerHTML.replace("<!--","").replace("-->","")}})},createRt:function(j){return new e(typeof this.rts[j]=="undefined"?"__NAME__ : "+j+" NotFined":this.rts[j])}};function e(j){this.tp=j;this.els=[]}e.jwid=0;e.prototype={get:function(){var k=[];var j=this.tp.replace(/id="(\w{0,})"/ig,function(o,n){var l=n.split("_");l.shift();l.pop();l.pop();var m=l.join("_");var p=n+"_"+e.jwid;k.push({n:m,id:p});return'id="'+p+'"'});this.els.push(k);e.jwid++;return j},getELs:function(q,p){for(var n=0,k=this.els.length;n<k;n++){var s={};for(var l=0,m=this.els[n].length;l<m;l++){var r=this.els[n][l];s[r.n]=document.getElementById(r.id);s.ix=n}q.call(p,s)}},getELss:function(){var l=[];for(var p=0,k=this.els.length;p<k;p++){var r={};for(var m=0,n=this.els[p].length;m<n;m++){var q=this.els[p][m];r[q.n]=document.getElementById(q.id);r.ix=p}l.push(r)}return l}};var h={read:function(j){var k=document.cookie.match("(?:^|;)\\s*"+j+"=([^;]*)");return k?k[1]:null},dispose:function(l,k){var j=new Date();j.setTime(j.getTime()+-1*24*60*60*1000);var m=l+"=; domain="+k.domain+"; path="+k.path+"; expires="+j.toString();document.cookie=m;return this}};var d={port:80,urls:{},events:{onLoginSuccess:[],onLoginFailure:[],onLoginStateChange:[]},cookieToken:"$",userInfo:{Gender:"",PpNum:"",ExpNum:"",LevelName:"",NextLevelName:"",NextLevelExpNum:"",Area:"",Subscribe:"",UnreadNotes:"",HeadPic:"",Email:"",OnlineTime:"",UserName:""},logined:false,addEvent:function(l,k,j){if(typeof this.events[l]=="undefined"){alert("未定义 "+l+" 事件,无法进行绑定");return}this.events[l].push([k,j])},__fncEvent:function(m,k){var n=this.events[m];for(var l=0,j=n.length;l<j;l++){n[l][0].call(n[l][1],k)}},init:function(){this.urls={login:"http://passport.pptv.com:"+this.port+"/clientlogin.do?",register:"http://passport.pptv.com:"+this.port+"/registerandlogin.do",forgetpwd:"http://passport.pptv.com:"+this.port+"/fetchpassword.do",userinfo:"http://home.pptv.com",usertips:"http://home.pptv.com/userinbox"};this.tryReadUserInfo()},login:function(j,k){NetFSO.downloadFile(this.urls.login,{IsTest:"OK",username:encodeURIComponent(j),password:encodeURIComponent(k)},function(l){this.tryReadUserInfo()?this.__loginOnSuccess():this.__loginOnFailure()},this)},__loginOnSuccess:function(){this.__fncEvent("onLoginSuccess",null)},__loginOnFailure:function(){this.__fncEvent("onLoginFailure",null)},tryReadUserInfo:function(){if(!h.read("UDI")){this.__fncEvent("onLoginStateChange",{state:"notlogined",userInfo:null});return false}if(h.read("PPName")){var k=h.read("PPName").split(this.cookieToken);this.userInfo.UserName=decodeURIComponent(k[0])}var l=h.read("UDI").split(this.cookieToken);var j=0;for(var m in this.userInfo){if(m=="UserName"){break}this.userInfo[m]=decodeURIComponent(l[j]);j++}this.logined=true;this.__fncEvent("onLoginStateChange",{state:"logined",userInfo:this.userInfo});return true},logout:function(){var k={domain:"pptv.com",path:"/"};h.dispose("UDI",k);h.dispose("PPName",k);h.dispose("PPKey",k);this.logined=false;for(var j in this.userInfo){this.userInfo[j]=""}this.__fncEvent("onLoginStateChange",{state:"logouted",userInfo:this.userInfo})}};var a={init:function(){d.addEvent("onLoginStateChange",function(m){switch(m.state){case"logined":i("btn_uname").innerHTML="欢迎您! "+m.userInfo.UserName+"";i("btn_uname").style.display="";i("btn_logout").style.display="";i("btn_login").style.display="none";i("btn_register").style.display="none";break;case"notlogined":case"logouted":i("btn_uname").style.display="none";i("btn_logout").style.display="none";i("btn_login").style.display="";i("btn_register").style.display="";break}},this);d.addEvent("onLoginSuccess",function(){i("loginbox").style.display="none";k(2)},this);d.addEvent("onLoginFailure",function(){k(1)},this);var l=new g(i("loginbox").innerHTML,"loginbox");l.getEL1("lb_b1").style.display="none";l.getEL1("lb_b2").style.display="none";var k=function(m){for(var n=0;n<3;n++){l.getEL1("lb_b"+(n+1)).style.display="none"}l.getEL1("lb_b"+(m+1)).style.display="block"};i("btn_logout").onclick=function(m){if(confirm("确定退出登录吗?")){d.logout()}return false};l.getEL1("lb_btn_relogin").onclick=function(m){k(2);return false};l.getEL1("lb_btn_close").onclick=function(m){i("loginbox").style.display="none";return false};i("btn_login").onclick=function(n){var m=$jwdom.getXY(i("user_btns"));i("loginbox").style.display="block";i("loginbox").style.top=m.y-10+"px";i("loginbox").style.left=(m.x-234)+"px";k(2);return false};var j=function(){var n=l.getEL1("lb_input_pwd").value;var m=l.getEL1("lb_input_name").value;if(m.length==0||n.length==0){return}k(0);d.login(m,n)};l.getEL1("lb_btn_login").onclick=function(m){j();return false};l.getEL1("lb_input_name").onkeyup=function(m){if($jwevent.getCharCode(m)==13){j()}};l.getEL1("lb_input_pwd").onkeyup=function(m){if($jwevent.getCharCode(m)==13){j()}}},showLoginBox:function(j,k){i("loginbox").style.display="block";i("loginbox").style.top=k+"px";i("loginbox").style.left=j+"px"}};function b(){var y=i("_j_dom_SearchInput");var x="http://ikan.pptv.com/search/suggest/?";var A=new Image(1,1);var z="http://218.61.6.151/t.gif?rid=4a5ee4943d2be&lt=";var v=document.createElement("ul");v.className="sm_search_tips";v.style.display="none";v.style.position="absolute";v.style.zIndex="50";v.style.left="0px";v.style.top="0px";var m="-- 请输入关键字 --";var j=500;var w=[];var k=[];var q=null;var s="";var r=-1;var n=null;var o=false;function t(){var B=c(y.value);if(B==""||B==m){return false}try{location.href="http://ikan.pptv.com/search/?kw="+encodeURIComponent(B)}catch(C){}}function u(C){var B=parseInt(r)+parseInt(C);if(B<0){B=w.length-1}else{if(B>=w.length){B=0}}if(r!=-1){k[r].className=""}r=B;k[r].className="current";y.value=w[r].name}function p(){var B=c(y.value);if(B!=""&&B!=m&&B!=s){f.downloadJs(x,{kw:encodeURIComponent(B)},function(C){l(C)});s=B;A.src=z+new Date().getTime()}}function l(D){var C=[];for(var B=0;B<D.length;B++){C.push(['<li><a href="javascript:;" title="',D[B].name,'">',D[B].name.substring(0,12),"</a></li>"].join(""))}v.innerHTML=C.join("");var E=$jwdom.getXY(y);if(!o){o=true;document.getElementsByTagName("body")[0].appendChild(v)}v.style.left=E.x-4+"px";v.style.top=E.y+24+"px";v.style.width="162px";v.style.height=(D.length)*24+"px";v.style.display="block";k=v.getElementsByTagName("li");w=D;for(var B=k.length;B--;){k[B].setAttribute("tid",B);k[B].onclick=function(F){var G=parseInt(this.getAttribute("tid"));location.href=w[G].link;return false}}}y.style.color="#999";y.onfocus=function(C){this.select();var B=c(this.value);if(B==""||B==m){this.style.color="#000";this.value=""}};y.onblur=function(C){var B=c(this.value);if(B==""||B==m){this.style.color="#999";this.value=m}};y.onkeydown=function(B){var D=$jwevent.getCharCode(B);switch(D){case 13:t();break;case 38:if(v.style.display=="none"){v.style.display=""}u(-1);break;case 40:if(v.style.display=="none"){v.style.display=""}u(1);break;default:try{clearTimeout(q)}catch(C){}q=setTimeout(p,j);break}};i("j_dom_searchsubmit").onclick=function(B){t();return false};document.onclick=function(B){v.style.display="none"}}window.NetJs=f;window.initSearch=function(){var j="-- 请输入关键字 --";i("_j_dom_SearchInput").onfocus=function(){if(j==this.value){this.value=""}};i("_j_dom_SearchInput").onblur=function(){if(this.value.replace(/(^\s*)|(\s*$)/g,"")==""){this.value=j}};b()}})();(function(){var a={read:function(b){var c=document.cookie.match("(?:^|;)\\s*"+b+"=([^;]*)");return c?c[1]:null},dispose:function(d,c){var b=new Date();b.setTime(b.getTime()+-1*24*60*60*1000);var e=d+"=; domain="+c.domain+"; path="+c.path+"; expires="+b.toString();document.cookie=e;return this}};window.JwUser={userInfo:{Gender:"",PpNum:"",ExpNum:"",LevelName:"",NextLevelName:"",NextLevelExpNum:"",Area:"",Subscribe:"",UnreadNotes:"",HeadPic:"",Email:"",OnlineTime:"",UserName:""},check:function(){var g=a.read("UDI"),e=a.read("PPName");if(g==null||e==null){return false}var c=e.split("$");this.userInfo.UserName=decodeURIComponent(c[0]);var d=g.split("$");var b=0;for(var f in this.userInfo){if(f=="UserName"){break}this.userInfo[f]=decodeURIComponent(d[b]);b++}return true},logout:function(){var b={domain:"pptv.com",path:"/"};a.dispose("UDI",b);a.dispose("PPName",b);a.dispose("PPKey",b)}}})();