
jQuery.fn.defaultText = function(text) {
	var onBlur = function() {
		if ($(this).val() == "") {
			$(this).val(text)
				.data("defaultTextSet", true);
		}
	};
	var onFocus = function() {
		if ($(this).data("defaultTextSet")) {
			$(this).data("defaultTextSet", null)
				.val("");
		}
	};
	
	this.blur(onBlur).focus(onFocus).blur();
	
	var objs = this;
	$(window).unload(function() { objs.each(onFocus); });
};

