/*=====v4.0=====*/

if(self!=top){top.location=self.location;}

function play(){
	$("loading2").style.display=""
	$("loading1").style.display="none"
}
function $(id){ return document.getElementById(id)}

function tab(nId,nTag,mId,mTag){
 if(!document.getElementById(nId)||!document.getElementById(mId)) return false;
 this.aNavTag=document.getElementById(nId).getElementsByTagName(nTag);
 this.oMain=document.getElementById(mId);
 this.aMainTag=this.oMain.getElementsByTagName(mTag);
 this.eventType=["onclick","onmouseover"];
 this.sets={
	  evt:0,
	  indexNub:0,
	  auto:[0,2000],
	  curClass:"cur",
	  intTabTime:50
	  }
this.aNtag=[];this.aMtag=[];
var _this=this;
this.tabAction=function(obj){
					 this.lastLi.className=this.lastLi.className.replace(this.sets.curClass,"");
					 if(obj.className.indexOf(this.sets.curClass)==-1){obj.className+=" "+this.sets.curClass;}
					 this.lastLi=obj;
					 if(this.lastDiv&&this.lastDiv!=this.aMtag[obj.cNub]){this.lastDiv.style.display="none"}
					 this.aMtag[obj.cNub].style.display="block";
					 this.lastDiv=this.aMtag[obj.cNub];
                     }
this.autoplay=function()
         {
		  _this.sets.indexNub = (_this.sets.indexNub<_this.aNtag.length-1) ? _this.sets.indexNub+1 :0;
		  _this.tabAction(_this.aNtag[_this.sets.indexNub]);
          }
this.backplay=function()
         {
		  _this.sets.indexNub = (_this.sets.indexNub!=0) ? _this.sets.indexNub-1 :_this.aNtag.length-1;
		  _this.tabAction(_this.aNtag[_this.sets.indexNub]);
          }
this.autoFun=function(){if(this.intAuto){clearInterval(this.intAuto)};this.intAuto=setInterval(this.autoplay,this.sets.auto[1]);this.key=0;}
this.clearAuto=function(){clearInterval(this.intAuto);this.key=1;}
this.autoKey=function(){
    this.autoFun();
    for(var m=0;m<this.aNtag.length;m++){
	if(this.intAuto){
		if(this.sets.evt==0){this.aNtag[m].onmouseover=function(){if(this.className.indexOf(_this.sets.curClass)!=-1&&_this.key==0){_this.clearAuto();}}}
		this.aNtag[m].onmouseout=function(){if(_this.key==1){_this.autoFun();};if(_this.intTab){clearTimeout(_this.intTab)}}
		this.aMtag[m].onmouseover=function(){_this.clearAuto()};this.aMtag[m].onmouseout=function(){_this.autoFun()} }
                    }
	                               }
this.run=function(){
		  for(var i=0;i<this.aMainTag.length;i++){if(this.aMainTag[i].parentNode==this.oMain){this.aMtag.push(this.aMainTag[i]);}}
		  for(var j=0;j<this.aNavTag.length;j++){if(!this.aNavTag[j].getAttribute("lang")){this.aNtag.push(this.aNavTag[j]);}}
		  if(this.aMtag.length!=this.aNtag.length){alert("选项卡导航和主体的数量不一样");}
		  if(this.aNtag[this.sets.indexNub].className.indexOf(this.sets.curClass)==-1){this.aNtag[this.sets.indexNub].className+=" "+this.sets.curClass;}
		  this.lastLi=this.aNtag[this.sets.indexNub];
		  this.lastDiv=this.aMtag[this.sets.indexNub];
		  for(var n=0;n<this.aNtag.length;n++){
				this.aNtag[n].cNub=n;
				this.aNtag[n][this.eventType[this.sets.evt]]=function(){
				var othis=this;
				if(_this.intTab){clearTimeout(_this.intTab)}
				_this.intTab=setTimeout(function(){
				   if(_this.intAuto){_this.clearAuto()};
				   _this.tabAction(othis);
				   _this.sets.indexNub=othis.cNub;},_this.sets.intTabTime);
				   return false;
				  }
			   if(this.sets.auto[0]!=1){this.aNtag[n].onmouseout=function(){if(_this.intTab){clearTimeout(_this.intTab)}}};
			 }
			if(this.sets.auto[0]==1){this.autoKey();}

 }

}

