Cufon.replace("h1, h2, h3, h4", {hover: true});
Cufon.replace("#masthead p", { fontFamily: "Gotham Book"});


/* contact */
$(document).ready(function() {
  $("form#contact_us").validateForm();
});

/*
  Form Validation Plugin
  Author: Shane Riley
  Usage: Bind with $("form").validateForm();
         Assign required fields by adding a class of required to each.
         Plugin prepends error message to the form's fieldset and adds a class
         of error to any field that is blank.
  Options: errMsg is a string representing the error message to be displayed.
           errMsgEl is a selector string relative to the form.
*/
(function($)
{
  $.fn.validateForm = function(options)
  {
    var defaults = {
      errMsg: "Please fill out all required fields.",
      errMsgEl: "fieldset"
    };
    opts = $.extend(defaults, options);
    $(this).submit(function()
    {
      var $form = $(this);
      var $required = $(".required", $form);
      var completed = true;
      $required.each(function()
      {
        completed = ($(this).val()) ? true : false;
        (!completed) ? $(this).addClass("error") : $(this).removeClass("error");
      });
      if (!completed)
      {
        $("<p></p>").addClass("error").text(opts.errMsg).prependTo(opts.errMsgEl, $form);
      }
      return completed;
    });
  }
})(jQuery);
