/*******************************************************
* 
* This function will create a new browser window, centered
* ontop of the parent window, with the page defined in 
* the 'urlToDisplay' paramater.  The width and height
* paramaters allow you to define these values for the 
* new window.  This script will ensure that the user
* can only have one pop-up window open at a time from
* our site.
* 
*******************************************************/

var popupWindowPresent = 0;

function popupWindow(urlToOpen, popupWindowWidth, popupWindowHeight){	
	if(popupWindowPresent){		
      if(!popupWindowPresent.closed) popupWindowPresent.close();
	}
	
	userDisplayWidth = screen.availWidth;
   	userDisplayHeight = screen.availHeight;
	
	popupWindowLeft = ((userDisplayWidth / 2) - (popupWindowWidth / 2));
	popupWindowTop = ((userDisplayHeight / 2) - (popupWindowHeight / 2));
	  
  	popupWindowPresent = open(urlToOpen, 'popupWindowPresent', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbar=no, resizable=no, copyhistory=yes, width='+popupWindowWidth+', height='+popupWindowHeight+', left='+popupWindowLeft+', top='+popupWindowTop+',screenX='+ popupWindowLeft+', screenY='+popupWindowTop+'');
	
}