function openDynamicImageWindow(file,w,h,typ,closeText) {
	if(typ == "dhtml") {
		if(document.all) {
			var windowWidth = self.document.body.clientWidth;
			var windowHeight = self.document.body.clientHeight;
			var scrolltop = document.body.scrollTop;
			var scrollleft = document.body.scrollLeft;
		} else {
			var windowWidth = self.innerWidth;
			var windowHeight = self.innerHeight;
			var scrolltop = document.documentElement.scrollTop;
			var scrollleft = document.documentElement.scrollLeft;
		}
// #nioh666 w ie dhtml po srodku strony bylo
//setTimeout("document.documentElement.scrolltop = document.documentElement.formName.nameCoOrd.value", 0);

//setTimeout("document.getElementById('divName').scrollTop=scrolltop, 0);

//if (document.documentElement && !document.documentElement.scrollTop)
// //IE6 +4.01 but no scrolling going on
//else if (document.documentElement && document.documentElement.scrollTop)
//// IE6 +4.01 and user has scrolled
//else if (document.body && document.body.scrollTop)
//// IE5 or DTD 3.2
//var top616 = document.documentElement.scrolltop;



		var postop =(windowHeight/2)-(h/ 2)+scrolltop+document.body.style.padding;

//if(navigator.appName.indexOf(’Internet Explorer’)!=-1)
//{
//document.body.removeChild(objImageContainer);
//document.body.objImageContainer.childNodes[0].src = newImg.src;
//setTimeout(’hackIe()’,10);
//			var postop =(windowHeight/4)-(h/ 2)+scrolltop+document.body.style.padding;
//}
//else {
// Regular old code
//			var postop =(windowHeight/2)-(h/ 2)+scrolltop+document.body.style.padding;
//}

if(navigator.appName.indexOf("Microsoft") != -1) {
//  var postop =(windowHeight/4)-(h/ 2)+scrolltop+document.body.style.padding;
var postop =(windowHeight/4)-(h/ 2)+document.documentElement.scrollTop+document.body.style.padding;
  }







		var posleft =(windowWidth/2)-(w/ 2)+scrollleft+document.body.style.padding;
		if(document.all) {
			if(postop >= 20) { postop = postop-20; }
		} else {
			if(postop >= 30) { postop = postop-30; }
		}
		var bodyObj = document.getElementsByTagName('BODY')[0];
		if(!document.getElementById("dynamicImageContainer")) {
			divObjContainer = document.createElement("div");
			divObjContainer.setAttribute("id", "dynamicImageContainer");
			bodyObj.appendChild(divObjContainer);
			//bodyObj.insertBefore(divObjContainer, bodyObj.firstChild);
		} else {
			divObjContainer = document.getElementById("dynamicImageContainer");
		}
		divObjContainer.style.display = "block";
		divObjContainer.innerHTML = "<div class=\"imageContainer\" style=\"top:"+postop+"px; left:"+posleft+"px; position: absolute; display:block;\"><div class=\"imageBorder\" style=\"background-color: #fff; padding: 4px; border: solid 1px #ccc\"><img onclick=\"closeDynamicImageWindow();\" style=\"cursor:pointer;border: solid 1px #000\" src=\""+file+"\" alt=\""+closeText+"\" width=\""+w+"\" height=\""+h+"\"\/><\/div><\/div>";
	} else if(typ == "javascript") {
		// center popup
		var postop =(screen.height /2)-(h/ 2);
		var posleft =(screen.width /2)-(w/ 2);
		window.open(file+'&closeText='+encodeURI(closeText)+'', '', 'dependent=yes,width='+w+',height='+h+',left='+posleft+',top='+postop+',scrollbars=no,resizable=no,menubar=no,location=no,status=no');
	}
}
function closeDynamicImageWindow() {
	document.getElementById("dynamicImageContainer").style.display = "none";
}