// JavaScript Document
$(document).ready(function()	{
	$('#simple_search').click(function() {
 		k = $('#search_terms').val()
 		t = $('#listing_type').val()
 		l = $('#location').val()
 		
 		if(k && t)
 		{
 		  $('#simple_search_form').submit()
 		}
 		else
 		{
 		   alert('Please fill all required * fields to search')
 		}
	});
	
	$('#realestate_advanced_search').click(function() {
	   l = $("#id_location").val()
 		t = $("#id_type").val()
 		fc = $("#id_facilities").val()
 		ft = $("#id_features").val()
 		np = $("#not_permitted").val()
 		
 		if(l || t || fc || ft || np )
 		{
 		  $('#realestate_advanced_search_form').submit()
 		}
 		else
 		{
 		   alert('Please select at least one field to search')
 		}
	});
	
	$('#vehicle_advanced_search').click(function() {
	   l = $("#id_location").val()
 		t = $("#id_type").val()
 		ft = $("#id_features").val()
 		np = $("#id_model").val()

 		
 		if(l || t || ft || np )
 		{
 		  $('#vehicle_advanced_search_form').submit()
 		}
 		else
 		{
 		   alert('Please select at least one field to search')
 		}
	});
	
	$('#tourpackage_advanced_search').click(function() {
	   l = $("#id_location").val()
 		d = $("#id_destination").val()
 		lk = $("#id_landmark").val()
 		inc = $("#id_includes").val()

 		
 		if(l || d || lk || inc )
 		{
 		  $('#tourpackage_advanced_search_form').submit()
 		}
 		else
 		{
 		   alert('Please select at least one field to search')
 		}
	});	
	
});