/**跨栏广告 begin**/
function CoupletMediaOpenWin(){
  var pthis = this;//设置指针
  var o = new SinaDotAdJs();//加载通用类
  var d = CoupletMediaData;//加载数据
  var rn = 2;//轮播数
  if(o.$("SteamMediaWrap")){var w = o.$("SteamMediaWrap");}else{var w = false;}//加载容器对象
  this.cd = new Array();
  this.ctimer = null;
  this.ctimer_ext = null;
  this.ctimer_lft = null;
  this.tmpWidth = 0;
  this.isext = false;
  this.ishide = false;

   //跨栏构造函数
   this.initAdCM = function(ul,ur,ue,l,tk,tp){

     //容器构造
     //主容器
     eval(o.initWrap(0x02,"CoupletMediaWrap","cmWrap",950,0,"","","","","","","0 auto","0","none","block"));

     //左栏部分
     eval(o.initWrap(0x01,"div","clWrap",25,348,"absolute","0","","0","","99","0","0","none","none"));
     clWrap.style.top = tp + "px";
     cmWrap.appendChild(clWrap);
     eval(o.initWrap(0x01,"div","cliWrap",25,300,"absolute","0","","0","","","0","0","","block"));
     clWrap.appendChild(cliWrap);
     eval(o.initWrap(0x01,"div","clcBtn",25,48,"absolute","0","","300","","","0","0","url(http://d1.sina.com.cn/d1images/lmt/close2.gif) no-repeat center","block"));
     clcBtn.style.cursor = "pointer";
     clWrap.appendChild(clcBtn);

     //右栏部分
     eval(o.initWrap(0x01,"div","crWrap",25,348,"absolute","","0","0","","99","0","0","none","none"));
     crWrap.style.top = tp + "px";
     cmWrap.appendChild(crWrap);
     eval(o.initWrap(0x01,"div","criWrap",25,300,"absolute","0","","0","","","0","0","","block"));
     crWrap.appendChild(criWrap);
     eval(o.initWrap(0x01,"div","crcBtn",25,48,"absolute","0","","300","","","0","0","url(http://d1.sina.com.cn/d1images/lmt/close2.gif) no-repeat center","block"));
     crcBtn.style.cursor = "pointer";
     crWrap.appendChild(crcBtn);

     //触发部分
     eval(o.initWrap(0x01,"div","ceWrap",950,90,"absolute","0","","0","","9999","0","0","","none"));
     ceWrap.style.top = tp + "px";
	 cmWrap.appendChild(ceWrap);
	 eval(o.initWrap(0x01,"div","ceiWrap",0,90,"","0","","0","","","0 auto","0","","block"));
	 ceiWrap.style.overflow = "hidden";
	 ceWrap.appendChild(ceiWrap);
	 eval(o.initWrap(0x01,"div","cecBtn",66,22,"absolute","","0","","-22","9999","0","0","url(http://d2.sina.com.cn/d1images/lmt/cls_66x22.gif) no-repeat","block"));
	 cecBtn.style.cursor = "pointer";
	 ceWrap.appendChild(cecBtn);

	 this.getCMPos = function(){
	   ceWrap.style.left = (cmWrap.offsetLeft=="undefined"?((o.bdy.offsetWidth - w)/2-(o.isIE6?16:0)):(cmWrap.offsetLeft!=0?cmWrap.offsetLeft:cmWrap.parentNode.offsetLeft))+"px";
	   pthis.ctimer_lft = setTimeout("getCMPos()",50);
	 }

	 //隐藏跨栏
	 this.hideCM = function(){
	   this.isext = false;
	   clearTimeout(pthis.ctimer);
	   clearTimeout(pthis.ctimer_lft);
	   clearInterval(pthis.ctimer_ext);
	   cliWrap.innerHTML = "";
	   criWrap.innerHTML = "";
	   ceiWrap.innerHTML = "";
	   var cliObj = o.initObj("CoupletMediaLeftObj",ul,l,25,300);
       cliWrap.appendChild(cliObj);
	   var criObj = o.initObj("CoupletMediaRightObsj",ur,l,25,300);
       criWrap.appendChild(criObj);
       clWrap.style.display = "block";
	   crWrap.style.display = "block";
	   ceWrap.style.display = "none";
	 };
	 //点击隐藏
	 this.clcHideCM = function(){
	   pthis.ishide = true;
	   pthis.hideCM();
	 };
	 //显示跨栏
	 this.showCM = function(){
       if(!pthis.isext && !pthis.ishide){
		 pthis.getCMPos();
		 this.isext = true;
	     clearTimeout(pthis.ctimer);
		 ceiWrap.style.width = 0;
         pthis.tmpWidth = 0;
	     var ceiObj = o.initObj("CoupletMediaExtObsj",ue,l,950,90);
	     ceiWrap.appendChild(ceiObj);
	     ceWrap.style.display = "block";
		 pthis.ctimer_ext = setInterval(function(){
		   if(pthis.tmpWidth<950){
		     pthis.tmpWidth+=50;
             ceiWrap.style.width = pthis.tmpWidth + "px";
		   }else{
		     clearInterval(pthis.ctimer_ext);
		   }
		 },1);
	     pthis.ctimer = setTimeout(function(){pthis.hideCM();},8000);
		 if(tk!=""){
		   var cTmpTracker = new Image();
           cTmpTracker.src=tk+"&"+Math.random();
		 }
	   }
	 };
     //关闭跨栏
	 this.closeCM = function(){
	   clearTimeout(pthis.ctimer);
	   clearTimeout(pthis.ctimer_lft);
	   clearInterval(pthis.ctimer_ext);
	   cmWrap.innerHTML = "";
	 };

	 o.addEvent(cliWrap,"mouseover",pthis.showCM);//注册左触发事件
	 o.addEvent(criWrap,"mouseover",pthis.showCM);//注册右触发事件
	 o.addEvent(clcBtn,"click",pthis.closeCM);//注册左关闭事件
	 o.addEvent(crcBtn,"click",pthis.closeCM);//注册右关闭事件
	 o.addEvent(cecBtn,"click",pthis.clcHideCM);////注册触发关闭事件

	 pthis.hideCM();//加载广告
	 try{nextAD();}catch(e){}//加载后续广告

   }

  //时间过滤
  this.ifCMAD = false;
  if(w && d.length>0){
    for(var i=0;i<d.length;i++){
	  if(o.checkTime(d[i][0],d[i][1])){this.ifCMAD = true;this.cd.push([d[i][2],d[i][3],d[i][4],d[i][5],d[i][6],d[i][7]]);}
	}
	if(!this.ifCMAD){try{nextAD();}catch(e){}}
  }else{
     try{nextAD();}catch(e){}
   }
  this.cid = o.getAdCookie("CoupletMedia"+document.URL);
  this.cid = this.cid==""?Math.floor(Math.random()*rn):++this.cid;
  this.cid = this.cid>=rn?0:this.cid;
  if(typeof(this.cd[this.cid])!="undefined"){
	pthis.initAdCM(this.cd[this.cid][0],this.cd[this.cid][1],this.cd[this.cid][2],this.cd[this.cid][3],this.cd[this.cid][4],this.cd[this.cid][5]);
  }else{try{nextAD();}catch(e){}}
  o.setAdCookie("CoupletMedia"+document.URL,this.cid,1440);

}
try{arryADSeq.push("CoupletMediaOpenWin()");}catch(e){CoupletMediaOpenWin();}
/**跨栏广告 end**/

/****************************************************/
/******** Sales dept. end ********/
