function openwin(elm) {

	if (elm.name.toLowerCase() == 'a') {
		window.open(elm.getAttribute('href'), '_blank');
		return true;
	} 


	var msgWindow = window.open(elm.getAttribute('href'), '_blank', 'toolbar=no');
	msgWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	msgWindow.document.write('<html>');
  	msgWindow.document.write('<meta http-equiv="content-type" content="text/html; charset=utf-8">');
  	msgWindow.document.write('<head>');
	msgWindow.document.write('<title></title>');
	msgWindow.document.write('<style media="screen,tv,projection"  type="text/css"> html, body {margin:0;padding:0} a, img {border: 0px solid #fff}</style>');
	msgWindow.document.write('<script type="text/javascript">');
	msgWindow.document.write('	function imgSize() {');
	msgWindow.document.write('		image =document.getElementById("image_elm");');
	msgWindow.document.write('		if (screen.height <= (image.height + 31)) {');
	msgWindow.document.write('			window.resizeTo(image.width + 12,screen.height - 100);');
	msgWindow.document.write('		} else {');
	msgWindow.document.write('			window.resizeTo(image.width + 12, image.height + 31);');
	msgWindow.document.write('		}');
	msgWindow.document.write('	}');
	msgWindow.document.write('</script>');
	msgWindow.document.write('</head>');
	msgWindow.document.write('<body style="margin:0;padding:0;background:#fff" onload="imgSize();">');
	msgWindow.document.write('<a style="border:0px solid #fff;" href="#" onclick="window.close();"><img src="'+elm.getAttribute('href')+'"style="border:0px solid #fff;" id="image_elm" alt=""></a>');
	msgWindow.document.write('</body>');
	msgWindow.document.write('</html>');
	msgWindow.document.close();
     msgWindow.focus();
     return true;
}


function open_win_external(elm) {
	window.open(elm.getAttribute('href'), '_blank');
	return true;
}
