// JavaScript Document

function searchBroker(){
		region = $('#region').val();
		if (region == "All"){
			loc = "All";
		}else{
			loc = $('#location').val();
		}
	  	window.location.replace("/travel_specialists_list/"+region+"/"+loc);
		return false;
	}
	
	$(document).ready(function() {
	  $('option[disabled]').css({'color': '#cccccc'});
	  $('select').change(function() {
		if(this.options[this.selectedIndex].disabled) {
		  if(this.options.length == 0) {
			this.selectedIndex = -1;
		  } else {
			this.selectedIndex--;
		  }
		  $(this).trigger('change');
		}
	  });
	  $('select').each(function(it) {
		if(this.options[this.selectedIndex].disabled)
		  this.onchange();
  		});
	});
	  
	function getArea(){
		v = $('#region').val();
		//alert(v);
		curLoc = $('#currentLocation').val();
		//alert(curLoc);
		if(v.length != 0){
			//alert(v);
			
			$.post("/getLocation.php", { region: v, currentLocation: curLoc},
				function(data){
				 if (data.error == "false"){
					$('#regionList').html(data.returnvalue);
				 }else{
					 $('#regionList').html('<input type="hidden" value="" name="location" id="location" />');
				 }
				 
			},"json");
			

		}else{
			$('#regionList').html('<input type="hidden" value="" name="location" id="location" />');
		}

	}	  
