function validaReserva()
{
	with(document.frmreserva)
	{
		if(Nome.value == "")
		{
			alert("Complete el campo nombre.");
			Nome.focus()
			return
		}
		if(SobreNome.value == "")
		{
			alert("Complete el campo apellido.");
			SobreNome.focus()
			return
		}	
		if(Email.value=="" || Email.value.indexOf('@')==-1 || Email.value.indexOf('.')==-1 )
		{
			alert( "¡Complete el campo e-mail correctamente!" );
			Email.focus();
			return;
		}
		if(Telefone.value == "")
		{
			alert("Complete el campo teléfono.");
			Telefone.focus()
			return
		}
		if(Cidade.value == "")
		{
			alert("Preencha o campo Cidade");
			Cidade.focus()
			return
		}	
		if(preferencia1.value == "" && preferencia2.value == "" && preferencia3.value == "")
		{
			alert("Preencha o campo Tipo de pacote");
			Cidade.focus()
			return
		}	
		if(hotels1.value== "" && hotels2.value== "" && hotels3.value== "" && hotels4.value== "" && hotels5.value== "" && hotels6.value== "" && hotels7.value== "" )
		{
			alert("Selecione um Hotel");
			return
		}
		else
		{
			hdnPrimeira.value = 1;
			submit();
		}
	
	}
}


function Mascara (formato, keypress, objeto)
{
	var Result = "";
	var abre = "";
	var fecha = "";
	campo = eval (objeto);
	if (window.event.keyCode < 48 || window.event.keyCode > 57)
	{	
		campo.value = Result;
		return;
	}
	
	//campo = eval (objeto);
	// CEP
	if (formato=='CEP')
	{
		separador = '-'; 
		conjunto1 = 5;
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador;
		}
	}

	// DATA
	if (formato=='DATA')
	{
		separador = '/'; 
		conjunto1 = 2;
		conjunto2 = 5;
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador;
		}
		if (campo.value.length == conjunto2)
		{
			campo.value = campo.value + separador;
		}
	}

	// TELEFONE
	if (formato=='TELEFONE')
	{
		separador = '-'; 
		abre = '(';
		fecha = ')';
		conjunto2 = 2;
		conjunto1 = 8;
		
		if (campo.value.length == conjunto2)
		{
			campo.value = abre + campo.value + fecha;
		}
		
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador;
		}
	}

	// CPF
	if (formato=='CPF')
	{
		separador1 = '.'; 
		separador2 = '-'; 
		conjunto1 = 3;
		conjunto2 = 7;
		conjunto3 = 11;
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador1;
		}
		if (campo.value.length == conjunto2)
		{
			campo.value = campo.value + separador1;
		}
		if (campo.value.length == conjunto3)
		{
			campo.value = campo.value + separador2;
		}
	}

	// CNPJ
	if (formato=='CNPJ')
	{
		separador1 = '.'; 
		separador2 = '/'; 
		separador3 = '-'; 
		conjunto1 = 2;
		conjunto2 = 6;
		conjunto3 = 10;
		conjunto4 = 15;
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador1;
		}
		if (campo.value.length == conjunto2)
		{

			campo.value = campo.value + separador1;
		}
		if (campo.value.length == conjunto3)
		{
			campo.value = campo.value + separador2;
		}
		if (campo.value.length == conjunto4)
		{
			campo.value = campo.value + separador3;
		}
	}
}

function VerificaData(objeto,iCount,NomObj)
{
	var sData = "";

	var campo;
	with(document.frmreserva)
	{
		sData = objeto;
		campo = eval(NomObj);
		
		if (IsDate(sData) == false && sData != "")
		{
			var MSG_0131 = "0131L - Data inválida.";
			alert(MSG_0131);
			campo.value = "";
			campo.focus();
			return;
		}
	}
}

