/*Go to a specific page, but reload it
into the main window */
function fGoToPage(vPage)
{
	redirURL = vPage;
	self.location.href = redirURL;
}

/*Open window passed in
vPath = Path to the page
vName = name of the window to open
vHeight = Height of the window, pass in empty to get screen height
vWidth = Width of the window, pass in empty to get screen width
vLeft = Left position of window, pass in -1 to get to the mouse click position, empty to center
vTop = Left position of window, pass in -1 to get to the mouse click position, empty to center
vMaximize = Y/N */
function OpenWindow(vPath,vName,vHeight,vWidth,vLeft,vTop,vMaximize)
{
	try
	{
	if(vName.open)
	{
	 vName.close();
	
	}
	    //variables	
		var vURL = vPath;
		var nHeight;
		var nWidth;
		var nXpos;
		var nYpos;
		
		//any height specified
		if (vHeight == '') 
		{
			nHeight = screen.availHeight;
		}
		else
		{
			nHeight = vHeight;
		}
		//any width specified
		if (vWidth == '') 
		{
			nWidth = screen.availWidth;
		}
		else
		{
			nWidth = vWidth;
		}
		
		//any left 
		if (vLeft == -1) 
		{
			nXpos = event.clientX;
		}
		else if (vLeft == '') 
		{
			nXpos = (screen.availWidth - nWidth) / 2;
		}
		else
		{
			nXpos = vLeft;
		}
		
		//is there a top variable specified
		if(vTop == -1) 
		{
			nYpos = event.clientY;
		}
		else if (vTop == '') 
		{
			nYpos = (screen.availHeight - nHeight) / 2;
		}
		else
		{
			nYpos = vTop;
		}
		
		//open window and set focus
		win = window.open(vURL,vName,'top=' + nYpos + ',left=' + nXpos +	',screenY=' + nYpos + ',screenX=' + nXpos +	',height=' + nHeight + ',width=' + nWidth +',toolbar=no,menubar=no,status=no,location=no,scrollbars=yes,resizable=yes');
		win.focus();
	} 
	catch(err)
	{}
}

 /*Maximize the window*/
function maximizeWindow()
{
	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
}
