	
var inject = {};
(function($)
{
	//Atribui acoes aos objetos passados
	//@author: Pedro Sampaio
	
	inject.input =
	{
		data_replace: function(obj)
		{
			if(!obj)
				obj = $(this);

			obj.each(function()
			{
				val = $(this).val();
				
				if(!val)
				{
					$(this).val($(this).attr('data-default'));
				}
				
				$(this).focus(function()
				{
					if($(this).val() == $(this).attr('data-default'))
					{
						$(this).val('');
					}
					
				}).blur(function()
				{
					if($(this).val() == '')
					{
						$(this).val($(this).attr('data-default'));
					}
				});
			});
		},
		form_replace: function(obj)
		{
			if(!obj)
				obj = $(this);
				
			obj.each(function()
			{
				campos = $(this).find('.replace_default');
				count = campos.length;
				if(count > 0)
				{
					$(this).submit(function(e)
					{
						e.preventDefault();
						campos.each(function()
						{
							if($(this).val() == $(this).attr('data-default'))
							{
								$(this).val('');
							}
						});
						
						$(this).get(0).submit();
					});
				}
			});
		}
	}
})(jQuery);

