
$(document).ready(function() {
	$('#buy_type').change(function() {
		type = $("option:selected", this).val();
		form = $('#form').val();
		url_max_price = URL_SITE+'select/max-price/'+type+'/'+form;
		url_min_price = URL_SITE+'select/min-price/'+type+'/'+form;
		jQuery('#min-price').load(url_min_price);
		jQuery('#max-price').load(url_max_price);
		if(type == 'C') a_tab_commercial();
		else a_tab_residencial();
	});
	
});

 function pagination(url){
	jQuery('.content-right').load(url);
 }
 
 function a_tab_commercial(){
	$('#tab-residencial').removeClass('tab-residencial-active').addClass('tab-residencial');
	$('#tab-residencial').html('<a href="#" onclick="a_tab_residencial();">Residencial</a>');
	$('#tab-commercial').html('Commercial');
	$('#tab-commercial').removeClass('tab-commercial').addClass('tab-commercial-active');
	$('#wf_p').hide();
	$('#wv_g').hide();
	$('#short_sale').hide();
	$('#bank_owend').hide();
 }
 
function a_tab_residencial(){
	$('#tab-commercial').removeClass('tab-commercial-active').addClass('tab-commercial');
	$('#tab-commercial').html('<a href="#" onclick="a_tab_commercial();">Commercial</a>');
	$('#tab-residencial').html('Residencial');
	$('#tab-residencial').removeClass('tab-residencial').addClass('tab-residencial-active');
	$('#wf_p').show();
	$('#wv_g').show();
	$('#short_sale').show();
	$('#bank_owend').show();
}
  
function a_tab_north_florida(){
	$('#tab-south-florida').removeClass('tab-south-florida-active').addClass('tab-south-florida');
	$('#tab-south-florida').html('<a href="#" onclick="a_tab_south_florida();">South Florida</a>');
	$('#tab-north-florida').html('Mid Florida');
	$('#tab-north-florida').removeClass('tab-north-florida').addClass('tab-north-florida-active');
	
}
	 
function a_tab_south_florida() {
	$('#tab-north-florida').removeClass('tab-north-florida-active').addClass('tab-north-florida');
	$('#tab-north-florida').html('<a href="#" onclick="a_tab_north_florida();">Mid Florida</a>');
	$('#tab-south-florida').html('South Florida');
	$('#tab-south-florida').removeClass('tab-south-florida').addClass('tab-south-florida-active');
}

function load_project(code) {
	if(code == 'canyon-ranch'){
		 $('#logo1').attr('src',IMAGE_SITE+'public/picture/featured_project/logo/canyon_ranch_on.png');
		 $('#logo2').attr('src',IMAGE_SITE+'public/picture/featured_project/logo/marquis_off.png');
	} else {
		$('#logo2').attr('src',IMAGE_SITE+'public/picture/featured_project/logo/marquis_on.png');
		$('#logo1').attr('src',IMAGE_SITE+'public/picture/featured_project/logo/canyon_ranch_off.png');
	}
	
    $.ajax({
    	url: URL_SITE+'show-fp/load/'+code,
    	type: 'POST', 
    	success: function(data){
    			$('#featured-project').html(data);    		
    	}
    });
}

function property_order(order) {
	$.ajax({
    	url: URL_SITE+'list-properties/order/'+order,
    	type: 'GET', 
    	success: function(data){
    			$('#content-properties').html(data);    		
    	}
    });
}

function property_order(order) {
	$.ajax({
    	url: URL_SITE+'list-properties/order/'+order,
    	type: 'GET', 
    	success: function(data){
    			$('#content-properties').html(data);    		
    	}
    });
}

function property_order2(order) {
	$.ajax({
    	url: URL_SITE+'asociated-properties/order/'+order,
    	type: 'GET', 
    	success: function(data){
    			$('#content-properties').html(data);    		
    	}
    });
}
