document.write('<div id="epop" style="Z-INDEX:99999;left:0px;visibility:hidden; POSITION:absolute; TOP:0px;"> ');
document.write('<table width="290" border="0" cellpadding="0" cellspacing="0" style="border:1px #79DFF6 solid;background:#DC0000;">');
document.write('<tr>');
document.write('<td width="229" height="20" background="/images/popbg.jpg" style="color:#005985; font-weight:bold;text-align:left;">&nbsp;<span class="STYLE1">Stone Messenger</span></td>');
//document.write('<td width="61" background="/images/popbg.jpg" align="right"><img src="/images/popmin.gif" width="15" height="15" onclick="changeDiv();" id="ctrl" style="cursor:pointer;" /><img style="cursor:pointer;" src="/images/popclose.gif" width="15" height="15" onclick="closeDiv();" />&nbsp;</td>');
document.write('<td width="61" background="/images/popbg.jpg" align="right">&nbsp;<img style="cursor:pointer;" src="/images/popclose.gif" width="15" height="15" onclick="closeDiv();" />&nbsp;</td>');
document.write('</tr><tr>');
document.write('<td colspan="2" id="popad">');
//document.write('<iframe width=290 height=135 marginwidth=0 maginheight=0 frameborder=0 scrolling=no src="/images/pop290x135.jpg"></iframe></td></tr></table></div>');
document.write('<a href="http://www.stonebtb.com/messenger/FunctionIntr/index.htm" target="_blank"><img  src="/images/pop290x135.jpg" /></a></td></tr></table></div>');
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
function getMsg()
{
	try{
	divTop = parseInt(document.getElementById("epop").style.top,10);
	divLeft = parseInt(document.getElementById("epop").style.left,10);
	divHeight = parseInt(document.getElementById("epop").offsetHeight,10);
	divWidth = parseInt(document.getElementById("epop").offsetWidth,10);
	docWidth = bodyfrm.scrollLeft;
	docHeight = bodyfrm.clientHeight;
	document.getElementById("epop").style.top = parseInt(bodyfrm.scrollTop,10) + docHeight + 10+"px";//  divHeight
	document.getElementById("epop").style.left = parseInt(bodyfrm.scrollLeft,10)+2+"px";
	document.getElementById("epop").style.visibility="visible"
	objTimer = window.setInterval("moveDiv()",10)
	}
	catch(e){}
}

function resizeDiv()
	{
	try{
	divHeight = parseInt(document.getElementById("epop").offsetHeight,10)
	divWidth = parseInt(document.getElementById("epop").offsetWidth,10)
	docWidth = document.documentElement.clientWidth;
	docHeight = bodyfrm.clientHeight;
	document.getElementById("epop").style.top = docHeight - divHeight + parseInt(bodyfrm.scrollTop,10)+"px";
	document.getElementById("epop").style.left = parseInt(bodyfrm.scrollLeft,10)+2+"px";
	}
	catch(e){}
}

function moveDiv()
{
	try
	{
	if(parseInt(document.getElementById("epop").style.top,10) <= (docHeight - divHeight + parseInt(bodyfrm.scrollTop,10)))
	{
	window.clearInterval(objTimer)
	objTimer = window.setInterval("resizeDiv()",1)
	}
	divTop = parseInt(document.getElementById("epop").style.top,10)
	document.getElementById("epop").style.top = divTop - 8+"px";
	}
	catch(e){}
}

function closeDiv()
{
	document.getElementById('epop').style.visibility='hidden';
	if(objTimer) window.clearInterval(objTimer)
}
function changeDiv(){
	var cobj = document.getElementById('ctrl').src;	
	if(cobj=="/images/popmin.gif") {
		document.getElementById('popad').innerHTML = "";
		document.getElementById('ctrl').src = "/images/popmax.gif";
		}
	if(cobj=="/images/popmax.gif"){
		document.getElementById('ctrl').src = "/images/popmin.gif";
		document.getElementById('popad').innerHTML = '<iframe width=290 height=135 marginwidth=0 maginheight=0 frameborder=0 scrolling=no src="http://www.stonebtb.com/iframe/iframe_ad_290x135.html"></iframe>';
		}
		
}
	window.onload = getMsg;
	window.onresize = resizeDiv;
	window.setTimeout(closeDiv,5000);
	//window.onerror = function(){}

