/********************************************************************/
/* 																	*/
/* Filename: popup.js												*/
/* Author: Ricky McAlister											*/
/* Created: 01/07/2006												*/
/* Updated: 01/07/2006												*/
/* 																	*/
/* Description: Used to create a popup window with user defined  	*/
/*              dimensions											*/
/* 																	*/
/* Use: Initially setup as a JavaScript src and called from within 	*/
/*      the HTML code specifying the page URL and dimensions		*/
/*																	*/
/* Notes: 														 	*/
/*																	*/
/* Amendments: 														*/
/*																	*/
/********************************************************************/

var popup

// function to create a popup window for a specified URL and
// with user defined dimensions
function OpenWin(url, width, height)
{
  	if (typeof(popup) != 'undefined' && popup && popup.close) 
	{
    	popup.close()
  	}
  	
	// align the popup window in the centre of the screen	
	xPos = (screen.width - width) / 2
  	yPos = (screen.height - height) / 2
	
  	popup = window.open(url, 'popup', 'width=' + width + ',height=' + height + ',!scrollbars,!menubar,!resizable,!status,left=' + xPos + ',top=' + yPos)
}