(function($) {  
  $.fn.defaultInputValue = function() {
		// Loops over all specified elements and sets default value
		// from the title attribule.
		this.each(function() {
			$(this).val($(this).attr('title'));
			$(this).addClass('defaultValue');
		});
		
		// If the value equals the title
		// it will be cleared when input is clicked.
		$(this).click(function(){
			if ($(this).attr('title') == $(this).val()) {
				$(this).val('');
				$(this).removeClass('defaultValue');
			}
		});
		
		// When input lose its focus
		// and if the value is empty the default text specified in the title
		// will be set as value.
		$(this).blur(function(){
			if ($(this).val() == '') {
				$(this).val($(this).attr('title'));
				$(this).addClass('defaultValue');
			}
		});
		
		$(this).keypress(function(){
			if ($(this).val() != $(this).attr('title')) {
					$(this).removeClass('defaultValue');
			}
		
		});
  };
})(jQuery); 
