var version4 = (navigator.appVersion.charAt(0) == "4");

function displayPopupURL(url, name, height, width, evnt) {
    // location=0 means no location-field
    // toolbar=0 means no toolbar in new window
    // no whitespace allowed in properties
    var properties = "toolbar=0,location=0,resizable,scrollbars,alwaysRaised,height=" + height
	properties = properties + ",width=" + width
	if (evnt != null) {
	    if (navigator.appName == "Microsoft Internet Explorer") {
		properties = properties + ",left=" + (evnt.screenX + 10)
		properties = properties + ",top=" + (evnt.screenY + 10)
	    } else { //Navigator coordinates must be adjusted for scrolling
		properties = properties + ",left=" + (evnt.screenX - pageXOffset + 10) 
		properties = properties + ",top=" + (evnt.screenY - pageYOffset + 10)
	    }
	}
//    alert("URL: " + url + "\nNAME: " + name + "\nPROPERTIES: " + properties)
    popupHandle = window.open(url, name, properties)
    popupHandle.focus() // Make sure it's on top
}

function displayPopupText(text, name, height, width, evnt) {
    // location=0 means no location-field
    // toolbar=0 means no toolbar in new window
    // no whitespace allowed in properties
    var properties = "toolbar=0,location=0,resizable,scrollbars,alwaysRaised,height=" + height
	properties = properties + ",width=" + width
	if (evnt != null) {
	    if (navigator.appName == "Microsoft Internet Explorer") {
		properties = properties + ",left=" + (evnt.screenX + 10)
		properties = properties + ",top=" + (evnt.screenY + 10)
	    } else { //Navigator coordinates must be adjusted for scrolling
		properties = properties + ",left=" + (evnt.screenX - pageXOffset + 10) 
		properties = properties + ",top=" + (evnt.screenY - pageYOffset + 10)
	    }
	}
    //    alert("TEXT: " + text + "\nNAME: " + name + "\nPROPERTIES: " + properties)
    popupHandle = window.open(text, name, properties)
}

function closePopup() {
    if (popupHandle != null && !popupHandle.closed) popupHandle.close()
}


