
function openPictureWindow(imageName,imageWidth,imageHeight,alt) { 
	var myWidth = imageWidth;
	var myHeight = imageHeight;
	if (screen.width < imageWidth) {
	var myWidth = (screen.width-100);
	var myLeft = 80;
	}
	if (screen.height < imageHeight) {
	var myHeight = (screen.height-100);
	var myTop = 50;
	}
	if (screen.width < (imageWidth) || screen.height < (imageHeight)){

	newWindow = window.open("","newWindow","width="+myWidth+",height="+myHeight+",scrollbars=yes,resizable=yes,left="+myLeft+",top="+myTop)
	}else{
	var myLeft = (screen.width-imageWidth)/2;
   	var myTop = (screen.height-imageHeight)/2;
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+myLeft+",top="+myTop)
	}	
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}
