function drop_down_list()
{
    var state = $('#states').val();
      
    if(state == 'AK' || state == 'DC') // Alaska and District Columbia have no counties
    {
        $('#county_drop_down').hide();
        $('#no_county_drop_down').show();
    }
    else
    {
        if(state != 'all'){
      
        
          $('#loading_county_drop_down').show(); // Show the Loading...
        }
        $('#county_drop_down').hide(); // Hide the drop down
        $('#no_county_drop_down').hide(); // Hide the "no counties" message (if it's the case)
    
        $.getScript("/custom/js/states/"+ state.toLowerCase() +".js", function(){
            populate(document.form.county);
            
            $('#loading_county_drop_down').hide(); // Hide the Loading...
            $('#county_drop_down').show(); // Show the drop down
        });
    }
    
    var smc_states= new Array()
        smc_states["IA"] ="170";
        smc_states["MT"] ="84";
        smc_states["MN"] ="204";
        smc_states["NE"] ="83";
        smc_states["ND"] ="81";
        smc_states["SD"] ="80";
        smc_states["WY"] ="85";

    $("#state").val(smc_states[state]);
    
    
}

$(document).ready(function(){
$("#states").change(drop_down_list);





$("#county").change(function() {

 var selcounty = $(this).val();
 $("#countyselected").val(selcounty);
 
}
);




});

$(window).load(drop_down_list);

