function navButtonDown( obj ) {
        obj.style.backgroundColor = "white";
        obj.style.color = "red";
}

function navButtonFocus( obj) {
        obj.style.cursor = "pointer";
}

function navButtonBlur( obj ) {
        obj.style.cursor = "default";
        obj.style.backgroundColor = "red";
        obj.style.color = "white";
}

function navButtonUp( obj, loc ) {
        obj.style.backgroundColor = "red";
        obj.style.color = "white";
        window.location = loc;
}

function navButtonClose( obj ) {
        obj.style.backgroundColor = "red";
        obj.style.color = "white";
        self.close();
}

function showImage( img ) {

	var winName   = "ziPictureViewer";

	var imgSrc = img.src;
	var newImg = new Image();
	newImg.src = imgSrc;

        return true;

	// alert( "ni width: " + newImg.width + " ni height: " + newImg.height );

	winWidth = newImg.width + 20;
	winHeight = newImg.height + 100;

	var newWindow = window.open("", winName, "resizable=yes, location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, width=" + winWidth + ", height=" + winHeight + ", scrollbars=no");

	// If the window was precviously opened, resize it to fit the 
	// current image soize. This is a bit flakey after doing it
	// several times.

	newWindow.resizeTo( winWidth, winHeight );
	newWindow.focus();

	newWindow.document.writeln("<html>");
	newWindow.document.writeln("<head><title>ZiffleImaging</title></head>");
	newWindow.document.writeln("<body style='margin: 0 0 0 0;'>");
	newWindow.document.writeln("<table align='center' cellpadding='10' border='0'>");
	newWindow.document.writeln("<tr><td><img src='" + imgSrc + "'></td></tr>");
	newWindow.document.writeln("<tr><td align='center' valign='bottom'><a href='javascript:window.close();'>Close</a></td></tr>");
	newWindow.document.writeln("</table>");
	newWindow.document.writeln("</body></html>");
	newWindow.document.close();
}

