//sets elements to have a default value that is removed when the user types in the input box
jQuery.fn.ghost = function(settings){
	return this.each(function(k,v){
		$(v).blur(function(){
			var val = $.trim($(this).val());

			if(val.length === 0 || val === $(this).attr('default')){
				$(this).val($(this).attr('default')).addClass('default',true);
			}
		}).focus(function(){
			if($(this).hasClass('default')){
				$(this).val('');
				$(this).removeClass('default');
			}
		}).blur();
	});
};

$(document).ready(function(){
	$('input[default]').ghost();
});

