
function setCookie(name, value, expires, path, domain, secure){
	var expires = new Date();
	expires.setTime(expires.getTime() + 24*60*60*1000);
	var domain=".zgyey.com"
	var s = name + "=" + escape(value) +
	((expires) ? "; expires=" + expires.toGMTString(): "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
	document.cookie=s;
}

function getCookie(name){
	return unescape(document.cookie.replace(new RegExp(".*(?:^|; )"+name+"=([^;]*).*|.*"),"$1"));
}

//关闭,最小化,最大化
function showDiv(innerCall){
    if(document.getElementById('PcPoPmarket')==null)return;
	if(Number(getCookie("divStatus"))==1 && !!innerCall){
		closeDiv();
	}else if (Number(getCookie("divStatus"))==2 && !!innerCall)
	{
		hideDiv();
	}else{
		document.getElementById('PcPoPmarket').style.height = 223+'px';
//		document.getElementById('showvod').style.display = 'none';
//		document.getElementById('hidevod').style.display = 'block';
	}
}

function hideDiv(innerCall){
    if(document.getElementById('PcPoPmarket')==null)return;
	document.getElementById('PcPoPmarket').style.height = 29 + 'px';
	document.getElementById('hidevod').style.display = 'none';
	document.getElementById('showvod').style.display = 'block';
	if(!innerCall)setCookie("divStatus",2);
}

function closeDiv(innerCall){
    if(document.getElementById('PcPoPmarket')==null)return;
	document.getElementById('PcPoPmarket').style.display = 'none';
//	if(!innerCall)setCookie("divStatus",1);
}

document.write("<span style=\"background: none;\" id=tmppupupwinDiv></span>");


function writepupupwinDiv() {
	
	    var s="";
	    try{			
			if(document.compatMode && document.compatMode != 'BackCompat'){
				s+=('<DIV  style="background: none;z-index:1000;right:0;bottom:0; height:223px;width:280px;overflow:hidden;POSITION:fixed;_position:absolute; _top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);" id="PcPoPmarket" >');
			}else {
				s+=('<DIV  style="background: none;z-index:1000;right:0;bottom:0; height:223px;width:280px;overflow:hidden;POSITION:fixed;*position:absolute; *top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-this.style.pixelHeight);" id="PcPoPmarket" >');
			}
			s+=(' <div style="background: none;z-index:1000; POSITION: absolute; width:280px; height:30px; overflow:hidden;"><span style="CURSOR: pointer;float:left;clear:none; width:123px; height:14px; overflow:hidden; margin:10px 5px;"></span><span style="CURSOR: pointer;float:right;clear:none; width:20px; height:20px; margin:20px 13px;" onclick=closeDiv()></span></div>');
			s+=("<iframe scrolling=no frameborder=0 width=280 height=223 src=/popupwinmessage.aspx>-</iframe>");
			s+=('</DIV>');
			document.getElementById('tmppupupwinDiv').innerHTML = s;
//			setTimeout('hideDiv(true);', 25000);
		}catch(err){}
	
	showDiv(true);
}