// a field clicked function
jQuery.fn.fieldFocusClear = function() {

  // focus
  this.focus(function() {
    // prevent multiple lookups
    $field = jQuery(this);

    // check if the field has been clicked
    if (!$field.hasClass('fieldClicked')) {

      // add the field clicked class
      $field.addClass('fieldClicked');

      // clear the name field
      $field.val('');

    }
  });

  // blur
  this.blur(function() {
    // prevent multiple lookups
    $field = jQuery(this);

    // if empty, return to default
    if ($field.val() == '') {
      // remove clicked class
      $field.removeClass('fieldClicked');

      // make default value
      $field.val(this.defaultValue);
    }
  });

}

// once the DOM is ready, add in our events
jQuery(document).ready(function() {

  // add a focus clear function onto the input fields
  jQuery("#s").fieldFocusClear();

  // rotate images
  jQuery("#rotimages").innerfade({ speed: 800, timeout: 7000, type: 'random_start', containerheight: 235 });

});
