$.url = function(url) {
    return $("meta[name='Identifier-URL']").attr('content')+url.substr(1);
}

//$(document).ready(function() {
//    $('#ClassifiedStateId').val('');
//});

    $(function() {
        $('#state_id').chainSelect('#city_id',$.url('/cities/loadCity/'),
        {
            before:function (target) //before request hide the target combobox and display the loading message
            {
                $(target).attr('disabled',true);
                $('#state_id').attr('disabled',true);

                $("#LoadingDiv").css("display","block");
                $(target).css("display","none");
            },
            after:function (target) //after request show the target combobox and hide the loading message
            {
                $(target).attr('disabled',false);
                $('#state_id').attr('disabled',false);
            
                $("#LoadingDiv").css("display","none");
                $(target).css("display","inline");

                $(target + " option[selected]").removeAttr("selected");
                $(target + " option[value='']").attr("selected", "selected");
            }
        });

    });

