app = navigator.appName;

var window_width = 500;
var window_height = 375;
var window_top = (screen.height - window_height) / 2;
var window_left = 0;

//////////////////////////////////////////////////////////////////
// function  calcDimensions
// inWidth:  integer size width of the thumbnail 1/4 size of full
// inHeight: integer size height of the thumbnail 1/4 size of full 
//////////////////////////////////////////////////////////////////
function calcDimensions(inWidth, inHeight) {
	if (inWidth && inHeight) {
		window_width = eval((inWidth*4)+30);
		window_height = eval((inHeight*4)+80);
	}
//	alert('width = ' + window_width + '\nheight = ' + window_height);
	window_top = (screen.height - window_height) / 2;
	window_left = (screen.width - window_width - 30) / 2;
	if (app == "Netscape") {
		window_top = window_top-35;
	} else {
		window_top = window_top-40;
	}
}

/////////////////////////////////////////////////////////////////////
// function     openWindow
// picName:     string Title description of the picture
// picLocation: string location of the picture
// picWidth:    integer size width of the thumbnail 1/4 size of full
// picHeight:   integer size height of the thumbnail 1/4 size of full 
/////////////////////////////////////////////////////////////////////
function openWindow(picName, picLocation, picWidth, picHeight, previous, next) {
	calcDimensions(picWidth, picHeight);
	var newWindow = window.open('', 'newWindow', 'toolbar=0,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=' + window_width + ',height=' + window_height + ',copyhistory=0,top='+ window_top +',left=' + window_left);
	newWindow.document.write('<TITLE>' + picName + '</TITLE>\n<BODY>\n<CENTER><IMG SRC=' + picLocation + '></CENTER>\n');
//	newWindow.document.write('<CENTER><FORM><NOBR><INPUT TYPE=BUTTON value=Last onClick="window.opener.location.replace(window.opener.document.links[' + previous + ']);self.close();"><INPUT TYPE=BUTTON value=Close onClick=self.close()><INPUT TYPE=BUTTON value=Next onClick="window.opener.location.replace(window.opener.document.links[' + next + ']);self.close();"></NOBR></FORM></CENTER>\n</BODY>\n');
	newWindow.document.write('<CENTER><FORM><NOBR><INPUT TYPE=BUTTON value=Close onClick=self.close()></NOBR></FORM></CENTER>\n</BODY>\n');
}
