function zoomInit() {
	var all=new Object();
	all=document.getElementsByTagName("div");
	for (var i=0; i<all.length; i++) {
		if (all[i].getAttribute("class") == "divImg overflow" || all[i].getAttribute("className") == "divImg overflow") {
			img=all[i].getElementsByTagName("img");
			//img[0].setAttribute('onclick', 'zoomImg("'+img[0].alt+'")'); //nefunguje v IE7 
			img[0].onclick = function() {
				var fname = this.src;
				var fext = "";
				var posDot = -1;
				while (fname.indexOf("_s.", posDot+1) > 0) {
					posDot = fname.indexOf("_s.", posDot+1);
				};
				fext = fname.substr(posDot+3);
				fname = fname.substr(0, posDot);
				zoomImg(fname+"."+fext);
			};
		}
	}
}

function getSizeH() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
    return myHeight; 
}

function getSizeW() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
    return myWidth; 
}
  
function zoomImg(obj) {
	var iw = window.open ( '../shared/image.html?img='+obj+'&w='+getSizeW()+'&h='+getSizeH(), 'ImageViewer','resizable=1,menubar=0,titlebar=1,toolbar=0,status=0,scrollbars=1' );
	iw.focus();
}