/**
 * Clears an input on click, and then replaces default value back again if it wasn't updated from default
 * V0.2 - LR
 */

(function($){

	$.fn.quickClear = function() {
		
		var selectedElements = $(this);
		
		if(! selectedElements)	return false;
		
		// Input click removals
		selectedElements.bind("focus blur",function(e) {
			// Blur
			if(($(this).val() == "") && e.type == "blur") {
				$(this).val($(this).data('defaultValue'));
			}
			// Focus
			if($(this).val() == $(this).data('defaultValue') && e.type == "focus") {
				$(this).val('');
			}
		});		
		
		selectedElements.each(function(){
			$(this).data('defaultValue', $(this).val());
		});	
		
		return selectedElements;
	
	}

})(jQuery);
