/**
 * ghostText ver 1.0 (18/08/2009)
 *
 * Copyright (c) 2009 Adam Chambers
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 **/

jQuery.fn.ghostText = function(options){
	
	var defaults = {  
		color : "#cccccc"
   	};  
  	var options = $.extend(defaults, options); 
	
	return this.each(function(){
		
		var theValue = $(this).val();
		var theColor = $(this).css('color');
		
		$(this).css('color', options.color);
		
		$(this).focus(function() {
			if($(this).val() == theValue) {
				$(this).css('color', theColor).val("");
			}
		}).blur(function() {
			if($(this).val().length < 1) {
				$(this).css('color', options.color).val(theValue);
			}
		});
	});
}


