// Overlay Message Javascript
// copyright 10th August 2002, by Stephen Chapman, Felgall Pty Ltd

// permission is granted to use this javascript provided that the below code
// and comments are not altered

// if this script is used to display advertising an ad for the Felgall Pty Ltd web site
// must be displayed on one of the pages of your site - refer to the 'Overlay Messages' 
// page on the http://get-me.to/felgall/ website for the code to display our ad and
// instructions on how to install and use this script

var hm = 0;
var ns = 0;
var ie = 0;
var wc = 0;

if (document.getElementById) 
	{wc = 1; hm = 1;} 
else if (document.all) 
	{ie = 1; hm = 1;} 
else 
{ 
	browserVersion = parseInt(navigator.appVersion); 
	if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) 
	{
		ns = 1; 
		hm = 1;
	}
}


function dm(oi,ws) 
{
	if (ws == 1) 
	{ 
		if (wc) return (document.getElementById(oi).style); 
			else if (ie) return (document.all[oi].style); 
			else if (ns) return (document.layers[oi]);
	}
	else 
	{
		if (wc) return (document.getElementById(oi)); 
			else if (ie) return (document.all[oi]); 
			else if (ns) return (document.layers[oi]);
	}
}


function wd() 
{
	if (window.innerWidth != null) 
		return window.innerWidth; 
	if (document.body.clientWidth != null)
		return document.body.clientWidth; 
		return (null);
} 


function showAd(oi,tm,al) 
{
	if (hm) 
	{
		var wp = wd(); 
		ds = dm(oi,1); 
		dx = dm(oi,0); 
		
		if (dx.offsetWidth) ew = dx.offsetWidth; 
			else if (dx.clip.width) ew = dx.clip.width; st = ds.visibility;
		
		if (st == "visible" || st == "show") ds.visibility = "hidden"; 
		else 
		{
			wp -= ew; 
			
			if (al) wp /=2; 
				else wp -= 10;
			
			if (!ns) wp += 'px';
				ds.left = wp; 
				ds.visibility = "visible"; 
				setTimeout("showAd('"+oi+"')",tm * 1000);
		}
	}
}
