
	function formAjaxLoader () {
		var objecttype = Ext.query('input[name="objecttype"]')[0].value;
		var searchtype = Ext.query('input[name="searchtype"]')[0].value;
		var ortbase = Ext.get("ort");
		var stadtteilbase = Ext.get("stadtteil");
		stadtteilbase.setVisibilityMode(Ext.Element.DISPLAY);
		ortbase.on("change",function() {
			var newort = ortbase.dom.value;
			if (!Ext.isIE) {
				stadtteilbase.set({disabled:"disabled"});
				Ext.Ajax.request({
					success:function(response,options) {
						var newdata = Ext.util.JSON.decode(response.responseText);
						Ext.each(stadtteilbase.query('option[value!=""]'),function(item,index,all){
							Ext.get(item).remove();
						});
						if (newdata.length > 1) {
							stadtteilbase.dom.removeAttribute("disabled");
							Ext.each(newdata, function(item, index, all){
								if (item != "") {
									Ext.DomHelper.append(stadtteilbase, {
										tag: "option",
										value: item,
										html: item
									});
								}
							});
						}

					},
					error:function() {
						alert("fehler");
					},
					url:"dataStadtteile.php",
					method:"GET",
					params: {
						objecttype:objecttype,
						searchtype:searchtype,
						ort:newort
					}
				});

			}
			else {
				var loc = window.location.href;
				if (loc.search(/\?/)==-1)
					loc+="?";
				while (loc.match(/&forceIE=\w*/)!=null)
					loc = loc.replace(/&forceIE=\w*/,"");
				window.location.href=loc+"&forceIE="+newort;
			}
		});		
	}
	
	var iestinkt = new formAjaxLoader();

