function ansichten(bild) {
	window.open('popup_gewerbe.php?CID=' + bild + '','gewerbegebiete','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=YES,top=98,left=584,width=415,height=605');
}

function ansichten2(bild) {
	window.open('popup_grund.php?CID=' + bild + '','grundstuecksentwicklung','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=YES,top=98,left=584,width=410,height=605');
}

function ansichten3(bild) {
	window.open('popup_person.php?CID=' + bild + '','grundstuecksentwicklung','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=YES,top=98,left=584,width=410,height=200');
}

function ansichten4(bild) {
	window.open('popup_anfahrt.php?CID=' + bild + '','anfahrt','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=YES,top=98,left=584,width=440,height=500');
}
function ansichten5(bild) {
	window.open('popup_poster.html','egno','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=no,top=0,left=0,width=424,height=600');
} 
function medien(bild) {
	window.open('medien.php?movie=' + bild + '','medien','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=NO,top=98,left=584,width=240,height=200');
}
function medien2(bild) {
	window.open('medien2.php?movie=' + bild + '','medien','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=NO,top=98,left=584,width=320,height=260');
}
function galerie(bild) {
	window.open('popup_galerie.php?GID=' + bild + '','galerie','locationbar=no,status=no,resizable=no,toolbar=no,scrollbars=NO,top=98,left=584,width=504,height=480');
}

function popupImage(CID, Bild, breite, hoehe) {
	var absLinks=Math.round(screen.width/2-breite/2);
	var absOben=Math.round(screen.height/2-hoehe/2);
	var parEins="popup_image.php?CID=" + CID + "&PIC=" + Bild;
	var parZwei="DetailAnsicht";
	var parDrei="width=" + breite + ",height=" + hoehe + ",top=" + absOben + ",left=" + absLinks + ",toolbar=no, location=no";
//	window.open( 'popup_image.php?CID='+CID+'&PIC='+Bild+'' , 'Detail-Ansicht' , 'width=' + breite+', height=' + hoehe+', top=' + absOben+', left=' + absLinks+', toolbar=0, location=0');
	window.open(parEins, parZwei, parDrei);
}


function imgOn(danName) {
  
           document["x"].src = eval(danName + "ad.src");
            }  
function imgOff(danName) {
            document["x"].src = "img/KarteNN-Mitte.jpg";
      }
function kontakt(kontakt) 
{
	window.open(kontakt,'fenster','width=750,height=500,scrollbars=yes');
}


var layer_aktiv = "";
var myTimeOut=0;

function getLayerRef(id, document) {
	if (!document)
		{ document = window.document; }
		
	if (document.layers) {
		for (var l = 0; l < document.layers.lenght; l++) {
			if (document.layers[l].id == id)
				{ return document.layers[l]; }
			for (var l = 0; l < document.layers.lenght; l++) {
				var result = getLayerRef(id, document.layers[l].document);
				if (result)
					{ return result; }
			}
			return null;
		}
	}
	else if (document.all)
		{ return document.all[id]; }
	else if (document.getElementById)
		{ return document.getElementById(id); }
}

function activeLayer(layerName) {
	if(layer_aktiv != layerName) {
		if (layer_aktiv) hideLayer(layer_aktiv);
	}
	showLayer(layerName);
	layer_aktiv = layerName;	
}

function showLayer(layerName) {
	var objLayer = getLayerRef(layerName);
	
	if (document.layers) {
		eval('document["' + layerName + '"].visibility = "visible"');
	}
	else if (document.all) {
		objLayer.style.visibility = "visible";
	}
	else if (window.opera) {
		objLayer.style.visibility = "visible";
	}
	else if (document.getElementById) {
		objLayer.style.visibility = "visible";
	}
}

function hideLayer(layerName) {
	objLayer = getLayerRef(layerName);
	
	if (document.layers) {
		eval('document["' + layerName + '"].visibility = "hidden"');
	}
	else if (document.all) {
		objLayer.style.visibility = "hidden";
	}
	else if (window.opera) {
		objLayer.style.visibility = "hidden";
	}
	else if (document.getElementById) {
		objLayer.style.visibility = "hidden";
	}
}

function alleaus() {
	if (layer_aktiv != "") {
		hideLayer(layer_aktiv);
		layer_aktiv = "";
	}
}

function init() {
	document.onmouseup = alleaus;
}
