jQuery.fn.hint = function() {
 return this.each(function(){
	var t = $(this); // get jQuery version of 'this'
	var title = t.attr('title'); // get it once since it won't change
		
	if (title) { // only apply logic if the element has the attribute		
		// on focus, set value to blank if current value matches title attr
		t.focus(function(){
			if (t.val() == title) {
			  t.val('');
			  t.removeClass('blur');
			}
		})
		// on blur, set value to title attr if text is blank
		t.blur(function(){
			if (t.val() == '') {
			  t.val(title);
			  t.addClass('blur');
			}
		})

		// clear the pre-defined text when form is submitted
		t.parents('form:first()').submit(function(){
			if (t.val() == title) {
				t.val('');
				t.removeClass('blur');
			}
		});
		// now change all inputs to title
		t.blur();
	}
 })				
}

jQuery.fn.labelOver = function(overClass) {
	return this.each(function(){
		var label = jQuery(this);
		var f = label.attr('for');
		if (f) {
			var input = jQuery('#' + f);
			
			this.hide = function() {
			  label.css({ textIndent: -10000 })
			}
			
			this.show = function() {
			  if (input.val() == '') label.css({ textIndent: 0 })
			}

			// handlers
			input.focus(this.hide);
			input.blur(this.show);
		  label.addClass(overClass).click(function(){ input.focus() });
			
			if (input.val() != '') this.hide(); 
		}
	})
}