$(document).ready(function() {
	$("#filter-type").change(onSelectChange);
	$("#filter-cubic").change(onSelectChange);
	$("#filter-license").change(onSelectChange);
});


function onSelectChange() {
	document.filter_products.submit();
	
	
	/*
	var sel_type = $("#filter-type option:selected");
	var sel_cubic = $("#filter-cubic option:selected");
	var sel_license = $("#filter-license option:selected");
	
	//Ajaxabfrage stellen
	
	var height = $("#products").height();
	//$("#products").css("min-height", height);
	$("#products").height(height);
	$("#products").html('<div class="overlay"><img src="fileadmin/global/img/ajax-loader.gif" /></div>');
	$.ajax({
		url: "index.php",		// Achtung mit RealURL!
		type: "GET",			// Daten per GET verschicken
		data: {
			id: "49",	// die erstellte eID
			"tx_lddproducts_pi1[type]": sel_type.val(),
			"tx_lddproducts_pi1[cubic]": sel_cubic.val(),
			"tx_lddproducts_pi1[license]": sel_license.val()
		},
		dataType: "html",		// das gibts zurŸck

		// Es hat funktioniert?
		success: function(response) {
			$("#products").html(response)
		},

		// Schade, es war ein Fehler
		error: function(error) {
			alert("Sorry, hat nicht funktioniert");
		}
	});
	
	
	//alert("options: " + sel_type.val() + " " + sel_cubic.val() + " " + sel_license.val());
	// send stuff to php file
	/*$.get("index.php?id=49&cat=" + 0 + "&type=" + sel_type.val() + "&cubic=" + sel_cubic.val() + "&license=" + sel_license.val(), function(data){
		//$("#products").hide("slow");
		$("#products").html(data).show("slow");
	});*/
	
}
