$(document).ready(function(){

	$(".btn-slide").click(function(){
		$("#panel").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
	 
});

$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute

	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'25px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'56px'},{queue:false,duration:160});
	});
});

$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute

	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid2.caption2').hover(function(){
		$(".cover2", this).stop().animate({top:'25px'},{queue:false,duration:160});
	}, function() {
		$(".cover2", this).stop().animate({top:'56px'},{queue:false,duration:160});
	});
});

$(document).ready(function() {
$('#loader').hide();

$('#province').change(function(){

	$('#area').fadeOut();
	$('#hood').fadeOut();
	$('#loader').show();

	$.post("/ajax/select-box-area.php", {
		province: $('#province').val()
	}, function(response){
		setTimeout("finishAjax('area', '"+escape(response)+"')", 400);
	});
	return false;
});

$('#area').change(function(){

	$('#hood').fadeOut();
	$('#loader').show();

	$.post("/ajax/select-box-hood.php", {
		province: $('#province').val(),
		area: $('#area').val(),
		area_id: $('#area_id').val()
	}, function(response){
		setTimeout("finishAjax('hood', '"+escape(response)+"')", 400);
	});
	return false;
});

});

function finishAjax(id, response){
	 $('#loader').hide();
	 $('#'+id).html(unescape(response));
	 $('#'+id).fadeIn();
}
