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;
    			//alert('IE');
    			
    			//alert(windowHeight);
    			//var scrolltop = document.body.scrollTop;
    			//var scrollleft = document.body.scrollLeft;
    			
    			var scrolltop = document.documentElement.scrollTop;
    			var scrollleft = document.documentElement.scrollLeft;
    			
    			var postop =(h/ 2)+scrolltop+document.body.style.padding;
    			var posleft =(windowWidth/2)-(w/ 2)+scrollleft+document.body.style.padding;
    			
    		} else {
    			//alert('nicht IE');
    			var windowWidth = self.innerWidth;
    			var windowHeight = self.innerHeight;
    			var scrolltop = document.documentElement.scrollTop;
    			var scrollleft = document.documentElement.scrollLeft;
    			
    			var postop =(windowHeight/2)-(h/ 2)+scrolltop+document.body.style.padding;
    			var posleft =(windowWidth/2)-(w/ 2)+scrollleft+document.body.style.padding;
    		
    		}
//    		var postop =(windowHeight/2)-(h/ 2)+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; }
    		}
    		
    		
    		//alert("postop:"+postop+"\nscrolltop:"+scrolltop + "\npostop - scrolltop = " + (postop-scrolltop) + "\nwindowHeight: " + windowHeight); // gibt 0 aus
    		
    		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; z-index: 10000;\"><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";
}