
	/* 	Used by LazyImageLayout. Code adapted from http://regretless.com/dodo/newworld */
    
		function MDHPopUp(url,w,h,windowName,captionFlag) {
			var windowRef = 'ImagePopup';
			var features =
				',directories=no' + 
				',location=no'    + 
				',menubar=no'     + 
				',scrollbars=no'  + 
				',status=no'      + 
				',toolbar=no'     + 
				',resizable=no';
			features += ',width='+w;
			if (captionFlag) h+=16;
			features += ',height='+h;
			
			var 	htmlout = 	'<html><head><title>'+windowName+'</title><style type=\"text/css\">body{margin:0;padding:0;background:#888;}</style></head>';
					htmlout +=	'<body marginheight=0 topmargin=0 vspace=0 marginwidth=0 leftmargin=0 hspace=0>';
					htmlout += 	'<div style=\"position:absolute;top:0px;left:0px\"><img vspace=0 hspace=0 src=\"'+url+'\" onclick=\"javascript:window.close()\"/></div>';
					if (captionFlag)
						htmlout +=	'<div style=\"width:100%;position:absolute;bottom:0px;left:0px;font-family:sans-serif;font-size:11px;color:#ddd;text-align:center;\"> '+windowName+' </div>';
						
					htmlout +=	'</body></html>';
	
			if ((url.lastIndexOf(".html") == url.length-5) || (url.lastIndexOf(".htm") == url.length-4) || (url.lastIndexOf("/") == url.length-1)) {
				var win=window.open(url,windowName,features);
			} else {
				var win=window.open('','',features);
				win.document.open();
				win.document.write(htmlout);
				win.document.close();
			}
			win.focus();
		}
