var newWin = null;

function launchNewWin(URL, windowName, windowWidth, windowHeight, scrollbars)
{
	var xposition = 400; 
	var yposition = 300;
	
    if ((parseInt(navigator.appVersion) >= 4 ))
    {
        xposition = (screen.width - windowWidth) / 2;
        yposition = (screen.height - windowHeight) / 2;
    }
	
	if (!scrollbars) var scrollbars = 0;
	
    var args = "width=" + windowWidth + ","
	    	+ "height=" + windowHeight + ","
	    	+ "location=0,"
		    + "menubar=0,"
		    + "scrollbars=" + scrollbars + ","
		    + "status=0,"
		    + "titlebar=0,"
		    + "hotkeys=0,"
		    + "screenx=" + xposition + ","
		    + "screeny=" + yposition + ","
		    + "left=" + xposition + ","
		    + "top=" + yposition;
		
	if (newWin != null && !newWin.closed) newWin.close();
	
	newWin = window.open(URL, windowName, args);
	if (newWin) newWin.focus();
}
