/* imgpop.js v.1.10
 * last-modified: 2011-09-07
 */

function imgpop(imgref,imgtitle) {
	
	imgwin = window.open('',imgtitle,'width=442,height=420');
	imgwin.focus();
	
	imgwin.document.open();
	imgwin.document.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	imgwin.document.writeln('<html><head><title>' + imgtitle + '</title>');
	
	// Begin Script
	imgwin.document.writeln('<script type="text/javascript">');
	imgwin.document.writeln('function winresize() {');
	
	// Get UA
	imgwin.document.writeln('ua = navigator.userAgent;');

	imgwin.document.writeln('img1 = document.getElementById(\'img\');');
	imgwin.document.writeln('imgW = img1.width; imgH = img1.height;');
	
	// Resize for Chrome
	imgwin.document.writeln('if(ua.indexOf(\'Chrome\') != -1) {');
	imgwin.document.writeln('window.resizeTo(imgW,imgH + 50);');
	imgwin.document.writeln('document.title = \'' + imgtitle + '\'');
	
	// Resize for WebKit (Safari)
	imgwin.document.writeln('} else if(ua.indexOf(\'WebKit\') != -1) {');
	imgwin.document.writeln('window.resizeTo(imgW,imgH + 24);');
	imgwin.document.writeln('document.title = \'' + imgtitle + '\'');
	
	// Resize for IE:mac
	imgwin.document.writeln('} else if(ua.indexOf(\'MSIE\') != -1 && ua.indexOf(\'Mac\') != -1 ){');
	imgwin.document.writeln('window.resizeTo(imgW,imgH);');
	
	// Reseize for MSIE on VISTA
	imgwin.document.writeln('} else if(ua.indexOf(\'MSIE\') != -1 && ua.indexOf(\'NT 6.0\') != -1){');
	imgwin.document.writeln('window.resizeTo(imgW + 10,imgH + 29 + 56);');

	// Reseize for MSIE
	imgwin.document.writeln('} else if(ua.indexOf(\'MSIE\') != -1){');
	imgwin.document.writeln('window.resizeTo(imgW + 10,imgH + 29 + 30);');
	
	// Resize for Other UA (Mozilla)
	imgwin.document.writeln('} else {');
	imgwin.document.writeln('window.innerWidth = imgW; window.innerHeight = imgH;');
	imgwin.document.writeln('document.title = \'' + imgtitle + '\'');
	imgwin.document.writeln('}');
	
	imgwin.document.writeln('}');
	imgwin.document.writeln('</script>');
	// End Script
	
	// Begin Document Style
	imgwin.document.writeln('<style type="text/css">');
	imgwin.document.writeln('a img {border: 0 none transparent}');
	imgwin.document.writeln('</style>');
	// End Document Style

	imgwin.document.writeln('</head><body style="margin: 0" onload="winresize()">');
	imgwin.document.write('<div style="text-align: center">');
	imgwin.document.write('<a href="#" onclick="window.close()" onmouseover="window.status = this.title; return true; " title="Click to Close">');
	imgwin.document.write('<img src="' + imgref + '" alt="' + imgtitle + '" style="margin: auto" id="img">');
	imgwin.document.writeln('</a></div></body></html>');
	imgwin.document.close();
	
	return false;
}
// EOF

