/*
 * inputDefault jQuery Plugin by Olop
 * http://oliodesign.co.uk/
 *
 * Copyright (c) 2009 Olio
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-06-18 20:34:21 +0000
 */

(function($){
 $.fn.inputDefault = function(options) {

   var defaults = {
     defaultColor: '#555',
     activeColor: '#000'
   }

   var options = $.extend(defaults, options);

  return this.each(function() {
       
    
    var def=$(this).attr('value');
    
    $(this).css('color',options.defaultColor);
    
    $(this).focus(function() {
      if($(this).attr('value') == def){
        $(this).attr('value','');
        $(this).css('color',options.activeColor);
      }
    });
    
    $(this).blur(function() {
      if($(this).attr('value').length ==0){
        $(this).attr('value',def);
        $(this).css('color',options.defaultColor);
      }
    });
    
    
  });
 };
})(jQuery);
