// Show image in new popup
function popupImage(link,mode) {
	// Determine window size
	if( mode != 0 ) {
		w_width = 480;
		w_height = 640;
	}
	else {
		w_width = 640;
		w_height = 480;
	}

	w_width += 20;
	w_height += 20;

	// Create the HTML content
	var str = "";
	str += "<HTML>\n";
	str += "<HEAD>\n";
	str += "<SCRIPT TYPE=\"text/javascript\">\n";
	str += "window.focus();\n";
	str += "</SCRIPT>\n";
	str += "</HEAD>\n";
	str += "<BODY><CENTER>\n";
	str += "<IMG SRC=\"" + link.href + "\" BORDER=0>";
	str += "</CENTER></BODY>\n";
	str += "</HTML>";

	// Open the window
	var nw = window.open("","photo","width="+w_width+",height="+w_height+",scrollbars=no");
	if( ! nw ) return true;

	// Try to resize the window to a better size
	if( navigator.appName == "Netscape" ) {
		nw.innerWidth = w_width;
		nw.innerHeight = w_height;
	}
	else {
		nw.resizeTo( 10+w_width, 40+w_height );
	}

	// Set the content
	nw.document.open();
	nw.document.write(str);
	nw.document.close();

	if( window.focus ) { 
		nw.focus(); 
	}

	// Return false so the original link is not followed
	return false;
}
