// JavaScript Document
var emailFilter = /^.+@.+\..{2,}$/;
var illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\]]/;

function validar_form(form){
	
	switch(form){
		case "contato":
			
				if ($("#nome").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o nome!");
					$("#nome").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
				
				if ($("#email").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o email!");
					$("#email").focus();
					$("#retorno").fadeOut(3000);
					return false;
					
					}
					
					else{
					
					var sEmail = $("#email").val();
					
					if(!(emailFilter.test(sEmail))||sEmail.match(illegalChars)){	
					
					$("#retorno").show();								
					$("#retorno").html("Por favor, verifique o e-mail!"); 
					$("#email").focus();
					$("#retorno").fadeOut(3000); 	 
					return false;
					
					}
				}
		 
				
				if ($("#ddd").val()==""){
					
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o DDD do telefone!");
					$("#ddd").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}

				if ($("#tel").val()==""){
					
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o telefone!");
					$("#tel").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				if ($("#assunto").val()==""){
					
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o assunto!");
					$("#assunto").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				if ($("#mensagem").val()==""){
				
					$("#retorno").show();
					$("#retorno").html("Por favor, informe a mensagem!");
					$("#mensagem").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				return true;
				
		break;
		
		case "reserva":
			
				if ($("#nome").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o nome!");
					$("#nome").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
				
				if ($("#email").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o email!");
					$("#email").focus();
					$("#retorno").fadeOut(3000);
					return false;
					
					}
					
					else{
					
					var sEmail = $("#email").val();
					
					if(!(emailFilter.test(sEmail))||sEmail.match(illegalChars)){	
					
					$("#retorno").show();								
					$("#retorno").html("Por favor, verifique o e-mail!"); 
					$("#email").focus();
					$("#retorno").fadeOut(3000); 	 
					return false;
					
					}
				}
		 
				
				if ($("#ddd").val()==""){
					
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o DDD do telefone!");
					$("#ddd").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}

				if ($("#tel").val()==""){
					
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o telefone!");
					$("#tel").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				if ($("#chegada").val()==""){
					
					$("#retorno").show();
					$("#retorno").html("Por favor, informe a chegada!");
					$("#chegada").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				if ($("#saida").val()==""){
				
					$("#retorno").show();
					$("#retorno").html("Por favor, informe a saída!");
					$("#saida").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				if ($("#criancas").val()==""){
				
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o número de crianças!");
					$("#criancas").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}
				
				if ($("#adultos").val()==""){
				
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o número de adultos!");
					$("#adultos").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}	
				
				if ($("#suite").val()==""){
				
					$("#retorno").show();
					$("#retorno").html("Por favor, informe a suíte!");
					$("#suite").focus();
					$("#retorno").fadeOut(3000); 
					return false;
					}											
				
				return true;
				
		break;
		case "indicacao":
			
				if ($("#de").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o seu nome!");
					$("#de").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
				
				if ($("#emailde").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o seu email!");
					$("#emailde").focus();
					$("#retorno").fadeOut(3000);
					return false;
					
					}
					
					else{
					
					var sEmail = $("#emailde").val();
					
					if(!(emailFilter.test(sEmail))||sEmail.match(illegalChars)){	
					
					$("#retorno").show();								
					$("#retorno").html("Por favor, verifique o e-mail!"); 
					$("#emailde").focus();
					$("#retorno").fadeOut(3000); 	 
					return false;
					
					}
				}
		 
				if ($("#para").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o nome do amigo!");
					$("#para").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
				
				if ($("#emailpara").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o email do amigo!");
					$("#emailpara").focus();
					$("#retorno").fadeOut(3000);
					return false;
					
					}
					
					else{
					
					var sEmail = $("#emailpara").val();
					
					if(!(emailFilter.test(sEmail))||sEmail.match(illegalChars)){	
					
					$("#retorno").show();								
					$("#retorno").html("Por favor, verifique o e-mail do amigo!"); 
					$("#emailpara").focus();
					$("#retorno").fadeOut(3000); 	 
					return false;
					
					}
				}
			
				return true;
				
		break;
		case "news":
		
			 		if ($("#email_news").val()==""){
						
						$("#retorno_news").show();
						$("#retorno_news").html("Por favor, informe o email!");
						$("#email_news").focus();
						$("#retorno_news").fadeOut(3000);
						return false;
						
					}else{					
					
						var sEmail = $("#email_news").val();					
						if(!(emailFilter.test(sEmail))||sEmail.match(illegalChars)){						
							$("#retorno_news").show();								
							$("#retorno_news").html("Por favor, verifique o e-mail!"); 
							$("#email_news").focus();
							$("#retorno_news").fadeOut(3000); 	 
							return false;
						}
					
					}
					
		        return true;
				
		break;
		case "depoimento":
		
		 		if ($("#nome").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o nome!");
					$("#nome").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
				
				if ($("#email").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o email!");
					$("#email").focus();
					$("#retorno").fadeOut(3000);
					return false;
					
					}
					
					else{
					
					var sEmail = $("#email").val();
					
					if(!(emailFilter.test(sEmail))||sEmail.match(illegalChars)){	
					
					$("#retorno").show();								
					$("#retorno").html("Por favor, verifique o e-mail!"); 
					$("#email").focus();
					$("#retorno").fadeOut(3000); 	 
					return false;
					
					}
				}
				
				
		 		if ($("#cidade").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe a cidade!");
					$("#cidade").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
					
				
		 		if ($("#estado").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe o estado!");
					$("#estado").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}	
					
				
		 		if ($("#mensagem").val()==""){
					$("#retorno").show();
					$("#retorno").html("Por favor, informe a mensagem!");
					$("#mensagem").focus();
					$("#retorno").fadeOut(3000);
					return false;
					}
					
						
				return true;
				
		break;
		}
	
	
	}
