// JavaScript Document
// Autor: Rafael Fernando
// Versão: 1.0

	$(function(){
		$.fn.textinput = function(settings){
			 var defaults = {
				color: '#CCCCCC'
			}
			
			settings = $.extend(defaults, settings);
	
			this.each(function () {
				$(this).attr("style","text-align:center");
				
				if(($.trim($(this).val())!='' && $(this).val()==$(this).attr("title")) || $(this).val()==''){ 
					$(this).attr("style","color:"+settings.color+";text-align:center");
					$(this).val($(this).attr("title"));				
				}
				
				$(this).focus(function(){
					if($.trim($(this).val())!='' && $(this).val()==$(this).attr("title")){
						$(this).val('');
						$(this).attr("style","color:default;text-align:center");
					}
				});
				
				$(this).blur(function(){
					if($.trim($(this).val())==''){
						$(this).val($(this).attr("title"));
						$(this).attr("style","color:"+settings.color+";text-align:center");
					}
				});				
			});
		}
	});	 
