function openPopUpWindow(imageName,imageWidth,imageHeight,alt) {
	var scroll='no';
	var bgColor='#FFFFFF';
	var maxX=780;
	var maxY=640;
	if (maxX>window.screen.width) maxX=Math.ceil(window.screen.width*0.8);
	if (maxY>window.screen.height) maxY=Math.ceil(window.screen.height*0.8);
	var popupWidth=imageWidth;
	var popupHeight=imageHeight;
	if (popupWidth>maxX||popupHeight>maxY) {
	   if (popupWidth>maxX) {
	      if (imageHeight<maxY) popupHeight=eval(popupHeight)+20;
              popupWidth=maxX;
	   }
	   if (popupHeight>maxY) {
	      if (imageWidth<maxX) popupWidth=eval(popupWidth)+20;
              popupHeight=maxY;
	   }
	   scroll='auto';
	}
	var posLeft = Math.ceil( (window.screen.width-popupWidth) / 2 );
	var posTop = Math.ceil( (window.screen.height-popupHeight) / 2);

        var config="width="+popupWidth+",height="+popupHeight+",left="+posLeft+",top="+posTop+",scrollbars="+scroll;

	newWindow = window.open("","newWindow",config);
	newWindow.document.open();
	newWindow.document.write('<html><head><title>'+(alt)+'</title></head><body scroll="auto" bgcolor="'+bgColor+'" style="margin:0px;" onBlur="self.close()">');
	newWindow.document.write('<div align="left"><img src="'+imageName+'" width="'+imageWidth+'" height="'+imageHeight+'" alt="'+(alt)+'" /></div>');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}