var libera=0;
function valida(){
  if (document.theform.nome.value==''){
    alert ("Campo nombre es obligatorio");
	 document.theform.nome.focus();
    return false;
    libera=1;
  }

/*  if (document.theform.empresa.value==''){
    alert ("Campo empresa obligatorio");
	 document.theform.empresa.focus();
    return false;
    libera=1;
  }*/
  if (document.theform.morada.value==''){
    alert ("Campo dirección obligatorio");
	 document.theform.morada.focus();
    return false;
    libera=1;
  }
 
  if (document.theform.cp.value==''){
   alert ("Campo C.Postal obligatorio");
   document.theform.cp.focus();
    return false;
    libera=1;
 }

  
  if (document.theform.localidade.value==''){
    alert ("Campo localidad obligatorio");
	 document.theform.localidade.focus();
    return false;
    libera=1;
  }


  if (document.theform.telefone.value==''){
    alert ("Campo telefono obligatorio");
	 document.theform.telefone.focus();
    return false;
    libera=1;
  }


  if (document.theform.email.value.indexOf("@")==-1) {
    alert ("Esta dirección de correo no es válida");
	 document.theform.email.focus();
    return false;
    libera=1;
  }


  if (document.theform.pais.value==''){
    alert ("Campo pais obligatorio");
	 document.theform.pais.focus();
    return false;
    libera=1;
  }

   if (document.theform.quartosM.value==''){
    alert ("Campo Cantidad obligatorio");
	 document.theform.quartosM.focus();
    return false;
    libera=1;
  }
    
		
//////////////////////////////		
if(libera==0)
document.theform.btsubmit.enabled=false;
document.theform.submit();
//document.getElementById("btsubmit");
}


function check() {
if(document.formData.dataEnt.value=='') {
			window.alert('Indique la fecha de entrada!');
			document.formData.dataEnt.focus();
			return false;
		}
		
		if(document.formData.dataSaid.value=='') {
			window.alert('Indique la fecha de salida!');
			document.formData.dataSaid.focus();
			return false;
		}
		
		 if (document.formData.tipoq.value==''){
         alert ("Indique el tipo de cuarto!");
         return false;
    
  }

		
		
		
		
}

////////////////lock button////////////////
/* var submitted = 0;
    function LockButton ()
       {
       var ret = false;
       if ( ! submitted )
          {
           var item = document.getElementById("btsubmit");
           if (item != null)
             {
             setTimeout(function() {item.disabled = true}, 0);
             }
           submitted = 1;
           ret = true;
          }
        return ret;
        }*/
		
/////		




