//    Filename:	window_opener.js
//      Module:	n/a
//  Created on:	08/03/99
//  Created by:	gp
// Description:	open a new browser window
//
//
//Revision History:
//Date		Name		Description
//
// Original Author
// Copyright 1998, 1999 by Ray Stott - ver 1.0
// OK to use on noncommercial sites as long as copyright is included
// Script is available at http://www.crays.com/jsc         

var popWin   = null    // use this when referring to pop-up window
var winCount = 0
var winName  = "popWin"

function openPopWin(winURL, winWidth, winHeight, moveX, moveY, winFeatures){
 	winName = "popWin" + winCount++ //unique name for each pop-up window
  
 	closePopWin() //close any previously opened pop-up window

 	if (openPopWin.arguments.length == 6) //any additional features? 
   		winFeatures = "," + winFeatures
 	else 
  		winFeatures = "" 
 	// open the new browser window 
 	popWin = window.open(winURL, winName, "width=" + winWidth + ",height=" + winHeight + winFeatures)
	// move the new browser window to the specified position
	if (moveX != '' && moveY != '') {
	popWin.moveTo(moveX,moveY); }
}

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(popWin != null) if(!popWin.closed) popWin.close() 
	}	 
}


