$(document).ready(function(){

    // initalize hints on form inputs
    $(function(){ 
        // find all the input elements with title attributes
        $('input[title!=""]').hint();
    });

    // show hidden form inputs via selecting appropriate radio control
    $('input.detailshow').click(function() {
        $('#homeowner_detail').show();
    });
    $('input.detailhide').click(function() {
        $('#homeowner_detail').hide();
    });
    $('input:radio').click(function() {
        var thisFieldset = $(this).closest('fieldset');
        $(thisFieldset).find('input:radio').removeClass('error');
    });
     
    // remove the error class from dropdowns after validation has occurred
    // once a user has made a valid choice

    $('select').change(function() {
        var thisForm = $(this).closest('form');
        $(thisForm).validate().element(this);
    });  
});

 $('input:radio').click(function() {

        var thisFieldset = $(this).closest('fieldset');

        $(thisFieldset).find('input:radio').removeClass('error');

     });    

    // remove the error class from dropdowns after validation has occurred
    // once a user has made a valid choice    

    $('select').change(function() {

        var thisForm = $(this).closest('form');

        $(thisForm).validate().element(this);

     });


