jQuery.fn.labelOver = function(overClass) {
	return this.each(function(){
		var label = jQuery(this);
		var f = label.attr('for');
		if (f) {
			var input = jQuery('#' + f);
			
			this.hide = function() {
			  label.css({ textIndent: -10000 })
			}
			
			this.show = function() {
			  if (input.val() == '') label.css({ textIndent: 0 })
			}

			// handlers
			input.focus(this.hide);
			input.blur(this.show);
		  label.addClass(overClass).click(function(){ input.focus() });
			
			if (input.val() != '') this.hide(); 
		}
	})
}



/*
It's based on the A List Apart article that demonstrates using a label positioned over the input field.
It's important to enclose the label and input within a div that has the following CSS applied:

DIV { position: relative; float: left; }
LABEL.over-apply { color: #ccc; position: absolute; top: 5px; left: 5px;}

Obviously the top and left will depend on your own CSS, but it's easy to play with in Firbug to get the CSS just right.
Then apply the plugin using:

$('label').labelOver('over-apply')
*/