var fullScreenForLmt=true;
var SYfullscreen=false;
var adInterPath="";
var adInterPath1="";
var adInterPath2="";
var fullScreenCnt;
var ifShowTag="";
today=new Date();
var bdy=(document.documentElement&&document.documentElement.clientWidth)?document.documentElement:document.documentElement;
function $(id)
	{
		if(document.getElementById){
			
			return eval('document.getElementById("'+id+'")');
	}else
	{
		return eval("document.all."+id)
	}
}
var MSIE=navigator.userAgent.indexOf("MSIE");
var OPER=navigator.userAgent.indexOf("Opera");
var FsSt;
var ifswffs;var stFsShow;
var stFsShow1;
var ieOrfirfoxFlag = document.all;

function initFs(c){
	if(ieOrfirfoxFlag){
		document.write('<style type="text/css">  .fullScreenBlk{clear:both;width:980px;margin:0 auto;line-height:0;position:relative;z-index:9999;}  #hiddenLayer{height:0;line-height:0;font-size:0;overflow:hidden;}  #hiddenLayer #FsCls{width:77px;height:31px;overflow:hidden;background:url( http://d1.sina.com.cn/d1images/fullscreen/cls_77x31.gif) no-repeat; float:right;cursor:pointer;display:inline;}  #FsRpl{width:25px;height:100px;display:none;cursor:pointer;position:absolute;top:1px;right:-25px;z-index:9999;overflow:hidden;}  #FsRpl #FsRplSwf{position:absoulte;width:25px;height:100px;overflow:hidden;top:0;right:0;z-index:10;}  #ClsRpt{width:25px;height:17px;background:url( http://d1.sina.com.cn/d1images/fullscreen/close.gif) no-repeat right;display:none;cursor:pointer;position:absolute;top:102px;right:-25px;z-index:9999;}  </style>');
	}else{
		document.write('<style type="text/css">  .fullScreenBlk{clear:both;width:980px;margin:0 auto;line-height:0;position:relative;z-index:9999;}   </style>');
	}
	document.getElementById("FullScreenWrap").innerHTML='  <div class="fullScreenBlk">    <div id="hiddenLayer">      <div id="interstitialframe"></div>      <div id="FsCls" onclick="javascript:hideFullScreenDiv(true);return false;" title="关 闭"></div>    </div>    <div id="FsRpl"><div id="FsRplSwf"></div></div>	<div id="ClsRpt" title="关闭"></div>  </div>  <div style="clear:both;height:0;line-height:0;font-size:0;overflow:hidden;visibility:hidden;display:block;"></div>';
	$("ClsRpt").onclick=function(){$("FsRpl").style.display="none";
	$("ClsRpt").style.display="none"};
	var b=new sinaFlash(adTagPath,"adTag_swf",25,100,"7","",false,"High");
	b.addParam("wmode","transparent");b.addParam("allowScriptAccess","always");
	b.addParam("menu","false");b.write("FsRplSwf");
	if(c){
		adInterPath=adInterPath1;
		ifswffs=adInterPath.substring(adInterPath.length-3).toLowerCase();
		if(ifswffs=="swf"){
			var a=new sinaFlash(adInterPath,"fullscreen_swf",950,450,"7","",false,"High");
			a.addParam("wmode","transparent");
			a.addParam("allowScriptAccess","always");
			a.addParam("menu","false");
			a.write("interstitialframe")
		}else{
			$("interstitialframe").innerHTML="<a href='"+adInterUrl+"' target='_blank'><img src='"+adInterPath+"' width='950' height='450' border='0' /></a>"
		}
	}
}

function showfull(){
	setTimeout("changediv()",100);
	
}

