(function($) {
	$.fn.watermark = function(css, text) {
		return this.each(function() {
			var ibe = $(this), wgf;
			ibe.focus(function() {
				wgf && !(wgf=0) && ibe.removeClass(css).data('wgf',0).val('');
			})
			.blur(function() {
				!ibe.val() && (wgf=1) && ibe.addClass(css).data('wgf',1).val(text);
			})
			.closest('form').submit(function() {
				wgf && ibe.val('');
			});
			ibe.blur();
		});
	};
	$.fn.removeWatermark = function() {
		return this.each(function() {
			$(this).data('wgf') && $(this).val('');
		});
	};
})(jQuery);
