window.onresize = resizeDiv;
window.onerror = function(){};
//短信提示使用(FHB添加)

var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg(){
	try{
		//var cookieString = new String(document.cookie);
		//var cookieHeader = 'float_ads=';
		//var beginPosition = cookieString.indexOf(cookieHeader);
		//if(beginPosition<0){ 
			divTop = parseInt(document.getElementById("eMeng").style.top,10);
			divLeft = parseInt(document.getElementById("eMeng").style.left,10);
			divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
			divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
			docWidth = document.documentElement.clientWidth;
			docHeight = document.documentElement.clientHeight;
			scrollTop = document.documentElement.scrollTop;
			scrollLeft = document.documentElement.scrollLeft;

			document.getElementById("eMeng").style.top = parseInt(scrollTop,10) + docHeight + 10;
			document.getElementById("eMeng").style.left = parseInt(scrollLeft,10) + docWidth - divWidth
			document.getElementById("eMeng").style.visibility="visible";
			objTimer = window.setInterval("moveDiv()",1);
			var Then = new Date();
			Then.setTime(Then.getTime() + 1000);
			document.cookie = 'float_ads=yes;expires='+ Then.toGMTString();
		//} 
	 }
	 catch(e){}
}

function resizeDiv(){
	i+=1
		try{
		divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
		divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
		docWidth = document.documentElement.clientWidth;
		docHeight = document.documentElement.clientHeight;
		scrollTop = document.documentElement.scrollTop;
		scrollLeft = document.documentElement.scrollLeft;
		document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(scrollTop,10);
		document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(scrollLeft,10);
	}
	catch(e){}
}

function moveDiv(){
	try{
		if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10))){
			window.clearInterval(objTimer);
			objTimer = window.setInterval("resizeDiv()",1);
		}

		divTop = parseInt(document.getElementById("eMeng").style.top,10)
		document.getElementById("eMeng").style.top = divTop - 5;
	}
	catch(e){}
}

function closeDiv(){
	document.getElementById('eMeng').style.visibility='hidden';
	if(objTimer) window.clearInterval(objTimer)
}

document.write("<div id='eMeng' style='border-right: #455690 1px solid; border-top: #a6b4cf 1px solid; z-index:99999; left: 0px; visibility: hidden; border-left: #a6b4cf 1px solid; width: 202px; border-bottom: #455690 1px solid; position: absolute; top: 0px; background-color: #c9d3f3'><table style='border-top: #ffffff 1px solid; border-left: #ffffff 1px solid' cellspacing='0' cellpadding='0' width='100%' bgcolor='#def0fa' border='0'> <tbody><tr><td width='13%' valign='top'><img src='http://bbs.house365.com/images/2_03.gif' width='28' height='20' /></td><td width='75%' height='20' background='http://bbs.house365.com/images/2_05.gif' valign='top'><a href='http://www.house365.com/index.html'><span style='font-size:13px; color: #0063A4; text-decoration: none; font-weight: bold; line-height: 20px;'>365地产家居网</span></a></td> <td width='12%'><span title='关闭' style='cursor: hand; color:white; font-size:12px; font-weight:bold; margin-right:4px;' onclick='closeDiv()'><img src='http://bbs.house365.com/images/2_06.gif' width='25' height='20' /></span></td></tr> <tr><td colspan='3' bgcolor='#ffffff' align='center' valign='middle'><span style='margin-bottom: 2px'><embed src='http://img3.house365.com/njads/2013/06/26/137221096251ca4712956f8.swf' quality='high' width='200' height='160' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></span></td></tr> <tr><td colspan='3' bgcolor='#ffffff' height='3'></td></tr></tbody> </table></div>");

getMsg();

