function updateForm(pos) {
	$("#loading").css("visibility", "visible");

	/* Reihenfolge der Datenbank-Felder */
	var order = Array();
	var counthiddenfields = 0;
	
	$('#productfinder input.filter-hidden').each(function(c){
		order.push($(this).attr("name"));
		counthiddenfields++;
	});

	$('#productfinder .filter-select').each(function(c){
		order.push($(this).find("label").attr("for"));
	});
			
	
	/* Default-Wert setzen */
	if(pos == undefined){
		pos = counthiddenfields;
	}

	/* Cleaning */
	for(i=pos;i<order.length;i++){
		//$("#wrap_"+order[i]).css("display", "none");
		//$("#select_"+order[i]).html('');
		$("#select_"+order[i]+"").html('<select  name="" ><option value="">-------------------</option></select>');
		$("#select_"+order[i]+" select").attr("disabled","disabled"); 


	}


	if($("#"+order[pos-1]).val() != ''){
		/* Nächste Selectbox laden */
		$.post("/produktfinder/ajaxrequest.php?do=showNextSelectbox", $("#productfinder").serialize()+"&order="+order, function(data){
		if(data != false || data!=""){
				$("#select_"+order[pos]).html(data);
				$("#wrap_"+order[pos]).css("display", "block");
			}
		});

	}

	/* Results laden */
	$.post("/produktfinder/ajaxrequest.php?do=showResults", $("#productfinder").serialize(), function(data_results){
		$("#results").html(data_results);
	});

	$("#loading").css("visibility", "hidden");
}

$(document).ready(function () {
	updateForm();
});