function changediv(g){
	fullScreenForLmt=true;
	if(ifShowTag==""){
		$("FsCls").style.display="none"
	}
	playGif();
	
	clearTimeout(FsSt);
	if(g==1){
		adInterPath=adInterPath1
	}else
	{
		if(g==2){
			adInterPath=adInterPath2==""?adInterPath1:adInterPath2
		}
	}
	ifswffs=adInterPath.substring(adInterPath.length-3).toLowerCase();
	clearInterval(stFsShow1);$("FsRpl").style.display="none";
	$("ClsRpt").style.display="none";
	var f=0;$("hiddenLayer").style.height=f;$("hiddenLayer").style.display="block";
	var b=(ifShowTag=="")?5000:8000;
	if(ifswffs=="swf"){
		var a=new sinaFlash(adInterPath,"fullscreen_swf",980,450,"7","",false,"High");
		a.addParam("wmode","transparent");
		a.addParam("allowScriptAccess","always");
		a.addParam("menu","false");
		a.write("interstitialframe");
		$("fullscreen_swf").Rewind();
		$("fullscreen_swf").Play()
	}else{
		$("interstitialframe").innerHTML="<a href='"+adInterUrl+"' target='_blank'><img src='"+adInterPath+"' width='980' height='450' border='0' /></a>"
	}
	SYfullscreen=true;
	try{
		closeliumeiti()
	}catch(d){

	}
	try{
		hide_out()
	}catch(d){
	
	}
	var c=setInterval(
			function(){
				if(ifShowTag==""){
					f+=90;
					if(f<=450){
						$("hiddenLayer").style.height=f
					}else{
						clearInterval(c);
						FsSt=setTimeout("hideFullScreenDiv(true)",b)
					}
				}else{f+=98;
					if(f<=490){
						$("hiddenLayer").style.height=f
					}else{
						clearInterval(c);
						FsSt=setTimeout("hideFullScreenDiv(true)",b)
					}
				}
			},1)
}
	var tmpwidth=0;
	function hideFullScreenDiv(b){
		if(ifShowTag==""){
			$("FsCls").style.display="none"
		}
		clearTimeout(FsSt);
		SYfullscreen=false;
		if(b){
			if(ifShowTag==""){
				var c=450
			}else{
				var c=490
			}
		}else{
			var c=0
		}
		$("hiddenLayer").style.height=c;
		var a=setInterval(
				function(){
					if(ifShowTag==""){
						c-=90
					}else{
						c-=98
					}
					if(c>=0){
						$("hiddenLayer").style.height=c+"px"
					}else{
						clearInterval(a);
						$("hiddenLayer").style.display="none";
						fullScreenForLmt=false;
						if(ifShowTag!=""){$("FsRpl").style.display="block";
						$("ClsRpt").style.display="block";
						try{
							$("adTag_swf").Rewind();
							$("adTag_swf").Play();
							$("adTag_swf").TGotoFrame("main_mc",1);
							$("adTag_swf").TPlay("main_mc")
						}catch(f){
							
						}
						tmpwidth=0;
						$("FsRpl").style.width=tmpwidth+"px";
						$("ClsRpt").style.width=tmpwidth+"px";
						$("FsRpl").style.right=-tmpwidth+"px";
						$("ClsRpt").style.right=-tmpwidth+"px";
						$("adTag_swf").Rewind();
						$("adTag_swf").Play();
						var d=setInterval(
								function(){
									tmpwidth++;
									if(tmpwidth<=25){
										$("FsRpl").style.width=tmpwidth+"px";
										$("ClsRpt").style.width=tmpwidth+"px";
										$("FsRpl").style.right=-tmpwidth+"px";
										$("ClsRpt").style.right=-tmpwidth+"px"
									}else{
										clearInterval(d)
									}},1)
								}
						}
					},1)
	}
	function GetCookie(d){
		var b=d+"=";
		var f=b.length;
		var a=document.cookie.length;
		var e=0;
		while(e<a){
			var c=e+f;
			if(document.cookie.substring(e,c)==b){
				return getCookieVal(c)
			}
			e=document.cookie.indexOf(" ",e)+1;
			if(e==0){
				break
			}
		}
		return null
	}
	
	function SetCookie(c,e){
		var a=SetCookie.arguments;
		var h=SetCookie.arguments.length;var b=(h>2)?a[2]:null;var g=(h>3)?a[3]:null;var d=(h>4)?a[4]:null;
		var f=(h>5)?a[5]:false;
		document.cookie=c+"="+escape(e)+((b==null)?"":("; expires="+b.toGMTString()))+((g==null)?"":("; path="+g))+((d==null)?"":("; domain="+d))+((f==true)?"; secure":"")
	}
	function DeleteCookie(a){
		var c=new Date();
		c.setTime(c.getTime()-1);
		var b=0;document.cookie=a+"="+b+"; expires="+c.toGMTString()
	}
	var dToday=new Date();
	var exp=new Date(dToday.getYear(),dToday.getMonth(),dToday.getDate(),23,59,59);
	function amt(c,b){
		var c=GetCookie(b);
		if(c==null){SetCookie(b,"1");
			return 1
		}else{
			var a=parseInt(c)+1;if(a<3){c=1}SetCookie(b,a,exp);
			return c
		}
	}
	function getCookieVal(b){
		var a=document.cookie.indexOf(";",b);
		if(a==-1){
			a=document.cookie.length
		}
		return unescape(document.cookie.substring(b,a))
	}
	function playGif(){
		var b=document.getElementsByTagName("img");
		for(var a=0;a<b.length;a++){
			b[a].src=b[a].src
		}
	}
