
function getXML2(strURL,objFeld){
	var strResult ="0";
	xmlHttp = makeXMLobj();
	if (xmlHttp) {
	    xmlHttp.open('GET', strURL, true);
	    xmlHttp.onreadystatechange = function () {
	        if (xmlHttp.readyState == 4) {
	           objFeld.value = xmlHttp.responseText;
			}
		};

	    xmlHttp.send(null);
	}
	return strResult;
}

function getXMLclean(strURL,objFeld){
	var strResult ="0";
	xmlHttp = makeXMLobj();
	if (xmlHttp) {
	    xmlHttp.open('GET', strURL, true);
	    xmlHttp.onreadystatechange = function () {
	        if (xmlHttp.readyState == 4) {
	           objFeld.value = xmlHttp.responseText;
			}
		};

	    xmlHttp.send(null);
	}
	return strResult;
}

function getEntfernung(plz1,plz2,objFeld) {
	if(plz1!="" && plz2!="" ){
		if (plz2.length > 5) {
			plz1 = plz1.replace(/ /g, "");
			plz2 = plz2.replace(/ /g, "");
			ort1 = plz1.slice(5,plz1.length)
			plz1 = plz1.slice(0,5);
			
			ort2 = plz2.slice(5,plz2.length)
			plz2 = plz2.slice(0,5);
			
			var strURL = "/xml/orte_entfernung.htm?plz1="+plz1+"&plz2="+plz2;//+"&ort1="+ort1+"&ort2="+ort2;
			
			var strResult = getXML2(strURL,objFeld);
		}
	}else{
		objFeld.value = "0";
	}
}
function getLandkreisPortal(plz,objFeld) {
	if(plz!="" ){
		var strURL = "/xml/landkreise_portale.htm?suchstr="+plz;
		var strResult = getXMLclean(strURL,objFeld);
	}
	return strResult;
}
