var xmlHttp = false;
// Internet Explorer
try {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}          
// Mozilla, Opera und Safari
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}
function hole_daten(von,nach){
	if (xmlHttp) {
	    xmlHttp.open('GET', 'http://www.section.at/xml/ort.html?ort=' + von, true);
	    xmlHttp.onreadystatechange = function () {
	        if (xmlHttp.readyState == 4) {
	            // alert(xmlHttp.responseText);
	            
	            name = 'select'
	            anzahl = 4;
	            if(xmlHttp.responseText != ""){
	            // FUNKTION
						 var arrOptions = xmlHttp.responseText.split( '&' );
					        var arrOption;
					        var objSelect = document.getElementById( name + nach);
					        objSelect.options.length = 0;
					        
					         objSelect.options[ 0 ] = new Option( 'Bitte wählen ...', '-1', false, false );
					          
					        
					        for( var i = 0; i < arrOptions.length; i++ )
					        {
					            arrOption = arrOptions[ i ].split( '=' );
					             objSelect.options[ i + 1 ] = new Option( arrOption[ 1 ], arrOption[ 0 ], false, false );
					        }
					 // FUNKTION       
					 
					 document.getElementById( name +nach ).style.display = "block";
					        for(var i = nach + 1; i < anzahl; i++ ){
			                   		document.getElementById( name + i ).style.display = "none";
				                 	document.getElementById( name + i ).value = -1;
				             }
					 
                   }else{
                   	for(var i = nach; i < anzahl; i++ ){
                   	 	document.getElementById( name + i ).style.display = "none";
                   	 	document.getElementById( name + i ).value = -1;
	                 
	             }
                   }
	            
	        }
	    };
	    xmlHttp.send(null);
	}
}
