// JavaScript Document
function vrfreserv(){
 fecha1 = document.getElementById("fecha1").value;
 fecha2 = document.getElementById("fecha2").value;
 errores=''; 
 if( fecha1 == null || fecha1.length == 0 || /^\s+$/.test(fecha1) ) {
  errores+='- Fecha de Llegada.\n'; }
 if( fecha2 == null || fecha2.length == 0 || /^\s+$/.test(fecha2) ) {
  errores+='- Fecha de Salida.\n'; } 
 if(errores!=''){
	alert("Datos Obligatorios:\n"+errores);	
    return false; 	 }
 else{	
	return true;	 }
}

function vrfdatosr(){
 errores=''; 
 mail = document.getElementById("mail").value;
 if( mail == null || mail.length == 0 || /^\s+$/.test(mail) ) {
  errores+='- E-mail.\n'; }
 
 pw = document.getElementById("pw").value;
 if( pw == null || pw.length == 0 || /^\s+$/.test(pw) ) {
  errores+='- Contraseņa.\n'; }
 
 if(errores!=''){
	alert("Datos Obligatorios:\n"+errores);	
    return false; 	 }
 else{	
	return true;	 }
	
}

function vrfregistro(){
 errores=''; 
 
 /**************** DATOS GENERALES******************/
 
 nombre = document.getElementById("nombre").value;
 if( nombre == null || nombre.length == 0 || /^\s+$/.test(nombre) ) {
  errores+='- Nombre de Usuario.\n'; }
  
 apepa = document.getElementById("apepa").value;
 if( apepa == null || apepa.length == 0 || /^\s+$/.test(apepa) ) {
  errores+='- Apellido Paterno de Usuario.\n'; }
  
 apema = document.getElementById("apema").value;
 if( apema == null || apema.length == 0 || /^\s+$/.test(apema) ) {
  errores+='- Apellido Materno de Usuario.\n'; }
  
 
 dia = document.getElementById("dia").selectedIndex;  
 mes = document.getElementById("mes").selectedIndex;  
 year = document.getElementById("year").selectedIndex; 
 if( dia == null || dia == 0 ) {
    errores+='- Dia de Nacimiento.\n'; }
 if( mes == null || mes == 0 ) {
    errores+='- Mes de Nacimiento.\n'; }
 if( year == null || year == 0 ) {
    errores+='- Aņo de Nacimiento.\n'; } 
  
 addres = document.getElementById("addres").value;
 if( addres == null || addres.length == 0 || /^\s+$/.test(addres) ) {
  errores+='- Direccion.\n'; }
  
 colonia = document.getElementById("colonia").value;
 if( colonia == null || colonia.length == 0 || /^\s+$/.test(colonia) ) {
  errores+='- Colonia.\n'; }
  
 ciudad = document.getElementById("ciudad").value;
 if( ciudad == null || ciudad.length == 0 || /^\s+$/.test(ciudad) ) {
  errores+='- Ciudad.\n'; }
  
 edo = document.getElementById("edo").value;
 if( edo == null || edo.length == 0 || /^\s+$/.test(edo) ) {
  errores+='- Estado.\n'; }
  
 cp = document.getElementById("cp").value;
 if( cp == null || cp.length == 0 || /^\s+$/.test(cp) || isNaN(cp) ) {
  errores+='- Codigo Postal Solo #.\n'; } 
  
 tel = document.getElementById("tel").value;
 if( isNaN(tel) ) { errores+='- Telefono solo #.\n'; }
 
 mail = document.getElementById("mail").value;
 if( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(mail)) ) {
  errores+='- E-Mail no Valido.\n'; }
 
 pw1 = document.getElementById("pw1").value;
 pw2 = document.getElementById("pw2").value;
 if( pw1 == null || pw1.length == 0 || /^\s+$/.test(pw1) || pw2 == null || pw2.length == 0 || /^\s+$/.test(pw2) ) {
	errores+='- Contraseņas y Confirmacion.\n'; }
 if( pw1 != pw2) {
	errores+='- Contraseņas y Confirmacion no Son Iguales.\n'; } 	 
 /**************** END DATOS GENERALES******************/
    
  /**************** DATOS GARANTIA******************/
  tarjeta = document.getElementById("tarjeta").selectedIndex;
  if( tarjeta == null || tarjeta == 0 ) {
	  errores+='- No ah Seleccionado una Tarjeta.\n'; }
  trjfac = document.getElementById("trjfac").value;
  if( trjfac == null || trjfac.length == 0 || /^\s+$/.test(trjfac) || isNaN(trjfac) ) {
  errores+='- # de Tarjeta solo numeros sin espacios.\n'; }   
  tarjeta = document.getElementById("tarjeta").selectedIndex;
  if( tarjeta == null || tarjeta == 0 ) {
	  errores+='- No ah Seleccionado Mes de Vencimiento.\n'; } 	
  tarjeta = document.getElementById("tarjeta").selectedIndex;
  if( tarjeta == null || tarjeta == 0 ) {
	  errores+='- No ah Seleccionado Aņo de Vencimiento.\n'; }  
  codefac = document.getElementById("codefac").value;
  if( codefac == null || codefac.length == 0 || /^\s+$/.test(codefac) || isNaN(codefac) ) {
  errores+='- Codigo de la Tarjeta Solo numeros 4 digitos.\n'; }   
  /**************** END DATOS GARANTIA******************/
  
  /**************** DATOS PREFERENCIA******************/
  dat4 = document.getElementById("dat4");
  if( dat4.checked ) {     
   prefac = document.getElementById("prefac").value;
   if( prefac == null || prefac.length == 0 || /^\s+$/.test(prefac) ) {
   errores+='- Indique sus Preferencias.\n'; }      
  }  
  /**************** END DATOS PREFERENCIA******************/
 
 datpol = document.getElementById("datpol"); 
 //alert(datpol);
 if( !datpol.checked )
  { errores+='- Debe Aceptar la Politicas de Servicio & Cancelacion.\n'; }
 //ace1 = document.getElementById("ace1").value;
 //if( !ace1.checked ){ errores+='- Aceptar las Politicas de Servicio.\n'; }
 
 //ace2 = document.getElementById("ace2").value;
 //if( !ace2.checked ){ errores+='- Aceptar las Politicas de Cancelacion.\n'; }
 
 if(errores!=''){
	alert("Datos Obligatorios:\n"+errores);	
    return false; 	 }
 else{	
	return true;	 }	
}
