jQuery.extend(jQuery.fn, {
	textDefault : function(defaultText, className){
		if(!className)
			className = '';
	
		// Init class
		this.each(function(){
			var inputElement = this;
	
			if($.trim(this.value)==""){
				if(className)
					$(this).addClass(className);
				this.value=defaultText;
			}
			if(this.form){
				$(this.form).bind('submit', function(){
					if ($.trim(inputElement.value) == defaultText) {
						inputElement.value = '';
					}
				});
			}
		});
	
		// Setup events
		this.bind('focus', function(){
			$(this).removeClass(className);
			if ($.trim(this.value) == defaultText) {
				this.value = '';
			}
			if ($.trim(this.value) != defaultText) {
				this.select();
			}
		})
		.bind('blur', function() {
			if ($.trim(this.value) == ''){
				$(this).addClass(className);
				this.value = defaultText;
			}
		});
		return this;
	}
	
});
