// Popup windows for images, based on examples from various public sources.
// By Tom Loredo; last modified Oct 2004.

function showMsg() {
    window.status='Click to see the full-size image in new window.';
    return true;
}

var newWindow = null;

function show_props(obj, name) {
    var result = "";
    for (var i in obj) {
        //result += name + "." + i + " = " + obj[i] + "\n";
        result += " " + i;
    }
    return result;
}

function makeNewWindow(Title,ImageName,width,height) { 
    windowwidth = width + 20; 
    windowheight = height + 65; 

    var LeftPosition = 0;
    var TopPosition = 0;
    if (window.screen) { // Early browsers don't know the screen object!
        LeftPosition = (window.screen.width) ? Math.floor((window.screen.width-windowwidth)/2) : 0;
        TopPosition = (window.screen.height) ? Math.floor((window.screen.height-1.1*windowheight)/2) : 0;
    }
    else { // Early browsers use h & w for the outside size.
        windowwidth += 4;
        windowheight += 7;
    }

    // store new window object in global variable 
    newWindow = window.open("","imagePopup","top="+TopPosition+",left="+LeftPosition+"screenY="+TopPosition+",screenX="+LeftPosition+",width=" + windowwidth + ",height=" + windowheight) 

    if (newWindow != null) { 

    // assemble content for new window 
    var newContent = "<html><head>"
    newContent += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/imageTable.css\"></head>"
    newContent += "<body id=\"popup\"><form>"
    newContent += "<img src=\"" + ImageName + "\" " + width + " " + height
    newContent += " alt=\"" + Title + "\" align=top>"
    newContent += "<p></p>"
    newContent += "<input type='button' value='Close This Window' onclick='self.close()'></form>"
    newContent += "</body></html>"

    //write content to the new window 
    newWindow.document.write(newContent)
    newWindow.document.close()
    }
}

// Start/End Netscape Wide
// If NS, use CSS to absorb some of the body margin to properly center a table.
var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;

function startNSWide() {
	if (isMinNS4) {
		document.write('<div align="center" class="wide">\n');
	}
}

function endNSWide() {
	if (isMinNS4) {
		document.write('</div>\n');
	}
}
