function viewPicture(imageURL) {
	var imgWin = window.open('about:blank','imgWin','status =no, width=200, height=200, left=100, top=100');

	with (imgWin.document) {
		writeln('<html><head><title>Loading...</title>');
		writeln('<style type="text/css"><!-- body { margin: 0px; } --></style></head>');
		writeln('<body onload="self.focus();"><img id="pic" style="display:none" alt="%%caption1%%" /></body></html>');
		close();		
		}
	var img = new Image();
        img.onload = function() { sizeImgWin(imgWin, img) };
		img.src = imageURL;
}
	
function sizeImgWin(win, img) {
   	var new_w = img.width;
	var new_h = img.height;
	var old_w = win.innerWidth || win.document.body.offsetWidth;
	var old_h = win.innerHeight || win.document.body.offsetHeight;
	if (!new_w) { new_w = old_w; }
	if (!new_h) { new_h = old_h; }
	new_w -= old_w; new_h -= old_h;
	win.resizeBy(new_w,new_h);
	win.document.title = img.src.substring(img.src.lastIndexOf("/")+1);
	var pic = win.document.getElementById('pic');
	if (screen.width < img.width || screen.height < img.height){
	if(screen.width/screen.height < img.width/img.height){
		//alert("w");
		w = screen.width - 50;
		h = w * ( img.height / img.width );
		//alert(" w="+w + " h="  + h);
	}else{
		//alert("h");
		h = screen.height - 50;
		w = h *  (img.width / img.height );
	}
		pic.width = w ;
		pic.height = h ;
		if (parseInt(navigator.appVersion.charAt(0))>=4){
			//isNN=(navigator.appName=="Netscape")?1:0;
			isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
		}
		if(isIE)marge = 100; else marge = 50;
		win.moveTo(0,0);
		win.resizeTo(w,h+marge);
		//alert(marge);
	}
	pic.src = img.src;
	pic.style.display = 'block';
}