function $(objID) {return document.getElementById(objID)};
function search_form_submit(){
	if(document.getElementById('mkey').value=="" || document.getElementById('mkey').value=="输入电影,明星开始搜索"){
		alert('请输入关键词');return;
	}
	document.getElementById('topSearch').target="";			
	document.getElementById('topSearch').submit();
}
function detail_q(v,m_type3){
	for(var i=0;i<20;i++){
		if($("urls"+i)){
			$("urls"+i).style.display="none"
			$("ahref_"+i).className="ggg"
		}
	}
	$("reals_xg_new").innerHTML=$("urls"+v).innerHTML
	$("ahref_"+v).className="ggg_hover"
	$("bk_pagePaly_new_span").innerHTML=m_type3
	//播放器下载地址+样式
	detail_class(m_type3)

}
function detail_class(m_type3){
	if(m_type3.indexOf("qvod")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载Qvod播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=6"
		$("bk_downLoad_new_url").className="qvod"
	}else if(m_type3.indexOf("xunlei")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载Gvod播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=3"
		$("bk_downLoad_new_url").className="xunlei"
	}else if(m_type3.indexOf("bobo")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载BOBO播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=1"
		$("bk_downLoad_new_url").className="bobo"
	}else if(m_type3.indexOf("WebPlayer")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载远古播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=8"
		$("bk_downLoad_new_url").className="WebPlayer"
	}else if(m_type3.indexOf("rm")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载RealPlayer播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=4"
		$("bk_downLoad_new_url").className="rm"
	}else if(m_type3.indexOf("wmv")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载Media Player播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=5"
		$("bk_downLoad_new_url").className="wmv"
	}else if(m_type3.indexOf("BlPlayer")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载宝丽通播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=7"
		$("bk_downLoad_new_url").className="BlPlayer"
	}else if(m_type3.indexOf("pipi")!=-1){
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载皮皮播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=10"
		$("bk_downLoad_new_url").className="pipi"
	}else{
		$("bk_downLoad_new_url").innerHTML=m_type3
		$("bk_downLoad_new_url").title="点击下载最新Flash播放器"	
		$("bk_downLoad_new_url").href=baocuo_dir+"p_inc/down.asp?v=2"
		$("bk_downLoad_new_url").className="flash"		
	}	
}

function add_21(){
	str=("<a href=\"javascript:location.href=\'http:\/\/www.google.com\/bookmarks\/mark?op=add&amp;bkmk=\'+encodeURIComponent(location.href)+\'&amp;title=\'+encodeURIComponent(document.title)\">Google书签<\/a> ");			
	str+=("<a href=\"javascript:u=location.href;t=document.title;c = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url=%22http:\/\/cang.baidu.com\/do\/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=ien#nw=1%22;window.open(url,%22_blank%22,%22scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes%22); void 0\" title=\"百度收藏\">百度收藏<\/a>");
	str+=("<a href=\"javascript:window.open(\'http:\/\/myweb.cn.yahoo.com\/popadd.html?url=\'+encodeURIComponent(document.location.href)+\'&title=\'+encodeURIComponent(document.title),\'favit\',\'width=780,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes\');void(0)\">雅虎收藏<\/a>");
	str+=("<a href=\"javascript:window.open(\'http:\/\/shuqian.qq.com\/post?from=3&title=\'+encodeURIComponent(document.title)+\'&uri=\'+encodeURIComponent(document.location.href)+\'&jumpback=2&noui=1\',\'favit\',\'width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes\');void(0)\">QQ书签<\/a>");	
	document.write(str)
}
function Munu_Cur_Tab(v){
	for(var ii=1;ii<=6;ii++){
		$("Menu_cur"+ii).className=""	
	}
	$("Menu_cur"+v).className="cur"	
}
function h(obj,url){obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);}
