/**
 *  jquery.defaultRestore
 *  Author: Karl Payne
 *  (c) 2009 Spiderscope (http://www.spiderscope.com/)
 **/

jQuery.fn.defaultRestore = function(options) {

  settings = jQuery.extend({
     defaultValues: {}
  }, options);


  return this.each( function () {

    $(this).focus(function() {

      if( !settings.defaultValues[ $(this).attr("id") ] ) {
        settings.defaultValues[ $(this).attr("id") ] = $(this).val();
      }

      if ($(this).val() == settings.defaultValues[ $(this).attr("id") ]) {
        $(this).val('');
      }

    });

    $(this).blur(function() {

      if ($(this).val() == '') {
        $(this).val(settings.defaultValues[ $(this).attr("id") ]);
      }

    });

  });

};

