function inputHint(cwp) {
  cwp = cwp || new Object();
  var wp = {
    hintColor  : cwp.hintColor  || '#787878',
    valueColor : cwp.valueColor || '#000000',
    hintClass  : cwp.hintClass  || 'hint',
    context    : cwp.context    || document.body
  };
  
  
  var fnFocus = function() {
    if(this.value == this.alt) {
      this.value = '';
    }
    this.style.color = wp.valueColor;
  };
  
  var fnBlur = function() {
    if(this.value == this.alt || !this.value) {
      this.value = this.alt;
      this.style.color = wp.hintColor;
    }
  };
  
  var fnSubmit = function() {
   jQuery('input.' + wp.hintClass, this).each(function() {
        if(this.value == this.alt) {
          this.value = '';
        }
      }) 
  };
  
  var fnInput = function() {
    if(!this.value || this.value == this.alt) {
      this.value = this.alt;
      this.style.color = wp.hintColor;
    }
    else {
      this.style.color = wp.valueColor;
    }
  };
  
  function enableHintFields() {
    var allInputs = jQuery('input.' + wp.hintClass, jQuery(wp.context));
    allInputs.each(fnInput)
             .unbind('focus', fnFocus)
             .unbind('blur', fnBlur)
             .bind('focus', fnFocus)
             .bind('blur', fnBlur)
             .parents('form').unbind('submit', fnSubmit)
                             .bind('submit', fnSubmit);
  }
  enableHintFields();
  return true;
}

//jQuery.fn.inputHint = function(cwp) {
//  return this.each(function() {
//    cwp = cwp || new Object();
//    cwp.context = this;
//    inputHint(cwp);
//  });
//}