	var ns4=document.layers
	var ie4=document.all
	var ns6=document.getElementById&&!document.all
	var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;

	var popup;
	var overlay;
	
	function HelpCursor(sender)
	{
		var lnk = sender;
		sender.style.cursor = "help";
	}
	
	function ParseUrl(url)
	{
		var index = url.indexOf('/', 8);
		var fullUrl = url.substring(0, index);
		
		return (fullUrl);
	}
	
	function ShowHelp (sender)
	{
		if ( ie4 )
		{
			var selects = document.getElementsByTagName("select");
			for ( var xx = 0; xx < selects.length; xx++ )
			{
		/*		selects[xx].style.visibility = "hidden";*/
			}

		}
		
		var loc = getCenter();
		popup = sender.parentNode.getElementsByTagName("div")[1];
		
		var width;
		var height;
		
		if (ie4)
		{
			width = isMac ? document.body.offsetWidth : document.body.scrollWidth;
			height = isMac ? document.body.offsetHeight : document.body.scrollHeight;
		}
		else if (ns4)
		{
			width = document.width;
			height = document.height;
		}
		else if (ns6)
		{
			width = document.body.offsetWidth+document.body.offsetLeft;
			height = document.body.offsetHeight+document.body.offsetTop;
		}
		
/*		 if (!overlay)
			overlay = createOverlayLayer();
*/

/*		overlay.visibility = 'visible';*/

		
		if (popup.filters != null)
			popup.filters[0].apply();
		popup.style.position = "absolute";
		popup.style.top = 200;
		popup.style.left = loc.x - 110;
		popup.style.display = "block";
		popup.style.visibility = "visible"
		if (popup.filters != null)
			popup.filters[0].play();


	}
	
	function hideHelp()
	{
	
		if (ie4)//show hidden dropdownlists
		{
			var selects = document.getElementsByTagName("select");
			for(var xx = 0; xx < selects.length; xx++)
			{
			/*	selects[xx].style.visibility = "visible";*/
			}
		}
		
		if (popup)
		{
			if (overlay)
			overlay.visibility = 'hidden';
			
			if (popup.filters != null)
				popup.filters[0].apply();
			popup.style.visibility = "hidden";
			if (popup.filters != null)
				popup.filters[0].play();
				
			
			document.getElementById('overlay').parentNode.removeChild(document.getElementById('overlay'));
		}
	}
	
	function getCenter()
	{
		var clientHeight;
		var clientWidth;
		var docTop;
		var docLeft;
		
		if (ie4) 
		{
			clientHeight = document.body.clientHeight;
			clientWidth = document.body.clientWidth;
			docTop = document.body.scrollTop;
			docLeft = document.body.scrollLeft;
		} 
		else if (ns4 || ns6)
		{
			clientHeight = window.innerHeight - 20;
			clientWidth = window.innerWidth - 20;
			docTop = window.pageYOffset;
			docLeft = window.pageXOffset;
		}
	
		clientHeight = 0;    
		clientWidth  = 560;    
		var loc = new Object();
		loc.x = docLeft + clientWidth/2;
		loc.y = docTop + clientHeight/2;

		return (loc);
	}
	
	function createOverlayLayer()
	{
		var nL;
		var left = 0;
		var top = 0;
		var name = "overlay";
		var html = "";
		
		if (ie4)
		{
			var width = isMac ? document.body.offsetWidth : document.body.scrollWidth;
			var height = isMac ? document.body.offsetHeight : document.body.scrollHeight;
			var divhtml = '<div  id=' + name + ' style="visibility:visible;left:' + left + 
				'px;top:' + top + 'px;width:' + width + 
				'px;height:' + height + 'px;position:absolute; background: url(' + ParseUrl(location.href) + '/imagens/transp.gif) repeat">' + 
				html + '</div>';
			document.body.insertAdjacentHTML('beforeEnd', divhtml);
			nL = document.all[name].style
		}
		else if (ns4)
		{
			var width = document.width;
			var height = document.height;
			nL=new Layer (width);
			nL.name = name;
			nL.left=left;
			nL.top=top;
			nL.height = height;
			nL.clip.width = width;
			nL.clip.height = height;
			nL.visibility = "show";
			nL.background = ParseUrl(location.href) + "/imagens/transp.gif";
			nL.document.open();
			nL.document.write ('<table background="' + ParseUrl(location.href) + '/imagens/transp.gif"><tr><td><img src="/imagens/branco-25.gif" width="' + width + '" height="' + height +'"></td></tr></table>');
			nL.document.close();
		}
		else if (ns6)
		{
			var nL = document.createElement ("DIV");
			nL.innerHTML = "";
			var mybody=document.body;
			mybody.appendChild(nL);
			nL.style.position = "absolute";
			nL.style.visibility = "visible";
			nL.style.left = left;
			nL.style.top = top;
			nL.style.width = document.body.offsetWidth+document.body.offsetLeft;
			nL.style.height = document.body.offsetHeight+document.body.offsetTop;
			nL.style.background = 'url(' + ParseUrl(location.href) + '/imagens/transp.gif)';
			nL.id = name;
			nL = nL.style;
		}
		return (nL);
	}

