	function openSizedPopup(file,cred){
		//preload image files
   	    preImage = new Image();
	    preImage.onload = function(){
			// open image in popup window
			targWidth=this.width+120;
			targHeight=this.height+50;
		    popupWindow=window.open(file,'newWin','toolbar=no,width='+targWidth+',height='+targHeight);
    	    popupWindow.document.write('<html><head><title>Photo credit: '+ cred +'<\/title><style>BODY{background:url(/_img/bkg-brownorangestripe.gif) repeat-x 0 100%;margin:0;padding:20px 15px 30px 15px;}</style><\/head><body><img src="\/_img\/logo-hft.gif" align="right" \/><img src="'+file+'" \/><\/body><\/html>');
       		popupWindow.resizeBy(targWidth-popupWindow.document.body.clientWidth,targHeight-popupWindow.document.body.clientHeight);
       		popupWindow.focus();
	   }
   	   preImage.src = file;
   } 
