(function(jQuery)
{
	jQuery.fn.emptyOnFocus = function()
	{
		return this.each(function()
		{
			if (jQuery(this).attr("type") == "password") 
			{
				jQuery("<input />", {
					type: "text",
					value: jQuery(this).val(),
					className: jQuery(this).get(0).className,
					focus: function()
					{
						jQuery(this).hide();
						jQuery(this).prev("[type=password]").show().focus();
					}
				}).insertAfter(this);
				jQuery(this).hide();
			}
			jQuery(this).attr("title", jQuery(this).val() || "").focus(function()
			{
				if (jQuery(this).hasClass("intro")) 
					jQuery(this).val("").removeClass("intro");
			}).blur(function()
			{
				if (!jQuery(this).val()) 
					if (jQuery(this).attr("type") == "password") 
					{
						jQuery(this).hide();
						jQuery(this).next("[type=text]").show();
					}
					else 
						jQuery(this).addClass("intro").val(jQuery(this).attr("title"));
			}).click(function()
			{
				if (jQuery(this).hasClass("intro")) 
					jQuery(this).val("").removeClass("intro");
			});
			if (jQuery(this).attr("type") == "password") 
				jQuery(this).focus(function()
				{
					jQuery(this).removeClass("intro");
				});
		});
	};
})(jQuery);
