

function formatar(src, mask){

  var i = src.value.length;

  var saida = mask.substring(0,1);

  var texto = mask.substring(i)

if (texto.substring(0,1) != saida)

  {

    src.value += texto.substring(0,1);

  }

}



function valida(){

	

	 nome=document.hoteis.nome.value;

	 email=document.hoteis.email.value;

	 

	 tel_ddd=document.hoteis.telefone_ddd.value;

	 tel=document.hoteis.telefone.value;

	 

	 cidade=document.hoteis.cidade.value;

	 estado=document.hoteis.estado.value;

	 pais=document.hoteis.pais.value;

	 

	 d_c_dia=document.hoteis.data_chegada_dia.value;

	 d_c_mes=document.hoteis.data_chegada_mes.value;

	 d_c_ano=document.hoteis.data_chegada_ano.value;

	

	 d_s_dia=document.hoteis.data_saida_dia.value;

	 d_s_mes=document.hoteis.data_saida_mes.value;

	 d_s_ano=document.hoteis.data_saida_ano.value;

	 

	



marcado = -1

	for (i=0; i<document.hoteis.hotel.length; i++) {

		if (document.hoteis.hotel[i].checked==1) {

			marcado = i

			var a = document.hoteis.hotel[i].value

			break;}

			}



 if(a==null){

	// alert('Selecione um hotel, por favor!');

	//var t14=1;

}



	

			if(d_s_ano=="--"){

		document.hoteis.data_saida_ano.style.background="#FF9900";

			var t13=1;}

			

			if(d_s_mes=="--"){

		document.hoteis.data_saida_mes.style.background="#FF9900";

			var t12=1;}

			

			if(d_s_dia=="--"){

		document.hoteis.data_saida_dia.style.background="#FF9900";

			var t11=1;}

	

			if(d_c_ano=="--"){

		document.hoteis.data_chegada_ano.style.background="#FF9900";

			var t10=1;}

			

			if(d_c_mes=="--"){

		document.hoteis.data_chegada_mes.style.background="#FF9900";

			var t9=1;}

			

			if(d_c_dia=="--"){

		document.hoteis.data_chegada_dia.style.background="#FF9900";

			var t8=1;}

	

	

	

	if(pais==""){

		document.hoteis.pais.focus();

		document.hoteis.pais.style.border="2px solid #FF0000";

			var t7=1;}

	

	if(estado=="--"){

		document.hoteis.estado.style.background="#FF9900";

			var t6=1;}

	

	

	if(cidade==""){

		document.hoteis.cidade.focus();

		document.hoteis.cidade.style.border="2px solid #FF0000";

			var t5=1;}

	

	if(tel==""){

		document.hoteis.telefone.focus();

		document.hoteis.telefone.style.border="2px solid #FF0000";

			var t4=1;}

	

	if(tel_ddd==""){

		document.hoteis.telefone_ddd.focus();

		document.hoteis.telefone_ddd.style.border="2px solid #FF0000";

			var t3=1;}

	

	if(email==""){

		document.hoteis.email.focus();

		document.hoteis.email.style.border="2px solid #FF0000";

			var t2=1;}

	

	if(nome==""){

		document.hoteis.nome.focus();

		document.hoteis.nome.style.border="2px solid #FF0000";

			var t1=1;}

	



	

	

			if(t1== 1 ||

			   t2== 1 ||

			   t3== 1 ||

			   t4== 1 ||

			   t5== 1 ||

			   t6== 1 ||

			   t7== 1 ||

			   t8== 1 ||

			   t9== 1 ||

			   t10== 1 ||

			   t12== 1 ||

			   t13== 1 ){

			

			return false;

				

				}else{

					
h1=document.hoteis.h1_1.value;
h2=document.hoteis.h1_2.value;
h3=document.hoteis.h1_3.value;
h4=document.hoteis.h1_4.value;
h5=document.hoteis.h1_5.value;
h6=document.hoteis.h1_6.value;
h7=document.hoteis.h1_7.value;
h8=document.hoteis.h1_8.value;
h9=document.hoteis.h1_9.value;
h10=document.hoteis.h1_10.value;
h11=document.hoteis.h1_11.value;
h12=document.hoteis.h1_12.value;
h13=document.hoteis.h1_13.value;
h14=document.hoteis.h1_14.value;
h15=document.hoteis.h1_15.value;
h16=document.hoteis.h1_16.value;
h17=document.hoteis.h1_17.value;
h18=document.hoteis.h1_18.value;
h19=document.hoteis.h1_19.value;
h20=document.hoteis.h1_20.value;
h21=document.hoteis.h1_21.value;
h22=document.hoteis.h1_22.value;
h23=document.hoteis.h1_23.value;
h24=document.hoteis.h1_24.value;
h25=document.hoteis.h1_25.value;
h26=document.hoteis.h1_26.value;
h27=document.hoteis.h1_27.value;
h28=document.hoteis.h1_28.value;
h29=document.hoteis.h1_29.value;


total=h1+' - '+h2+' - '+h3+' - '+h4+' - '+h5+' - '+h6+' - '+h7+' - '+h8+' - '+h9+' - '+h10+' - '+h11+' - '+h12+' - '+h13+' - '+h14+' - '+h15+' - '+h16+' - '+h17+' - '+h18+' - '+h18+' - '+h20+' , '+h21+' - '+h22+' - '+h23+' - '+h24+' - '+h25+' - '+h26+' - '+h27+' - '+h28+' - '+h29;
document.hoteis.hotel.value=total;


			return true;

			}

			

	

	}
