
//PopUp Window Code
var popWinECS   = null    // use this when referring to pop-up window
var winCount = 0
var winName  = "popWin"

function openPopWinECS(winURL, winWidth, winHeight, moveX, moveY, winAtrib){
 	winName = "popWinECS" + winCount++ ;//unique name for each pop-up window
  
 	closePopWin(); //close any previously opened pop-up window

 	if (winAtrib == undefined) //any additional features? 
   		winAtrib =  "resizable=yes,location=no,menubar=yes,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,";
   		
 	// open the new browser window 
 	popWinECS = window.open(winURL, winName,winAtrib + "width="+ winWidth +",height=" + winHeight);
 	
	// move the new browser window to the specified position
	if (moveX != '' && moveY != '') {
	popWinECS.moveTo(moveX,moveY); }
	popWinECS.focus();
}

function closePopWin(){    // close pop-up window if it is open 
	if (navigator.appName != "Microsoft Internet Explorer" || parseInt(navigator.appVersion) >=4) { //do not close if early IE
	     if(popWinECS != null) if(!popWinECS.closed) popWinECS.close() 
	}	 
}