/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
06.01.04	Modified by M Skeet (http://www.xplosivedesign.com) to check whether the pop-up window is open and re-use that if it is
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll,tool){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',toolbar='+tool+',resizable'
	if (!window.win) {
        // has not yet been defined
		win = window.open(mypage,myname,settings);
	}
	else {
        // has been defined
        if (!win.closed) {
            // still open
            win.location.href = mypage;
			win.focus();
        }
        else {
            win = window.open(mypage,myname,settings);
        }
	}
}





