function open_image(URL) {
	/*myImg = new Image();
	myImg.src=URL;*/
		newWindow = window.open("","newWindow","width="+300+",height="+200+",left=200,top=200, scrollbars=0");
		newWindow.document.open();
		newWindow.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>image</title>');
		newWindow.document.write('<script> function resize_window(img) { window.resizeTo(img.width+30,img.height+70); } </script>');
		newWindow.document.write('</head><body style="background:white;padding:0;margin:10px; overflow:hidden;" onBlur="self.close()">'); 
		newWindow.document.write('<img src="'+URL+'" alt="image" onload="resize_window(this);"/>'); 
		newWindow.document.write('</body></html>');
		newWindow.document.close();
		newWindow.focus();

}