String.prototype.trim=function(){
    return this.replace(/^\s*|\s*$/g,'');
}

String.prototype.ltrim=function(){
    return this.replace(/^\s*/g,'');
}

String.prototype.rtrim=function(){
    return this.replace(/\s*$/g,'');
}


$(document).ready(function () {
	$("input[type='text']").each(function () {
		var save = $(this).attr("value").trim();
		$(this).attr("save",save);
	});
	
	$("input[type='text']").focus(function () {
		var save = $(this).attr("save");
		if ($(this).attr("value").trim() == save)
		{
			$(this).attr("value","");
		}
	});

	$("input[type='text']").blur(function () {
		if ($(this).attr("value").trim() == '')
		{
			var save = $(this).attr("save");
			$(this).attr("value",save);
		}
	
	});
});