(function($) {
	$.fn.prompt = function(text) {
	
		return $(this).each(function() {
				var root =  $(this);
				var txt = text;
				
				if(!txt) return false;
				
				var promptElement = $('<span />').css({position: 'absolute', top: root.position().top + (root.height() / 2) + 6, left:root.position().left + 3, height: root.height(), width: root.width()}).text(txt).attr('class', 'prompt').appendTo(root.parent());
				
				root.bind('focus click', function(e) {
					promptElement.hide();					
					e.stopPropagation();
				}).bind('blur', function() {
					root.val() ? "" : promptElement.show();					
				});
								
				promptElement.bind('click focus', function(e) {					
					promptElement.hide();
					root.focus();
					e.stopPropagation();
				})
		});
		
	};


})(jQuery);
