//  http://venture.quantumwebdev.co.uk/scripts/js/jquery.input_tip.js

(function($) {
   $.fn.input_tip = function(settings) {
	var color = 'grey';
     this.each(function() {
    	var select_type = "alt"; 
    	if(!$(this).attr(select_type)) {
    		var select_type = "title";
    	}
		var alt = $(this).attr(select_type);
		var val = $(this).attr("value");
		if(!val) {
			$(this).attr("value", alt);
			$(this).css("color", color);
		}
		
		$(this).click(function(e) {
			var value = $(this).attr("value");
			if(value==alt)$(this).attr("value", "");
		});

		$(this).blur(function(e) {
			var check_val = $(this).attr("value");
			var alt = $(this).attr(select_type);
			if(!check_val) {
				$(this).attr("value", alt);
				$(this).css("color", color);
			} else {
				$(this).css("color", "");
			}
		});
     });
 
     return this;
 
   };
 
 })(jQuery);

