/**
 * @author 	Peter Riet
 * @copy	Serve it V.O.F. 2010
 */
(function($) {
	$.fn.emptyInputText = function(options) {
		var settings = $.extend({
			text: "",
			className: "empty"
		}, options);

		this.each(function() {
			if (this.value == "" || this.value == settings.text)
				$(this).addClass(settings.className).attr("value", settings.text);
		});		

		return this.bind("focus", function() {
			if (this.value == settings.text) {
				this.value = "";
				$(this).removeClass(settings.className);
			}
		})
		.bind("blur", function() {
			if (this.value == "") {
				$(this).addClass(settings.className);
				this.value = settings.text;
			}
			else
				$(this).removeClass(settings.className);
		});
	};
})(jQuery);
