jQuery.fn.label_fields = function() { 
	return this.each(function(){ 
		if ($(this).val() == '' && $(this).attr('value') == '') {
			$(this).val($(this).attr('title'));
		} else {
			$(this).val($(this).attr('value'));
		}

		$(this)
		.focus(function() {
			if ($(this).val() == $(this).attr('title')) {
				$(this).val('');
			}
		})
		.blur(function() {
			if ($(this).val() == '' && $(this).attr('value') == '') {
				$(this).val($(this).attr('title'));
			} else {
				$(this).val($(this).attr('value'));
			}
		});
	}); 
}; 

jQuery(function() {
	$('input[title],textarea[title]').label_fields();
});
