function switchTab(identify,index,count) {
	for(i=0;i<count;i++) {
		var CurTabObj = document.getElementById("Tab_"+identify+"_"+i) ;
		var CurListObj = document.getElementById("List_"+identify+"_"+i) ;
		if (i != index) {
			fRemoveClass(CurTabObj , "upH2") ;
			fRemoveClass(CurListObj , "upBox") ;
		}
	}
	fAddClass(document.getElementById("Tab_"+identify+"_"+index),"upH2") ;
	fAddClass(document.getElementById("List_"+identify+"_"+index),"upBox") ;
}
function getid(item){
	return document.getElementById(item);
}
function c_getCookie(sName){
	var sSearch = sName + "=";
	var iOffset = document.cookie.indexOf(sSearch);
	if (iOffset != -1) {
		iOffset += sSearch.length;
		var iEnd = document.cookie.indexOf(";", iOffset);
		if (iEnd == -1)
			iEnd = document.cookie.length;
		return unescape(document.cookie.substring(iOffset, iEnd));
	}else 
		return "";
}

//向左滚动
ScrollCrossLeft={interval:0,count:0,duration:0,step:0,srcObj:null,callback:null};
ScrollCrossLeft.doit=function(obj,b,c,d){
	var s=ScrollCrossLeft;
	obj.style.marginLeft=cpu(s.count,b,c,d)+'px';
	s.count++;
	if(s.count==d){
		clearInterval(s.interval);
		s.count=0;
		obj.style.marginLeft=b+c+'px';
		s.callback();
	}
	function cpu(t,b,c,d) {return c*((t=t/d-1)*t*t+1)+b;};
}
ScrollCrossLeft.scroll=function(obj,step,span,beign,callback,duration){
	var s=ScrollCrossLeft;
	s.duration=duration;
	s.callback=callback;
	s.interval=setInterval(function(){s.doit(obj,beign,step*span,duration)},10);
}
//首页
var HotPlay={current:0,step:468,a:'a_hp_',div:'div_hp_content',ul:'ul_hp',clickflag:0}
var Movie_red={current:0,step:230,a:'a_m_red_',div:'div_m_red_content',ul:'ul_m_red',clickflag:0}
var Movie_new={current:0,step:230,a:'a_m_new_',div:'div_m_new_content',ul:'ul_m_new',clickflag:0}
var TV_red={current:0,step:230,a:'a_tv_red_',div:'div_tv_red_content',ul:'ul_tv_red',clickflag:0}
var TV_new={current:0,step:230,a:'a_tv_new_',div:'div_tv_new_content',ul:'ul_tv_new',clickflag:0}
//综艺首页
var Brand_column={current:0,step:0,a:'a_brand_column_',div:'div_brand_column_content',ul:'ul_brand_column'}

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)
		ScrollCrossLeft.scroll(getid(obj.div),obj.step,span,parseInt(getid(obj.div).style.marginLeft)||0,cb,10);
	else{
		displayNOrY();
		cb();	
	}
	function imgSrc(index,id){
		var arr_img=getid(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++){
			getid(obj.a+i).className='';
		}
		getid(obj.a+index).className='currA';
	}
	function displayNOrY(){
		obj.current=index;
		for(var i=0;i<3;i++){
			if(i==index)
				getid(obj.ul+'_'+i).style.display='block';
			else
				getid(obj.ul+'_'+i).style.display='none';
		}
	}
}