
	
	function OutputNamedAnchor(name)
	{
		document.writeln("<a href='#" + name + "'>");
	}
	
	function CloseNamedAnchor()
	{
		document.writeln("</a>");
	}

		//Hook the mouse position
	function captureMousePosition(e) 
	{		
		if (ie4) 
		{
			xMousePos = window.event.x+document.documentElement.scrollLeft;
			yMousePos = window.event.y+document.documentElement.scrollTop;
			xMousePosMax = document.body.clientWidth+document.documentElement.scrollLeft;
			yMousePosMax = document.body.clientHeight+document.documentElement.scrollTop;
		} 
		else
		{
			if (ns4 || document.getElementById) //NS4/6
			{
				xMousePos = e.pageX;
				yMousePos = e.pageY;
				xMousePosMax = window.innerWidth+window.pageXOffset;
				yMousePosMax = window.innerHeight+window.pageYOffset;
			}
		}
	}

	//Hides the static help text if the browser supports javascript so that the popups are used instead
	function hideStaticTextOnJavascriptBrowser() 
	{
			//Define array of the elements that we want to hide with this function
		var astrHelpDivs = ["info1hid","info2hid","info3hid","info4hid","info5hid","info6hid","info7hid"];
			//Iterate through the array hiding each layer in turn
		
		for (var index = 0; index < astrHelpDivs.length; index++)
		{
			element = hideLayer(astrHelpDivs[index]);
		}
		
	}
	
	

	//Shows the help panel with the passed ID
	function showHelp(helpId)
	{		
		if (helpId == lastItem)
		{			
			//hideHelp();
			lastItem = "";
		}
		else
		{
			lastItem = helpId;
		
				//Grab the DIV that we will use to display the help text
			var helpElement = document.getElementById("HelpText");
				//Prepare markup that will close the current help pane
			var strClosewindowLink = "<p><a href='JavaScript:hideHelp();'>Close window</a></p>";
			
			helpElement.className = "HelpText";
			
				//Add the top anchor for closing the help window
			helpElement.innerHTML = strClosewindowLink;
				//Get the help content from the div with the requested ID
			helpElement.innerHTML += document.getElementById(helpId).innerHTML ;
				//Add the bottom anchor
			helpElement.innerHTML += strClosewindowLink;
			
				//Determine where the element should appear
			helpElement.style.top = yMousePos + "px";
			
				//Ensure that the help pane doesn't continue off screen
			if ((xMousePos + 405) > xMousePosMax)
			{
				helpElement.style.left = xMousePosMax-405 + "px";
			}
			else
			{
				helpElement.style.left = xMousePos + "px";
			}
			
				//Display the help information 	
			showLayer("HelpText");
				//If the user has an IE browser, move the shim behind it
			if (ie4)
			{
				showShim(helpElement);
			}
		}		
	}

	//Shows the help panel with the passed text
	function popUp(strHelpText, strDummy)
	{		
		
			
		
				//Grab the DIV that we will use to display the help text
			var helpElement = document.getElementById("HelpText");
				//Prepare markup that will close the current help pane
			var strClosewindowLink = "<p><a href='JavaScript:hideHelp();'>Close window</a></p>";
			
			helpElement.className = "HelpText";
			
				//Add the top anchor for closing the help window
			helpElement.innerHTML = strClosewindowLink;
				//Get the help content from the div with the requested ID
			helpElement.innerHTML += strHelpText ;
				//Add the bottom anchor
			helpElement.innerHTML += strClosewindowLink;
			
				//Determine where the element should appear
			helpElement.style.top = yMousePos + "px";
			
				//Ensure that the help pane doesn't continue off screen
			if ((xMousePos + 405) > xMousePosMax)
			{
				helpElement.style.left = xMousePosMax-405 + "px";
			}
			else
			{
				helpElement.style.left = xMousePos + "px";
			}
			
				//Display the help information 	
			showLayer("HelpText");
				//If the user has an IE browser, move the shim behind it
			if (ie4)
			{
				showShim(helpElement);
			}
			
	}

	//Hides the help panel with the passed ID
	function hideHelp()
	{
		hideLayer("HelpText");
		if (ie4)
		{
			hideShim();
		}
	}

	//Displays a shim behind the help div tag to get around a bug with IE
	function showShim(supportingDiv)
	{
			//Find the shim on the page
		var IfrRef = document.getElementById('DivShim');
			//Match up the widths/heights with the parent div
		IfrRef.style.width = supportingDiv.offsetWidth;
		IfrRef.style.height = supportingDiv.offsetHeight;
		IfrRef.style.top = supportingDiv.style.top;
		IfrRef.style.left = supportingDiv.style.left;
			//Move the shim just behind the div, use currentStyle as zIndex is defined in CSS
		IfrRef.style.zIndex = supportingDiv.currentStyle.zIndex -1;
		IfrRef.style.display = "block";
	}
	  
	//Hides the shim displayed to the page
	function hideShim()
	{
		var IfrRef = document.getElementById('DivShim');
		IfrRef.style.display = "none";
	}
	
	
	//Displays the layer with the passed ID
	function showLayer(id)
	{
		if (ns4)
		{
			document.layers[id].visibility = "show";
		}
		else
		{
			if (ie4)
			{
				document.all[id].style.visibility = "visible";
				document.all[id].style.display = "block";
			}
			else
			{
				if (!document.all && document.getElementById) 
				{
					document.getElementById(id).style.visibility = "visible";
				}
			}
		}
	}

	//Hides the layer with the passed ID, also shifts the element to the top-left corner to stop scrolling
	function hideLayer(id)
	{
		var theLayer = null;
		if (ns4) 
		{
			theLayer = document.layers[id];
			theLayer.visibility = "hide";			
		}
		else
		{
			if (ie4) 
			{
				theLayer = document.all[id];
				if (theLayer)
				{
					theLayer.style.visibility = "hidden";
					theLayer.style.top = 0 + "px";
					theLayer.style.left = 0 + "px";
					theLayer.style.position = "absolute";
				}
			}
			else
			{
				if (!document.all && document.getElementById) 
				{
					theLayer = document.getElementById(id);
					if (theLayer)
					{
						theLayer.style.visibility = "hidden";
						theLayer.style.top = 0 + "px";
						theLayer.style.left = 0 + "px";
						theLayer.style.position = "absolute";
					}
				}
			}
		}
	}

