(function( $ ){
	$.fn.inputValueHide = function(options) {
		return this.each(function(){
			var settings = {
				'changedClass' : 'changed'
			}

			if (options) { 
				$.extend(settings, options);
			}
		
			var default_value = $(this)[0].defaultValue;
		
			$(this).focus(function() {
				if($(this).data('text') == null || $(this).data('text') == ''){
					$(this).addClass(settings.changedClass);
					$(this).data('text', $(this).val());
					$(this).val('');
				}else if($(this).val() == $(this).data('text')){
					$(this).addClass(settings.changedClass);
					$(this).val('');
				}
			});
			$(this).blur(function() {
				if($(this).val() == ''){
					$(this).removeClass('changed');
					$(this).val($(this).data('text'));
				}
			});
		
			if($(this).val() == ''){
				$(this).val(default_value);
			}else if($(this).val() != default_value){
				$(this).data('text', default_value);
				$(this).addClass(settings.changedClass);
			}
		})
	}
})( jQuery );

