$(document).ready(function() {

  $('#contact_us_dept').livequery('change', function() {
    var form = $(this).parents('form');
    var dept = $('#contact_us_dept').val();
    $.get(form.attr('action'), { route: dept }, null, "script");
    return false;
  }).attr("rel", "nofollow");

  $('#email_us_dept').livequery('change', function() {
    var form = $(this).parents('form');
    $('#email_us_dept_changed').val(true);
    form.submit();
  }).attr("rel", "nofollow");

  $("input[name=rental[location]]").livequery('click', function() {
    if ($('input#rental_location_massachusetts').is(':checked')) {
       $('input#rental_area_mb').attr('disabled', false);
       $('input#rental_area_mw').attr('disabled', false);
       $('input#rental_area_ss').attr('disabled', false);
       $('input#rental_area_ns').attr('disabled', false);
       $('input#rental_area_cc').attr('disabled', false);
       $('input#rental_area_ot').attr('disabled', false);
    }
    else {
       $('input#rental_area_mb').attr('disabled', true);
       $('input#rental_area_mw').attr('disabled', true);
       $('input#rental_area_ss').attr('disabled', true);
       $('input#rental_area_ns').attr('disabled', true);
       $('input#rental_area_cc').attr('disabled', true);
       $('input#rental_area_ot').attr('disabled', true);
       $('input#rental_area_mb').attr('checked', false);
       $('input#rental_area_mw').attr('checked', false);
       $('input#rental_area_ss').attr('checked', false);
       $('input#rental_area_ns').attr('checked', false);
       $('input#rental_area_cc').attr('checked', false);
       $('input#rental_area_ot').attr('checked', false);
    }
  }).attr("rel", "nofollow");

  
});