Index: trunk/mapbender/http/nav/alkisnav_adr.htm
===================================================================
--- trunk/mapbender/http/nav/alkisnav_adr.htm	(revision 216)
+++ trunk/mapbender/http/nav/alkisnav_adr.htm	(revision 356)
@@ -11,6 +11,5 @@
 	<script type="text/javascript" language="JavaScript">
 		// Parameter fuer Mandant aus url lesen
-		// &gkz=150&gemeinde=40&test=ja
-		var parms = location.search.split("&");    // 0: "?gkz=150" 1: "gemeinde=40" 2: "test=ja"
+		var parms = location.search.split("&");
 		var arr = parms[0].split("=", 2); // 0: "?gkz"  1: "150"
 		var gkz = "000";
@@ -19,18 +18,26 @@
 		var gem = "0";
 		if(arr[0] == "gemeinde") {gem = arr[1];}
-		// aktueller EPSG-Code
+
+		// aktuellen EPSG-Code der Mapbender-GUI auslesen
 		function sendGuiEpsg () {
-			var ind = parent.parent.getMapObjIndexByName("mapframe1");
-			var epsg = parent.parent.mb_mapObj[ind].getSRS();
-			document.forms[0].epsg.value = epsg;
-		}
-		function validate(){
-			sendGuiEpsg();
+			var MapObj = parent.parent.getMapObjIndexByName;
+			if (typeof MapObj == "function" ) { // beim Laden der GUI noch "undefined"
+				var ind = parent.parent.getMapObjIndexByName("mapframe1");
+				var epsg = parent.parent.mb_mapObj[ind].getSRS();
+				document.forms[0].epsg.value = epsg;
+			}
+		} // AnfÃ€nglich wird der EPSG aus der .conf verwendet.
+		// Hin- und Herschalten zwischen den Such-Typen ADR/EIG/FS/GB aktualisiert den EPSG
+
+		// Bei Absenden des Formulars:
+		function validate() {
 			document.forms[0].gkz.value = gkz;
 			document.forms[0].gemeinde.value = gem;
+			sendGuiEpsg();
 		}
 	</script>
 </head>
-<body onload="javascript:validate();">
+<body>
+<!-- <body onload="javascript:validate();"> -->
 
 <div id='tabs'>
@@ -52,31 +59,31 @@
 	<input class='sbutton' type='submit' value='ok'>
 	<br>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='A'; document.forms[0].submit();">A</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='B'; document.forms[0].submit();">B</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='C'; document.forms[0].submit();">C</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='D'; document.forms[0].submit();">D</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='E'; document.forms[0].submit();">E</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='F'; document.forms[0].submit();">F</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='G'; document.forms[0].submit();">G</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='H'; document.forms[0].submit();">H</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='I'; document.forms[0].submit();">I</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='J'; document.forms[0].submit();">J</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='K'; document.forms[0].submit();">K</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='L'; document.forms[0].submit();">L</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='M'; document.forms[0].submit();">M</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='N'; document.forms[0].submit();">N</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='A'; document.forms[0].submit();">A</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='B'; document.forms[0].submit();">B</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='C'; document.forms[0].submit();">C</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='D'; document.forms[0].submit();">D</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='E'; document.forms[0].submit();">E</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='F'; document.forms[0].submit();">F</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='G'; document.forms[0].submit();">G</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='H'; document.forms[0].submit();">H</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='I'; document.forms[0].submit();">I</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='J'; document.forms[0].submit();">J</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='K'; document.forms[0].submit();">K</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='L'; document.forms[0].submit();">L</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='M'; document.forms[0].submit();">M</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='N'; document.forms[0].submit();">N</span>
 	<br>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='O'; document.forms[0].submit();">O</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='P'; document.forms[0].submit();">P</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='Q'; document.forms[0].submit();">Q</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='R'; document.forms[0].submit();">R</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='S'; document.forms[0].submit();">S</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='T'; document.forms[0].submit();">T</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='U'; document.forms[0].submit();">U</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='V'; document.forms[0].submit();">V</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='W'; document.forms[0].submit();">W</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='X'; document.forms[0].submit();">X</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='Y'; document.forms[0].submit();">Y</span>
-	<span class="letter" onclick="sendGuiEpsg(); document.forms[0].street.value='Z'; document.forms[0].submit();">Z</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='O'; document.forms[0].submit();">O</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='P'; document.forms[0].submit();">P</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='Q'; document.forms[0].submit();">Q</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='R'; document.forms[0].submit();">R</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='S'; document.forms[0].submit();">S</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='T'; document.forms[0].submit();">T</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='U'; document.forms[0].submit();">U</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='V'; document.forms[0].submit();">V</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='W'; document.forms[0].submit();">W</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='X'; document.forms[0].submit();">X</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='Y'; document.forms[0].submit();">Y</span>
+	<span class="letter" onclick="validate(); document.forms[0].street.value='Z'; document.forms[0].submit();">Z</span>
 </form>
 
