// function used to open a new child window
var SelectionWindow = null;
function openWindow(url, width, height) {
	var winWidth = (width);
	var winHieght = (height);
	var winl = (screen.width - winWidth) / 2;
	var wint = (screen.height - winHieght) / 2;
    winStats='toolbar=no,location=no,directories=no,menubar=no,'
    winStats+='scrollbars=yes,width='+winWidth+',height='+winHieght
		if (navigator.appName.indexOf("Microsoft")>=0) {
          	winStats+=',left='+winl+',top='+wint
 		}else{
       		winStats+=',screenX='+winl+',screenY='+wint
		}
		
		if (!SelectionWindow || SelectionWindow.closed){
			SelectionWindow = window.open(url,"NewWindow",winStats);
		}else{
			SelectionWindow.focus();
		}  
		 
		if (SelectionWindow.opener == null){
			SelectionWindow.opener = self
		} 
		
    }
	
/* used in onunload of the page to clean up any child windows that were launched by the above function... */
function CloseExistingPopup(){
	if (SelectionWindow.name == "NewWindow"){
		SelectionWindow.close();
	}
}