/**
 *	JQuery LabelOver plugin by Union Room Ltd - http://www.unionroom.com/
 *	
 *	@author: Jon Park
 *	@version: 1.0.0
 *	@created: May 11th, 2009
 */
jQuery.fn.labelOver = function() {
	this.each(function() {
		var $label = $(this);
		var $target = $('#' + $label.attr('for'));
		
		$label.css({ width: '0px', height: '0px', overflow: 'hidden', display: 'block' }).addClass('overlaid');
		if ($target.val() == '') { $target.val($label.html()); }
		$target
			.bind('focus', function($e) {
				var $thisLabel = $('label[for=' + $(this).attr('id') + ']');
				if ($(this).val() == $thisLabel.html()) { 
					$(this).val('');
				}
			})
			.bind('blur', function($e) {
				var $thisLabel = $('label[for=' + $(this).attr('id') + ']');
				if ($(this).val() == '') { 
					$(this).val($thisLabel.html());
				}
			});
	});
}
