	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 resizeHelpDiv()
    {       
        divg = document.getElementById('divGrayOut');
        var width = window.getWidth();
        var height = window.getHeight();
        
        var screenwid = window.getScrollWidth(); 
        var screenhgt = window.getScrollHeight();
 
        if (screenwid > width) width = screenwid;
        if (screenhgt > height) height = screenhgt;
        
        if ( divg != null )
        {
            if (divg.style.opacity > 0 )
            {
                divg.style.width = width.toString() + "px";
                divg.style.height = height.toString() + "px";
            }
        }
    }
	

	function ShowHelp(sender)
	{
		if(ie4)//if IE we must hide all dropdownlists. IE does not allow div tags to be positioned over them.
		{
			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 = loc.y - 200;
		popup.style.left = loc.x - 210;
		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)
		{
			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;
		}
	    
		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(Images/TransOverlay.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 = "Images/TransOverlay.gif";
			nL.document.open();
			nL.document.write('<table background="Images/TransOverlay.gif"><tr><td><img src="Images/Spacer.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(Images/TransOverlay.gif)";
			nL.id = name;
			nL = nL.style;
		}
		return nL;
	}
