function hideAd(divId) 
{
	if (document.layers) document.layers[divId].visibility = 'hide';
	else if (document.all) document.all[divId].style.visibility = 'hidden';
	else if (document.getElementById) document.getElementById(divId).style.visibility = 'hidden';
}

function adDown(divId) 
{
	var state=typeof topPos;
	if(state=='undefined') topPos=-260;
	if(topPos < 75)
	{
		topPos+=3;
		if (document.layers) document.layers[divId].top = topPos;
		else if (document.all) document.all[divId].style.top = topPos;
		else if (document.getElementById) document.getElementById(divId).style.top = topPos;	
		
		setTimeout("adDown('pop');",25);
	}
}

function initAd()
{
	if (parseInt(navigator.appVersion) >= 4 && navigator.javaEnabled()) 
	{
		document.write('<div id="popbg" style="position: absolute; left: 0; top: 0; z-index: 98; background: black; opacity: 0.5; moz-opacity: 0.5; filter: alpha(opacity=50); "></div>');
		if (document.layers) { document.layers.popbg.width = window.innerWidth; document.layers.popbg.height = window.innerHeight; }
		else if (document.all) { document.all.popbg.style.width = document.body.offsetWidth; document.all.popbg.style.height = document.body.offsetHeight}
		else if (document.getElementById) { document.getElementById("popbg").style.width = window.innerWidth; document.getElementById("popbg").style.height = window.innerHeight; }
		
		document.write('<div id="pop" style="position: absolute; left: 0; top: 0; z-index: 99;">');
		document.write('<table cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" border="0">');
		document.write('<tr><td align="right" height="24"><a href="#" onclick="hideAd(\'pop\');hideAd(\'popbg\');"><img src="/gfx/closelabel.gif" border="0"></a></td></tr>');
		document.write('<tr><td align="center"><a href="#" onclick="hideAd(\'pop\');hideAd(\'popbg\');"><img src="/gfx/ava.jpg" border="0"></a></td></tr>');
		document.write('</table>');
		document.write('</div>');

		if (document.layers) document.layers.pop.left = ((window.innerWidth / 2) - (763 / 2));
		else if (document.all) document.all.pop.style.left = ((document.body.offsetWidth / 2) - (763 / 2));
		else if (document.getElementById) document.getElementById("pop").style.left = ((window.innerWidth / 2) - (763 / 2));
	}
}
