/**************************************************************
DESCRIPTION:
	Include the following in the header of the page using the HelpWindow.js functions:
	<SCRIPT LANGUAGE="JavaScript" SRC="/includes/HelpWindow.js"></SCRIPT>
	Then place the following help icon where you want the help to appear on the web page.

INPUT for ShowHelp function:
	TheURL		the URL pointing to the Help File.
	bAutoClose	[optional] false tells the window to stay open until the user closes it or 
			clicks on the help icon again.  Change false to true if you want the help window
			to close when the user clicks on the main window that opened the help window.
	width		[optional] the width of the popup window.
	height		[optional] the height of the popup window.

EXAMPLE:
	<tr>
	<td ALIGN="RIGHT">
		<a HREF="javascript:ShowHelp('PLACE URL TO HELP PAGE HERE', false);"><img BORDER="0" SRC="/images/help.gif"></a>
	</td>
	</tr>

***************************************************************/
var HelpWindow = null;
var bAutoCloseWindow = true;
function ShowHelp(TheURL,bAutoClose,width,height) {
	if (bAutoClose>"") bAutoCloseWindow = bAutoClose;

	if(HelpWindow != null) {
		HelpWindow.close();
		HelpWindow = null;
	}


	if (width>"" && height>"") {
		HelpWindow = open(TheURL, "HELP", "toolbar=false, location=false, directories=false, status=false, menubar=false, scrollbars=yes, resizable=yes, copyhistory=false, width="+width+", height="+height);
	} else {
		HelpWindow = open(TheURL, "HELP", "toolbar=false, location=false, directories=false, status=false, menubar=false, scrollbars=yes, resizable=yes, copyhistory=false, width=430, height=150");
	}
}

function CloseHelpWin() {
	if (HelpWindow != null) {
		if(bAutoCloseWindow) {
			HelpWindow.close();
			HelpWindow = null;
		}
	}
}

window.onfocus = CloseHelpWin;


