// Map24 Init
function startMap24() {
	try { 
		goMap24(); 
	} 
	catch(e) {
		//alert(e); 
	}
}

// Navigation via Drop-Down
function changeScopePlus(selectedObj, confirmMessage) {
	
	var url = selectedObj.options[selectedObj.selectedIndex].value;
	var check = true;
	
	if (confirmMessage.length > 0)
		check = confirm(confirmMessage);

	if (check)
		top.location.href = url;
}

// Bilder Popups V2-Wrapper
function openDynamicImageWindow(file, w, h, typ, closeText) {
	openDynamicImageWindowV2(file, w, h, typ, closeText, "");
}

// Bilder Popups
function openDynamicImageWindowV2(file, w, h, typ, closeText, description) {
	if(typ == "dhtml") {

		// inner width and height
		var windowWidth, windowHeight;
		if (self.innerHeight) { // all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		}
		else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

		// scrolling offset
		var scrolltop, scrollleft;
		if (self.pageYOffset) { // all except Explorer
			scrollleft = self.pageXOffset;
			scrolltop = self.pageYOffset;
		}
		else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
			scrollleft = document.documentElement.scrollLeft;
			scrolltop = document.documentElement.scrollTop;
		}
		else if (document.body) { // all other Explorers
			scrollleft = document.body.scrollLeft;
			scrolltop = document.body.scrollTop;
		}

		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; }
		}

		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; text-align: center;\"><img onclick=\"closeDynamicImageWindow();\" style=\"cursor:pointer;border: solid 1px #000\" src=\""+file+"\" alt=\""+closeText+"\" width=\""+w+"\" height=\""+h+"\"\/>" + (description.length > 0 ? "<br>" + description : "") + "<\/div><\/div>";
	} else if(typ == "javascript") {
		// center popup
		var posleft = (screen.width/2)-(w/2);
		var postop = (screen.height/2)-(h/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";
}