clampson,
проблемы в chrome необнаружил ...
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script type="text/javascript">
window.onload = function () {
var imgs = document.getElementsByTagName('img');
var length = imgs.length;
for (var i = 0; i < length; i++) {
imgs[i].onclick=function ()
{
openImageWindow(this);
}
};
};
function openImageWindow(img) {
var src = img.src;
var width = img.width;
var height = img.height;
alert(width);
if (width>600){
width =width/2;
height =height/2 ;
}
window.open(src,"Image","width=" + width + ",height=" + height + "toolbar=no,status=no,scrollbars=no,menubar=no,resizable=no"+',left=' + ((window.innerWidth - width)/2) + ',top=' + ((window.innerHeight - height)/2));
}
</script>
</head>
<body>
<img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif" width="500" height="400" />
<img src="http://clampson.ru/img/123.png" />
</body>
</html>