jQuery.noConflict();

jQuery(document).ready(function($) {
	$("#date1").datepicker();
	$("#date2").datepicker();
	$("#date3").datepicker();

	$("#pickup_request_link").click(function(event){
		$("#driver_form").css("display","none");
		$("#pickup_form").css("display","block");
		event.preventDefault();
	});
	$("#need_a_driver_link").click(function(event){
		$("#driver_form").css("display","block");
		$("#pickup_form").css("display","none");
		event.preventDefault();
	});


	$("#region_select21").change(function(){
		$('#county_select21 option').remove();

		for (a in counties[this.value]) {
		    if (typeof(counties[this.value][a]) == 'function') continue;
		    $('#county_select21').append('<option value="'+a+'">'+counties[this.value][a]+'</option>');
		}
		$('#county_select21').val(selected_county);
	});

	$("#region_select21").change();
	
	$("#region_select22").change(function(){
		$('#county_select22 option').remove();

		for (a in counties[this.value]) {
 		 if (typeof(counties[this.value][a]) == 'function') continue;
		 $('#county_select22').append('<option value="'+a+'">'+counties[this.value][a]+'</option>');
		}
		$('#county_select22').val(selected_county);
	});

	$("#region_select22").change();
	
	
    $("#region_select_reg").change(function(){
    	$('#county_select_reg option').remove();
		for (a in counties[this.value]) {
		 if (typeof(counties[this.value][a]) != 'string') continue;
		 $('#county_select_reg').append('<option value="'+a+'">'+counties[this.value][a]+'</option>');
		}
		if (selected_county) $('#county_select_reg').val(selected_county);
	});

	$("#region_select_reg").change();

});

