
function searchAddressSide(){
	 $('autocomplete_geo_side').hide();
	 if($('ort_side').value != ''){
	 	if($('lat_side').value == '' && $('lng_side').value == ''){
			 $('indicator_loc_side').show();
			 var geo = new GClientGeocoder(); 
							
			 // ====== Array for decoding the failure codes ======
			 var reasons=[];
			 reasons[G_GEO_SUCCESS]            = "Success";
			 reasons[G_GEO_MISSING_ADDRESS]    = "Fehlende Adresse: Die Adresse fehlt oder hat keinen Wert.";
			 reasons[G_GEO_UNKNOWN_ADDRESS]    = "Unbekannte Adresse:  Es konnte keine geopgraphische Entsprechung zu der eingegebenen Adresse gefunden werden.";
			 reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Addressdaten nicht verf&uuml;gbar aus rechtlichen Gr&uuml;nden.";
			 reasons[G_GEO_BAD_KEY]            = "Bad Key: The API key is either invalid or does not match the domain for which it was given";
			 reasons[G_GEO_TOO_MANY_QUERIES]   = "TMQ";
			 reasons[G_GEO_SERVER_ERROR]       = "Server Fehler: Der Geocoding Prozess konnte nicht erfolgreich abgeschlossen werden.";
			
			var search = document.getElementById("ort_side").value;
							// ====== Perform the Geocoding ======        
			geo.getLocations(search, 
				function (result){ 
					$('indicator_loc_side').hide();
					// If that was successful
					if (result.Status.code == G_GEO_SUCCESS) {
						$('autocomplete_geo_side').show();
					  // How many resuts were found
					  // Loop through the results, placing markers
					  $("autocomplete_geo_side").innerHTML = "Gefundene Orte:";
					  for (var i=0; i<result.Placemark.length; i++) {
						var p = result.Placemark[i].Point.coordinates;
						$("autocomplete_geo_side").innerHTML += "<br />"+(i+1)+": <a href=\'javascript:void(0);\' onclick=\'javascript:$(\"lng_side\").value = \"" + p[0] + "\";$(\"lat_side\").value = \"" + p[1] + "\";$(\"ort_side\").value =\"" + result.Placemark[i].address + "\";$(\"autocomplete_geo_side\").hide();document.comm_search_form_side.submit();return false;\'>"+ result.Placemark[i].address + "</a>";														
					  }
					}else {
					  var reason="Code "+result.Status.code;
					  if (reasons[result.Status.code]) {
						reason = reasons[result.Status.code]
					  } 
					  alert( search + " konnte nicht gefunden werden."  + reason);
					}
				}
			);
		}else
			document.comm_search_form_side.submit();return false;
	} else
		document.comm_search_form_side.submit();return false;
}	   

