
		
	var ajax = new sack();
	var ajaxb = new sack();
	var currentClientID=false;
	function getClientData()
	{
		//var zipCode = document.getElementById('tx_realty_pi1-district').value.replace(/[^0-9]/g,'');
		var district=null;
		var districtsel= document.getElementById('tx_realty_pi1[district]');
		if (districtsel!=null){
		 	district=districtsel.options[districtsel.selectedIndex].value.replace(/[^0-9]/g,'');
			if(district!=currentClientID && district!=null){
				currentClientID = district;
				ajax.requestFile = '/getSFstadt.php?getCity='+district;	// Specifying which file to get
				ajax.onCompletion = showClientData;	// Specify function that will be executed after file has been found
				ajax.runAJAX();		// Execute AJAX function			
			}
		}
		
	}
	
	function showClientData()
	{
		var formObj = document.getElementById('tx_realty_pi1-city2');	
		
		
		eval(ajax.response);
	}
	
	
	
	function getHauseData(){
		
		ajax.requestFile = '/getSFhausetyp.php';	// Specifying which file to get
		
		ajax.onCompletion = ShowHauseData;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		
	
	}
	
	function ShowHauseData()
	{
		var formObj = document.getElementById('tx_realty_pi1-hauseTyp');	
		
		
		eval(ajax.response);
		
	}
	function getKantonData(){
		
		ajaxb.requestFile = '/getSFkanton.php';	// Specifying which file to get
		
		ajaxb.onCompletion = ShowKantonData;	// Specify function that will be executed after file has been found
		ajaxb.runAJAX();		
	
	}
	
	function ShowKantonData()
	{
		var formObj = document.getElementById('tx_realty_pi1[district]');	
		
		
		eval(ajaxb.response);
		
	}
	
	
	function initFormEvents()
	{
		
		//var ajax = new sack();var currentClientID=false;var selectmenu=document.getElementById('tx_realty_pi1-district');selectmenu.onchange=getClientData();
		
			getHauseData();
			//ajax=null;
			//var ajaxb = new sack();
			getKantonData();
			
			
		
		
	}
	
	
	

