
//--- openWindow() ----------------------------------------------
function openWindow(owURL, owName, owWidth, owHeight, owScroll) {
	//trap for null or blank stuff
	if (!owURL || owURL == "") {
		owURL = "/"
	}
	if (!owName || owName == "") {
		owDate = new Date()
		owName = owDate.getDay() + "_" + owDate.getHours() + "_" + owDate.getMinutes() + "_" + owDate.getSeconds()
	}
	if (!owWidth || isNaN(owWidth)) {
		owWidth = 400
	}
	if (!owHeight || isNaN(owHeight)) {
		owHeight = 300
	}
	if (!owScroll || owScroll == "") {
		owScroll = 1
	}
	
	
	//calculate the center of the screen
	owX = parseInt((screen.availWidth/2)-(owWidth/2))
	owY = parseInt((screen.availHeight/2)-(owHeight/2))
	
	
	//build the parameters string
	owParms = ""
	owParms = owParms + "left=" + owX + ","
	owParms = owParms + "top=" + owY + ","
	owParms = owParms + "width=" + owWidth + ","
	owParms = owParms + "height=" + owHeight + ","
	owParms = owParms + "resizable=" + owScroll + ","
	owParms = owParms + "scrollbars=1,"
	owParms = owParms + "menubar=0,"
	owParms = owParms + "status=0"
	
	
	//get the reference of the window
	owWin = eval("top.owWin_"+owName)
	//if it exists
	if (owWin) {
		//if it "exists" but is closed
		if (owWin.closed) {
			eval("top.owWin_"+owName+" = window.open('"+owURL+"','"+owName+"','"+owParms+"')")
		}
		//still open
		else {
			owWin.location.href = owURL
			owWin.resizeTo(owWidth,owHeight)
			owWin.moveTo(owX,owY)
			owWin.focus()
		}
	}
	//doesnt exist... create it
	else {
		eval("top.owWin_"+owName+" = window.open('"+owURL+"','"+owName+"','"+owParms+"')")
	}
	
	
	//return false... always
	return false
}