function IsDate (Dado)
{
    var DiasMes = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
    var Dia, Mes, Ano;
    var Result = false;

	// Pré-analisa o String:
	if (Dado != "")
	{
		if ((Dado.length == 10) && (Dado.substr(2,1) == "/") && (Dado.substr(5,1) == "/"))
		{
			// Levanta Campos:
			if (Number (Dado.substr(0,2))) Dia = Dado.substr(0,2);
			if (Number (Dado.substr(3,2))) Mes = Dado.substr(3,2);
			if (Number (Dado.substr(6,4))) Ano = Dado.substr(6,4);

			// Analisa Ano e Mês:
			if ((Ano > 0) && (Mes >= 1) && (Mes <= 12))
			{
				// Analisa Dia:
				if ((Dia >= 1) && (Dia <= DiasMes[Mes - 1]))
				{
					// Analisa os casos não-bissextos:
					if ((Mes == 2) && (!AnoBissexto (Ano)))
					{
						if (Dia <= 28) Result = true;
					}
					else
					{
						Result = true;
					}
				}
			}
		}
	}		
	return Result;
}
/*-----------------------------------------------------------------*
  AnoBissexto 
  Descricao   : Verifica se o ano dado e bissexto   
  Parametros  : Ano a ser verificado (AAAA)               
  Atualizacoes: [00] Versao Inicial    Data: 19/07/2000     Autor: 
 *-----------------------------------------------------------------*/
function AnoBissexto (Ano)
{
	if (((Ano % 4)==0) && ((Ano % 100)!=0) || ((Ano % 400)==0))
		return true;
	else
		return false;
}
function VerificaData(objeto,iCount,NomObj)
{
	var sData = "";
	var campo;
	with(document.frmreserva)
	{
		sData = objeto;
		campo = eval(NomObj);
		
		if (IsDate(sData) == false && sData != "")
		{
			var MSG_0131 = "0131L - Data inválida.";
			alert(MSG_0131);
			campo.value = "";
			campo.focus();
			return;
		}
	}
}














function idioma() {
	var Jan = window.open("../idioma/index.php","Idioma","width=360,height=200");
}


function tour(theURL) {
	window.open(theURL, "Tour","width=540,height=560");
}

function eventos(theURL) {
	window.open(theURL, "Eventos","width=673,height=560,scrollbars=yes");
}

function Mapa() {
	var Jan = window.open("../mapa/index.php","Idioma","width=750,height=475");
}

function Galeria() {
	var Jan = window.open("../galeria/index.php","Idioma","width=540,height=550");
}

function indicagaleria() {
	var Jan = window.open("../enviaamigo/index.php","indicagaleria","width=540,height=250");
}




function showhideBox(obj) {
		var elm = document.getElementById(obj);
		if(elm.className == 'Hidden') {
			elm.className = 'Show';
		}
		for(var i = 1; i <= 27; i++) {
			var ferramenta = 'Faq'+i;
			if( ferramenta != obj ) {
				document.getElementById(ferramenta).className = 'Hidden';
			}
		}
	}
	
	
	
	
	
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function HideMenu() {
	MM_showHideLayers('menu_costa','','hide','menu_ondeficar','','hide','menu_oquefazer','','hide','menu_eventos','','hide')
	clearInterval();
}

setInterval("HideMenu()", 6000);





//************************************//
//************ DROP DOWN *************//
//************************************//


//menu()
function menu()
{
	document.all.nav1.style.display='none'
	document.all.nav2.style.display='none'
	document.all.nav3.style.display='none'
	document.all.nav4.style.display='none'
	document.all.nav5.style.display='none'
	document.all.nav6.style.display='none'
}

<!--
window.onload=exibesubmenu;
function exibesubmenu(id) {

var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('nav'+i))
		{
			document.getElementById('nav'+i).style.display='none';
		}
	}
if (d) {d.style.display='block';}
}
//-->

function some() 
{
	for (var i = 1; i<=10; i++) 
	{
		if (document.getElementById('nav'+i))
		{
			document.getElementById('nav'+i).style.display='none';
		}
	}
}
