(function($) {

	// Define 'setDefaultValue' plugin
	$.fn.setDefaultValue = function(options) {

		var settings = {
			'textValue' : ''
		};

		return this.each(function() {
			// If options exist, lets merge them
			// with our default settings
			if (options) {
				$.extend(settings, options);
			}

			// Gets the jQuery element object
			// Only 'this' is the native DOM element
			var $this = $(this);
			
			// Empty the input
			$this.focus(function() {
				if (this.value == settings.textValue) {
					this.value = "";
				}
			});

			// Set again the default value
			$this.blur(function() {
				if ($.trim(this.value) == "") {
					this.value = settings.textValue;
				}
			});
			
			// Set the default value
			this.value = settings.textValue;

		});

	};
})(jQuery);
