/* 
Opens stated URL in a new window. Window size argument is optional. 
To open UL in default sized window: winOpen('http://ki.se')
To state window width: winOpen('http://ki.se',300)
To state window width and height: winOpen('http://ki.se',300,400)
*/

function openHelpWin(pageURL) 
	{
	var setWidth;
	var setHeight;
	if (openHelpWin.arguments[1])
		{
		setWidth = openHelpWin.arguments[1];
		}
	else
		{
		setWidth = 900;
		}
	if (openHelpWin.arguments[2])
		{
		setHeight = openHelpWin.arguments[2];
		}
	else
		{
		setHeight = 600
		}	
	var xPos = 30;
	var yPos = 650;

	// If the window hasn't been opened before
	if (!window.helpWin) 
		{
        helpWin = window.open(pageURL,'HelpWindow','width=' + setWidth + ',height=' + setHeight + ',screenX=' + xPos + ',screenY=' + yPos + ',top=' + xPos + ',left=' + yPos + ',scrollbar,resizable=yes,location=no,toolbar=no,scrollbars=yes');
		helpWin.focus();
		}
	else 
		{
		if (!helpWin.closed) 
			{
			helpWin = window.open(pageURL,'HelpWindow','width=' + setWidth + ',height=' + setHeight + ',screenX=' + xPos + ',screenY=' + yPos + ',top=' + xPos + ',left=' + yPos + ',scrollbar,resizable=yes,location=yes,toolbar=yes,menubar=yes,scrollbars=yes');
	        helpWin.focus();        
			}
		// If the window has been opened and closed at an earlier time
		else
			{
			helpWin = window.open(pageURL,'HelpWindow','width=' + setWidth + ',height=' + setHeight + ',screenX=' + xPos + ',screenY=' + yPos + ',top=' + xPos + ',left=' + yPos + ',scrollbar,resizable=yes,location=yes,toolbar=yes,menubar=yes,scrollbars=yes');
			helpWin.focus();
			}
		}
	}
