/**
 *  jquery.defaultRestore
 *  Author: Karl Payne
 *  (c) 2009 Spiderscope (http://www.spiderscope.com/)
 **/

jQuery.fn.defaultRestore = function(options) {

	return this.each( function () {

		$(this).focus(function() {

			if( !$(this).data("default") ) {
				$(this).data("default", $(this).val() );
			}

			if ( $(this).val() == $(this).data("default") ) {
				$(this).val('');
			}

		});

		$(this).blur(function() {

			if ($(this).val() == '') {
				$(this).val( $(this).data("default") );
			}

		});

	});

};

