/** @file webcanvas.js
	This contains a variety of miscellaneous javascript
	functions for use throughout WebCanvas.
*/

/** @brief The global reference to the ONE help window */
var gHelpWindow = null;

/** @brief This function displays help in its own window
	Unlike other open functions this will reuse the 
	same help window so the user doesn't have to keep closing
	out of date ones
	@param string helpLink This is the URL to the help to display in the window
*/
function openHelpWindow (helpLink)
{
	if (!gHelpWindow || gHelpWindow.closed)
	{
		var width=400;
		var height = 300;
		var left = parseInt ((screen.availWidth/2) - (width/2));
		var top = parseInt ((screen.availHeight/2) - (height/2));
		var position = 'width=' + width + ',height=' + height + ', left=' + left + ',top='+top;
		
		gHelpWindow = window.open (helpLink, 'helpWindow', position + ', resizable=yes,scrollbars=yes,statusbar=no,menubar=no');
	}
	else
	{
		gHelpWindow.focus ();
		gHelpWindow.location.href=helpLink;
	}
}