function wdLightbox(ID){
	if(kartePopUp.flashReady==true){
		kartePopUp.show(ID);
	}else{
		alert("Der Flash Film ist noch nicht geladen."+kartePopUp.flashReady);
	}
}

kartePopUp = {
	
	standardHeight	:	600, // Standard Höhe in Pixel
	standardWidth	:	800, // Standard Breite in Pixel
	
	leftMargin		:	24,
	topMargin		:	42,
	rightMargin		:	24,
	bottomMargin	:	24,
	
	flashReady		:	false,
	
	ns6				:	document.getElementById&&!document.all,
	opera			:	(document.all&& !document.styleSheets)? true:false,

	bundeslandID	:	"",
	root			:	"",
	
	init	:	function(url){
		
		this.root = url;
		
		document.write("<div style='float:left; display:inline;'>");
		document.write("	<div id='kartePopContainer' style='position:absolute; z-index:99; top:1px; left:1px; width:1px; height:"+document.body.clientHeight+"px;'>");
		document.write("		<script language=\"javascript\">");
		document.write("			AC_FL_RunContent(");
		document.write("				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',");
		document.write("				'width', '100%',");
		document.write("				'height', '100%',");
		document.write("				'src', 'galerie',");
		document.write("				'quality', 'low',");
		document.write("				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',");
		document.write("				'align', 'middle',");
		document.write("				'id', 'kartePop',");
		document.write("				'play', 'true',");
		document.write("				'loop', 'true',");
		document.write("				'scale', 'noscale',");
		document.write("				'wmode', 'transparent',");
		document.write("				'devicefont', 'false',");
		document.write("				'bgcolor', '#ffffff',");
		document.write("				'name', 'kartePop',");
		document.write("				'menu', 'true',");
		document.write("				'allowFullScreen', 'false',");
		document.write("				'allowScriptAccess','sameDomain',");
		document.write("				'movie', '"+url+"flash/kartePopUp',");
		document.write("				'salign', ''");
		document.write("				);");
		document.write("		<\/script>\n");
		document.write("	<\/div>");
		document.write("	<div id='backgroundClose' style='width:1px; height:1px; display:inline; z-index:50; background:#00163a; position:absolute; top:0px; left:0px;' onclick='kartePopUp.startHide()'></div>");
		document.write("	<div id='kartePopContentContainer' style='position:absolute; display:none; top:0px; left:0px; z-index:100; width:1px; height:1px;'>");
		
		document.write("		<iframe id='kartePopContentLeft' src='"+url+"iframe/karte.html?loading=true' frameborder='0' scrolling='no' style='float:left; display:inline; width:752px; height:100%;' ></iframe>");
		
		document.write("	</div>");
		document.write("<\/div>");
		
		this.checkReadyState();
		
	},
	
	setTransparency	:	function(target, trans){
		target.style.MozOpacity = trans;
		target.style.opacity = trans;
		target.style.filter = "alpha(opacity:" + ( trans * 100 ) + ")";
	},
	
	show	:	function(ID){
		
		document.getElementById('kartePopContentLeft').src=this.root+"iframe/karte.html?bundeslandID="+ID;
		
		this.bundeslandID = ID;
		this.movie("karte2").setQuality();
		
		this.setTransparency(document.getElementById('backgroundClose'), 0.8);
		
		var closeStyle=document.getElementById('backgroundClose').style;
		var containerStyle=document.getElementById('kartePopContainer').style;
		var windowMeasures = this.getWindowMeasures();
		
		closeStyle.width=document.body.clientWidth+"px";
		closeStyle.height=document.body.clientHeight+"px";
		
		containerStyle.display="none";
		
		containerStyle.width=this.standardWidth+"px";
		containerStyle.height=this.standardHeight+"px";
		
		containerStyle.left=windowMeasures.windowWidth / 2 - this.standardWidth / 2 + "px";
		containerStyle.top=windowMeasures.windowScrollTop + windowMeasures.windowHeight / 2 - this.standardHeight / 2 +"px";
		
		containerStyle.display="inline";
		
		this.movie("kartePop").show();
	},
	
	trace	:	function(val){
		alert(val);
	},
	
	startHide	:	function(){
		this.movie("kartePop").startHide();
		document.getElementById('kartePopContentContainer').style.display='none';
	},
	
	hideFinal	:	function(dump){
		this.movie("karte2").setQuality();
		var closeStyle=document.getElementById('backgroundClose').style;
		var containerStyle=document.getElementById('kartePopContainer').style;
		document.getElementById('kartePopContentLeft').src=this.root+"iframe/karte.html?loading=true";
		closeStyle.width="1px";
		containerStyle.width="1px";
		
	},
	
	getWindowMeasures	:	function(){
		if (this.ns6||this.opera){ // Opera // Firefox // Netscape
			var windowScrollTop=pageYOffset;
			var windowWidth = window.innerWidth;
			var windowHeight = window.innerHeight;
		}else{ // Internet Explorer
			var windowScrollTop=document.documentElement.scrollTop;
			var windowWidth = document.documentElement.clientWidth;
			var windowHeight = document.documentElement.clientHeight;
		}
		return {
					windowScrollTop	: windowScrollTop,
					windowWidth		: windowWidth,
					windowHeight	: windowHeight
				};
	},

	checkReadyState	:	function(){
		if(typeof this.movie("kartePop").flashReadyState=="function"){
			this.flashReady=true;
			this.movie("kartePop").adjust(this.standardWidth, this.standardHeight);
		}else{
			window.setTimeout("kartePopUp.checkReadyState()", 500);
		}
	},
	
	movie	:	function(movieID){
		if (this.ns6 || this.opera){
			return document[movieID];
		}else{
			return window[movieID];
		}
	},
	
	content	:	function(){
		var container = document.getElementById('kartePopContentContainer');
		var windowMeasures = this.getWindowMeasures();
		
		container.style.display = 'inline';
		
		container.style.top = windowMeasures.windowScrollTop + windowMeasures.windowHeight / 2 - this.standardHeight / 2 + this.topMargin +"px";;
		container.style.left = windowMeasures.windowWidth / 2 - this.standardWidth / 2 + this.leftMargin + "px";
		
		container.style.width = this.standardWidth-this.leftMargin-this.rightMargin+'px';
		container.style.height = this.standardHeight-this.topMargin-this.bottomMargin*2+'px';
	}
	
}









