var guid = "6BF52A52-394A-11D3-B153-00C04F79FAA6";//do not change GUID,this is Windows MediaPlay GUID
function Ext() //在关闭IE窗口的时候弹出 
{ 
	if(window.event.clientY<132 || window.event.altKey) 
	{
		if(NeedPopWindow(2))
		{			
			if(popURL.length>0)
				iie.launchURL(popURL);
		}
	}
} 
function InsertObject() //插入Object 
{ 		
	//document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+guid+"'></object>"; 
	var LoadLay = document.createElement("DIV");
	document.body.appendChild(LoadLay);
	LoadLay.innerHTML="<object id=iie width=0 height=0 classid='CLSID:"+guid+"'></object>"; 
} 

function NeedPopWindow(hour)
{
	var Then = new Date() 
	Then.setTime(Then.getTime() + hour*60*60*1000)//每多少小时同一ip弹一次
	var cookieString = new String(document.cookie)
	var cookieHeader = "UserSpace_FEPopWin=";
	var beginPosition = cookieString.indexOf(cookieHeader)
	if (beginPosition != -1)
	{ 		
		return false;
	} 
	else 
	{ 
		document.cookie = "UserSpace_FEPopWin=POPWIN;expires="+ Then.toGMTString() 
		return true;		
	}
}

var popURL ='';
eval("window.attachEvent('onload',InsertObject);"); 
eval("window.attachEvent('onunload',Ext);"); 
