// jQuery watermark plugin
// by Andrew Thompson
// clears a textbox on focus if it still contains its original text,
// and restores the original text on blur if left blank
// usage example: 
// $('.search-box').watermark();
jQuery.fn.watermark = function() {
	$(this).each(function() {
		var orig = $(this).attr('value');
		$(this).focus(function() {
			var curr = $(this).attr('value');
			if (curr == orig) $(this).attr('value', '');
		});
		$(this).blur(function() {
			var curr = $(this).attr('value');
			if (curr == '') $(this).attr('value', orig);
		});
	});
};

