if(!$)var $=function(a){return document.getElementById(a)};function getCookie(a){var b=a+"=";a=document.cookie.indexOf(b);if(a!=-1){a+=b.length;b=document.cookie.indexOf(";",a);if(b==-1)b=document.cookie.length;return unescape(document.cookie.substring(a,b))}else return""}function _getCookie(a){return document.cookie.match(RegExp("(^"+a+"| "+a+")=([^;]*)"))==null?"":decodeURIComponent(RegExp.$2)}String.prototype.len=function(){return this.replace(/[^\x00-\xff]/g,"rr").length};
String.prototype.sub=function(a){var b=/[^\x00-\xff]/g;if(this.replace(b,"mm").length<=a)return this;for(var c=Math.floor(a/2);c<this.length;c++)if(this.substr(0,c).replace(b,"mm").length>=a)return this.substr(0,c)+"...";return this};function setCookie(a,b,c){c=new Date((new Date).getTime()+c*36E5);document.cookie=a+"="+escape(b)+"; path=/; domain=xunlei.com; expires="+c.toGMTString()}
function delCookie(a){var b=new Date((new Date).getTime());document.cookie=a+"= ; path=/; domain=xunlei.com; expires="+b.toGMTString()}var EventUtil={};EventUtil.addEventHandler=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,false);else if(a.attachEvent)a.attachEvent("on"+b,c);else a["on"+b]=c};EventUtil.removeEventHandler=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,false);else if(a.detachEvent)a.detachEvent("on"+b,c);else a["on"+b]=null};
ScrollCrossLeft={interval:0,count:0,duration:0,step:0,srcObj:null,callback:null};ScrollCrossLeft.doit=function(a,b,c,f){BigNews.OnScrolling=true;var d=ScrollCrossLeft;a.style.marginLeft=function(g,e,h,j){return h*((g=g/j-1)*g*g+1)+e}(d.count,b,c,f)+"px";d.count++;if(d.count==f){clearInterval(d.interval);d.count=0;a.style.marginLeft=b+c+"px";d.callback();BigNews.OnScrolling=false}};ScrollCrossLeft2={interval:0,count:0,duration:0,step:0,srcObj:null,callback:null};
ScrollCrossLeft2.doit_2=function(a,b,c,f){var d=ScrollCrossLeft2;a.style.marginLeft=function(g,e,h,j){return h*((g=g/j-1)*g*g+1)+e}(d.count,b,c,f)+"px";d.count++;if(d.count==f){clearInterval(d.interval);d.count=0;a.style.marginLeft=b+c+"px";d.callback()}};ScrollCrossLeft2.scroll=function(a,b,c,f,d,g){var e=ScrollCrossLeft2;e.duration=g;e.callback=d;e.interval=setInterval(function(){e.doit_2(a,f,b*c,g)},10)};var B=BigNews={current:0,next:0,scrollInterval:0,autoScroller:0,s:{},OnScrolling:false};
BigNews.turn=function(a,b){if(BigNews.OnScrolling)return false;clearInterval(BigNews.autoScroller);BigNews.scroll(a,b)};
BigNews.scroll=function(a,b){var c=b.step,f=BigNews;f.next=a;try{clearInterval(BigNews.s.interval)}catch(d){}if(b.pictxt!=null&&b.pictxt!="")$(b.pictxt+"_"+a).style.display="block";var g=-a+f.current;$(b.bigpic);BigNews.s.duration=16;BigNews.s.callback=function(){BigNews.current=a;for(i=0;i<b.totalcount;i++)if(i==a)$("big_pic_nav_"+i).className="on";else $("big_pic_nav_"+i).className=""};var e=parseInt($(b.bigpic).style.marginLeft)||0;if($("bigpic_"+a).src=="http://images.movie.xunlei.com/img_default.gif")try{setTimeout('$("bigpic_'+
a+'").src = ScrollBigPic['+a+"] ;",50)}catch(h){}BigNews.s.interval=setInterval(function(){BigNews.s.doit($(b.bigpic),e,c*g,16)},10)};BigNews.auto=function(a){clearInterval(BigNews.autoScroller);BigNews.autoScroller=setInterval(function(){BigNews.scroll(BigNews.current==a.totalcount-1?0:BigNews.current+1,a)},a.autotimeintval)};BigNews.pauseSwitch=function(){clearTimeout(BigNews.autoScroller)};
BigNews.showNext=function(a,b){if(a>=MovieRecom.totalcount-1){document.body.focus();return false}else{BigNews.pauseSwitch();BigNews.turn(a+1,b);BigNews.auto(b);document.body.focus()}};BigNews.showPre=function(a,b){if(a<=0){document.body.focus();return false}else{BigNews.pauseSwitch();BigNews.turn(a-1,b);BigNews.auto(b);document.body.focus()}};
BigNews.init=function(a){BigNews.s=ScrollCrossLeft;EventUtil.addEventHandler($(a.bigpic),"mouseover",new Function("BigNews.pauseSwitch();"));EventUtil.addEventHandler($(a.bigpic),"mouseout",new Function("BigNews.auto("+a.objname+");"));for(i=0;i<a.totalcount;i++)a.smallpic!=null&&a.smallpic!=""&&EventUtil.addEventHandler($(a.smallpic+"_"+i),"click",new Function("BigNews.pauseSwitch();BigNews.turn("+i+","+a.objname+");BigNews.auto("+a.objname+");document.body.focus();return false;"));BigNews.auto(a)};
