// JavaScript Document
jQuery.noConflict();

jQuery(document).ready(function(e) {
  //resetSoortWoning();
});

function resetSoortWoning()
{
	resetPrijsVanaf();
	resetPrijsTot();
	updateSoortWoning();
	
	return false;
}

function changeSoortWoning()
{
	
}

function changePrijsVanaf(item)
{
	jQuery.ajax({
		 type: "POST",
		 url: "updatePrijs.php",
		 data: "prijs_type=vanaf&value=" + item.value + "&selected=" + jQuery('#prijs_tot').val(),
		 success: function(html){
			 jQuery('#prijs_tot').empty();
			 jQuery('#prijs_tot').append(html);
		 }
	 });
	
	updateSoortWoning();
}

function resetPrijsVanaf()
{
	jQuery.ajax({
		 type: "POST",
		 url: "updatePrijs.php",
		 data: "prijs_type=vanaf&value=0&selected=9999999",
		 async: false,
		 success: function(html){
			 jQuery('#prijs_tot').empty();
			 jQuery('#prijs_tot').append(html);
		 }
	 });
}

function changePrijsTot(item)
{
	jQuery.ajax({
		 type: "POST",
		 url: "updatePrijs.php",
		 data: "prijs_type=tot&value=" + item.value + "&selected=" + jQuery('#prijs_vanaf').val(),
		 success: function(html){
			 jQuery('#prijs_vanaf').empty();
			 jQuery('#prijs_vanaf').append(html);
		 }
	 });
	
	updateSoortWoning();
}

function resetPrijsTot()
{
	jQuery.ajax({
		 type: "POST",
		 url: "updatePrijs.php",
		 data: "prijs_type=tot&value=9999999&selected=0",
		 async: false,
		 success: function(html){
			 jQuery('#prijs_vanaf').empty();
			 jQuery('#prijs_vanaf').append(html);
		 }
	 });
}

function updateSoortWoning()
{
		jQuery.ajax({
		 type: "POST",
		 url: "updateSoortWoning.php",
		 data: "prijs_vanaf=" + jQuery('#prijs_vanaf').val() + "&prijs_tot=" + jQuery('#prijs_tot').val(),
		 success: function(html){
			 jQuery('#soort_woning').empty();
			 jQuery('#soort_woning').append(html);
		 }
	 });

}
