$().ready(function() {

  $.validator.setDefaults({
    highlight: function(input) {
      $(input).addClass("ui-state-highlight");
    },
    unhighlight: function(input) {
      $(input).removeClass("ui-state-highlight");
    }
  });

  // validate signup form on keyup and submit
  $("#contactForm").validate({
    rules: {
      name: {required: true},
      email: { required: true, email: true },
      what:{ required:true },
      project_size:{ required:true },
      budget:{ required:true },
      time_frame:{ required:true },
    },
    messages: {
      name: "*Please enter your name",
      email: "*Please enter a valid email address",
    }
  });

  // a button to click on - starts the ball rolling.
  $("#contact-us")
    .button()
    .click(function() {
      $("#contactForm").dialog('open');
      return false;
    });
  
  // a modal window with the form inside - the ball that rolls.
  $("#contactForm").dialog({
    autoOpen: false,
    width: 575,
    height: 700,
    modal: true,
  });
  
  $("#datepicker").datepicker({
    numberOfMonths: 3,
    showButtonPanel: true
  });

  $("#contact_us:button, #submit_box input:submit, #submit_box input:reset").button();
});

