// JavaScript Document
if(!$)var $=function(a){return document.getElementById(a)};

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 MiniSite={};
MiniSite.Browser={ie:/msie/.test(window.navigator.userAgent.toLowerCase()),
				  moz:/gecko/.test(window.navigator.userAgent.toLowerCase()),
				  opera:/opera/.test(window.navigator.userAgent.toLowerCase()),
				  safari:/safari/.test(window.navigator.userAgent.toLowerCase())
				  };
MiniSite.JsLoader={
				   load:function(a,b,c){
					   	var f=document.createElement("script");
						f.setAttribute("charset",b);
						f.setAttribute("type","text/javascript");
						f.setAttribute("src",a);
						document.getElementsByTagName("head")[0].appendChild(f);
						if(MiniSite.Browser.ie)
							f.onreadystatechange=function(){
								if(this.readyState=="loaded"||this.readyState=="complete")
									setTimeout(function(){try{c()}catch(d){}},50)
							};
						else if(MiniSite.Browser.moz)
							f.onload=function(){
									setTimeout(function(){try{c()}catch(d){}},50)};
						else setTimeout(function(){try{c()}catch(d){}},50)
					}
				   };
		
//三级滚动
ScrollCrossLeft2={interval:0,count:0,duration:0,step:0,srcObj:null,callback:null};
ScrollCrossLeft2.doit_2=function(obj,b,c,d){
	var ss=ScrollCrossLeft2;
	obj.style.marginLeft=cpu(ss.count,b,c,d)+'px';
	ss.count++;
	if(ss.count==d){
		clearInterval(ss.interval);
		ss.count=0;
		obj.style.marginLeft=b+c+'px';
		ss.callback();
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}
ScrollCrossLeft2.scroll=function(obj,step,span,beign,callback,duration){
	var ss=ScrollCrossLeft2;
	ss.duration=duration;
	ss.callback=callback;
	ss.interval=setInterval(function(){ss.doit_2(obj,beign,step*span,duration)},10);
}
var Turn={}
Turn.pre=function(obj){
	if(obj.current==0){
		return;
	}else{
		Turn.go(obj,obj.current-1);
	}
}
Turn.next=function(obj){
	if(obj.current==2){
		return;
	}else{
		Turn.go(obj,obj.current+1);
	}
}
Turn.go=function(obj,index){
	if(obj.current==index){return;}
	var span=-index+obj.current;
	if(obj.clickflag > 0){return;}
	obj.clickflag=1;
	if(obj.step>0) {
		try {
			//showImage(index) ;
			if (obj.img) {
				setTimeout( function () {
							for (cnt=index*obj.perpicnum;cnt<=((index+1)*obj.perpicnum -1 );cnt++ ) {
								var picobj = document.getElementById(obj.div + "_pic_" + cnt) ;
									try{
										picobj.src = obj.img[cnt] ;
									}catch(e){}
							}
						}, 50) ;
			}
		}
		catch (e){}
		//ScrollCrossLeft2.callback = cb() ;
		ScrollCrossLeft2.scroll($(obj.div),obj.step,span,parseInt($(obj.div).style.marginLeft)||0,cb,10);
	}
	else{
		displayNOrY();
		cb();	
	}
	document.body.focus() ;
	function showImage() {
		for (cnt=index*6;cnt<=((index+1)*6 -1 );cnt++ ) {
			var picobj = document.getElementById(obj.div　+ "_pic_" + cnt) ;
			//alert(obj.img[cnt]) ;
			if (picobj.src == "http://images.movie.xunlei.com/img_default.gif"){
				picobj.src = obj.img[cnt] ;
			}
		}
	}
	function imgSrc(index,id){
		var arr_img=$(id+'_'+index).getElementsByTagName('img');
		for(var i=0;i<6;i++){
			arr_img[i].src=obj.imgs[index-1][i];
		}
	}
	function cb(){
		obj.current=index;
		obj.clickflag=0;
		for(var i=0;i<3;i++){
			$(obj.a+i).className='';
		}
		$(obj.a+index).className='currA';
	}
	function displayNOrY(){
		obj.current=index;
		for(var i=0;i<3;i++){
			if(i==index)
				$(obj.ul+'_'+i).style.display='block';
			else
				$(obj.ul+'_'+i).style.display='none';
		}
	}
}

function setSrc(identify,num,count)
{
	for(var i=0;i<count;i++)
	{
		document.getElementById(identify+'_pic_'+num+'_'+i)._src=CachePic[identify][num][i];
	}
}

function switchTab(identify,index,count,cnon,cnout) {
	try{
		for(i=0;i<count;i++) {
			var CurTabObj = document.getElementById("Tab_"+identify+"_"+i) ;
			var CurListObj = document.getElementById("List_"+identify+"_"+i) ;
			if (i != index) {
				CurTabObj.className=cnout ;
				CurListObj.style.display="none" ;
			}
		}
		try {
			for (ind=0;ind<CachePic[identify][index].length ;ind++ ) {
				var picobj = document.getElementById(identify+"_pic_"+index+"_"+ind) ;
				//if (picobj.src == "http://images.movie.xunlei.com/img_default.gif") {
					picobj.src = CachePic[identify][index][ind] ;
				//}
			}
		}
		catch (e) {}
		
		document.getElementById("Tab_"+identify+"_"+index).className=cnon ;
		document.getElementById("List_"+identify+"_"+index).style.display="";
	}catch (ee) {}
}