//	function getFullScreenAd(tpi,tYear,tMon,tDate,tBeg,tEnd,tUrl1,tLink,tUrl2,tTag,tIfIp,tIfTag,tRandom){
//		var mYear;
//		if(document.all) 
//			mYear=today.getYear(); 
//		else 
//			mYear=today.getYear()+1900;
//		if(mYear==tYear && 
//				today.getMonth()== eval(tMon-1) && 
//				today.getDate()== tDate && 
//				today.getHours() >= tBeg 
//				&& today.getHours() < tEnd ){
//			gotFullAd=true;
//			ifShowTag=tIfTag;
//			adInterPath1=tUrl1;
//			adInterPath2=tUrl2;
//			adInterUrl=tLink;
//			adInterPath=adInterPath2;
//			adTagPath=tTag==""?"http://d1.sina.com.cn/d1images/fullscreen/rplBtn_25x100.swf":tTag;
//			if(tIfIp==""){
//				initFs(true);
//				showfull();
//			}else{
//				if(amt(fullScreenCnt,"cntOfFullscreen"+tRandom+document.URL)==1){
//					initFs(true);
//					showfull();
//				}else{
//					initFs(false);
//					hideFullScreenDiv(false);
//					fullScreenForLmt=false
//				}
//			}
//			return true;
//		}else{
//			if(tpi==(FullScreenData.length-1)&& gotFullAd==false){
//				fullScreenForLmt=false
//				
//			}
//			return false;
//		}
//	}
	function getFullScreenAd(tpi,sYear,sMon,sDate,eYear,eMon,eDate,tUrl1,tLink,tUrl2,tTag,tIfIp,tIfTag,tRandom){
		var mYear;
		if(document.all) 
			mYear=today.getYear(); 
		else 
			mYear=today.getYear()+1900;
		if(mYear>=sYear && eYear<= mYear && today.getMonth() >= eval(sMon-1)
				&& today.getMonth() <= eval(eMon-1) && today.getDate() >= sDate
				&& today.getDate() <= eDate){
			gotFullAd=true;
			ifShowTag=tIfTag;
			adInterPath1=tUrl1;
			adInterPath2=tUrl2;
			adInterUrl=tLink;
			adInterPath=adInterPath2;
			adTagPath=tTag==""?"http://d1.sina.com.cn/d1images/fullscreen/rplBtn_25x100.swf":tTag;
			if(tIfIp==""){
				initFs(true);
				showfull();
			}else{
				if(amt(fullScreenCnt,"cntOfFullscreen"+tRandom+document.URL)==1){
					initFs(true);
					showfull();
				}else{
					initFs(false);
					hideFullScreenDiv(false);
					fullScreenForLmt=false
				}
			}
			return true;
		}else{
			if(tpi==(FullScreenData.length-1)&& gotFullAd==false){
				fullScreenForLmt=false
				
			}
			return false;
		}
	}
	
	var gotFullAd=false;
	if(FullScreenData.length==0){
		
		fullScreenForLmt=false
		
	}else{
		if(FullScreenData.length>0){
			
			for(var i=0;i<FullScreenData.length;i++){
				var setDate=FullScreenData[i][0].split("-");
				var setTime=setDate[2].split("#");
				var viewFlag = getFullScreenAd(i,setDate[0],setDate[1],setTime[0],setTime[1],setDate[3],setDate[4],FullScreenData[i][1],FullScreenData[i][2],FullScreenData[i][3],FullScreenData[i][4],FullScreenData[i][5],FullScreenData[i][6],FullScreenData[i][0])
				//var setTime=setDate[3].split("#");
				//var viewFlag = getFullScreenAd(i,setDate[0],setDate[1],setDate[2],setTime[0],setTime[1],FullScreenData[i][1],FullScreenData[i][2],FullScreenData[i][3],FullScreenData[i][4],FullScreenData[i][5],FullScreenData[i][6],FullScreenData[i][0])
				if(viewFlag){
					break;
				}
			}
			
		}
	};