var newWindow
var oldURL
var w=450
var h=375
//set height and width of new window dependent on screen resolution
if (window.screen) { //test if supports screen 
	//var xw= (window.screen.availWidth)
	//var	xh= (window.screen.availHeight)
	//if (xw >= 800){
	//w=750
	//h=580
	//}
}
function openWindow(theURL){ // Pop-up window function
if(!newWindow || newWindow.closed) {
	newWindow = window.open(theURL,'','height='+h+',width='+w+',resizable=no,scrollbars,screenx=10, screeny=10,left=10,top=10,menubar')
	oldURL=theURL
	if(!newWindow.opener) {
		newWindow.opener=window
	}
}
else { //window already open, bring to front
	if(window.blur){  // if browser supports blur/focus 
		newWindow.focus()
		if (theURL != oldURL){// if not same URL, load new URL
			newWindow.location=theURL
			oldURL=theURL
		}
	}
	else { //NN1,2 and IE1,2,3 do not support blur/focus- close blurred window and reopen
		alert('new window may be hidden behind this one')
		newWindow = window.open(theURL,'','height='+h+',width='+w+',resizable,scrollbars,screenx=10, screeny=10,left=10,top=10,menubar')
	oldURL=theURL
	}
}
}
function closeWindow(){
if(newWindow) {
	newWindow.close()
}
}