// Copyright 2001-2005 Rüdiger Stippa - Landeshauptstadt Erfurt - Stadtverwaltung
var browser;
var xloc, yloc;

function testeBrowser() {
//	if ((navigator.appName=="Netscape") && (navigator.appVersion.charAt(0) >= 5)) {
	if (document.getElementById) {
		schicht="document.getElementById";
		stil=".style";
		da="visible";
		weg="hidden";
		browser="w3c";
//		alert("w3c");
	}
//	else if ((navigator.appName=="Microsoft Internet Explorer") && (navigator.appVersion.charAt(0) >= 4)) {
	else if (document.all) {
		schicht="document.all";
		stil=".style";
		da="visible";
		weg="hidden";
		browser="ie";
//		alert("ie");
	}
//	else if ((navigator.appName=="Netscape") && (navigator.appVersion.charAt(0) == 4)) {
	else if (document.layers) {
		schicht="document.layers";
		stil="";
		da="show";
		weg="hide";
		browser="n4";
//		alert("n4");
	}
}

function zeigeLocLayer() {
	if (document.layers || document.all || document.getElementById) {
		testeBrowser();
		if (Mode == 5) {
			xloc = ( ((parent.NF.X-2) * (108 / Math.pow(3,parent.NF.ME)) ) - (108 / Math.pow(3,parent.NF.ME)) + 3);
			yloc = ( ((parent.NF.Y-2) * (108 / Math.pow(3,parent.NF.ME)) ) - (108 / Math.pow(3,parent.NF.ME)) + 2);
		} else {
			xloc = ( ((parent.NF.X-1) * (108 / Math.pow(3,parent.NF.ME)) ) - (108 / Math.pow(3,parent.NF.ME)) + 3);
			yloc = ( ((parent.NF.Y-1) * (108 / Math.pow(3,parent.NF.ME)) ) - (108 / Math.pow(3,parent.NF.ME)) + 2);
		}
	if ( browser == "ie" || browser == "n4" ) {
		eval(schicht+'["map_loc"]'+stil+'.visibility = "'+weg+'"');
//		alert(schicht+'["map_loc"]'+stil+'.left='+xloc);
		eval(schicht+'["map_loc"]'+stil+'.left='+xloc);
		if ( parent.NF.ME == 4 || parent.NF.ME == 5) // ME5
		{
			if ( browser == "ie" ) {
				yloc=yloc - 7;
				xloc=xloc - 3;
			} else {
				yloc=yloc-9;
				xloc=xloc-9;
			}
			eval(schicht+'["map_loc"]'+stil+'.top = '+yloc);
		}
		else if ( parent.NF.ME == 3 )
		{
			if ( browser == "ie" ) {
				yloc=yloc + 1; // -4
				xloc=xloc - 2; //
			} else {
				yloc=yloc-2;
				xloc=xloc - 2; //
			}
			eval(schicht+'["map_loc"]'+stil+'.top = '+yloc);
			eval(schicht+'["map_loc"]'+stil+'.left = '+xloc);
		}
		else if ( parent.NF.ME == 2 )
		{
			if ( browser == "ie" ) {
				yloc=yloc + 4; // -4
				xloc=xloc - 2; //
			} else {
				yloc=yloc-2;
				xloc=xloc - 2; //
			}
			eval(schicht+'["map_loc"]'+stil+'.top = '+yloc);
			eval(schicht+'["map_loc"]'+stil+'.left = '+xloc);
		}
		else if ( parent.NF.ME == 1 )
		{
			if ( browser == "ie" ) {
				yloc=yloc + 4; // -4
				xloc=xloc - 2; //
			} else {
				yloc=yloc-2;
				xloc=xloc - 2; //
			}
			eval(schicht+'["map_loc"]'+stil+'.top = '+yloc);
			eval(schicht+'["map_loc"]'+stil+'.left = '+xloc);
		}
		eval(schicht+'["map_loc"]'+stil+'.visibility = "'+da+'"');
	}
	else
	{
		// W3C
		xloc=xloc - 2;
		if (parent.NF.ME == 1) {
			if ( navigator.userAgent.toLowerCase().indexOf("msie")>-1) {
				xloc=1;
				yloc=6;
			} else {
				xloc=1;
				yloc=6;
			}
		}
		else if (parent.NF.ME == 2)
			if ( navigator.userAgent.toLowerCase().indexOf("msie")>-1)
				yloc=yloc + 4;
			else
				yloc=yloc + 4;
		else if (parent.NF.ME == 3)
			if ( navigator.userAgent.toLowerCase().indexOf("msie")>-1)
				if (Mode == 5)
					yloc=yloc + 4;
				else
					yloc=yloc + 1;
			else
				yloc=yloc + 4;
		else if (parent.NF.ME == 4)
			if ( navigator.userAgent.toLowerCase().indexOf("msie")>-1 ) 
				if (Mode == 5)
					yloc=yloc - 4 ;
				else {
					xloc=xloc - 3;
					yloc=yloc - 3;
				}
			else
				if (Mode == 5) {
					xloc=xloc - 0;
					yloc=yloc + 4;
				 } else {
					xloc=xloc - 3;
					yloc=yloc - 0;
				}
		else if (parent.NF.ME == 5) // ME5
			if ( navigator.userAgent.toLowerCase().indexOf("msie")>-1 ) 
				if (Mode == 5) {
					yloc=yloc - 4;
					xloc=xloc - 4;
				} else {
					xloc=xloc - 4;
					yloc=yloc - 4;
				}
			else
				if (Mode == 5) {
					xloc=xloc - 4;
					yloc=yloc - 1;
				 } else {
					xloc=xloc - 5;
					yloc=yloc - 2;
				}

		document.getElementById('map_loc').style.left=xloc;
		document.getElementById('map_loc').style.top=yloc;
		document.getElementById('map_loc').style.visibility="visible";
	}
	}
}

