jQuery.fn.labelOver = function(overClass)
{
  return this.each(function()
  {
    var label = jQuery(this);
    var f = label.attr('for');
    if (f == undefined)
    {
      return;
    }
    
    var input = jQuery('#' + f);
    var my_this = this;
    
    this.hideLabelForInput = function()
    {
      label.css({ display: 'none' });
    }
    
    this.show = function()
    {
      if (input.val() == '') label.css({ display: 'block' });
    }
    
    // handlers
    input.focus(my_this.hideLabelForInput);
    input.blur(my_this.show);
    label.addClass(overClass).click(my_this.hideLabelForInput);
    
    if (input.val() != '')
    {
      this.hideLabelForInput();
    }
  })
}