// JavaScript Document

<!--

// ********* Seccion para abrir ventanas ********
function abreOnLine(){
	var ventana = null;
	ventana = window.open('online_aux.html','','toolbar=no,height=465,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');
}

function enviaChecaHorario(){
	document.frm_bienvenido.action="checaHorario.php";
	document.frm_bienvenido.submit();			
}


function abreRegistroUsuario(){	
	window.close();  //cerramos la ventana de registro actual.
	var ventana = null;
	ventana = window.open('registrousuario.html','','toolbar=no,height=600,width=480,top=100,left=250,status=no,scrollbars=no,menubar=no');
}


function abreNuestraCarta(){
	var ventana = null;
	ventana = window.open('nuestracarta.html','','toolbar=no,height=510,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');
}

function abreContactanos(){
	var ventana = null;
	ventana = window.open('contactanos.html','','toolbar=no,height=450,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');		
	window.status="< cargando sitio ... >";
}



function abreOlvido(){	
	//window.close();  
	var ventana = null;
	ventana = window.open('olvido.html','','toolbar=no,height=465,width=400,top=100,left=250,status=no,scrollbars=no,menubar=no');
}



//**validar acceso para el olvido de contraseña
function validaAccesoOlv(){
	//Funcion valida acceso olvido contraseña
	
	var usua=document.frm_olvido.txtUsur.value;
	var pass=document.frm_olvido.txtCve.value;
	var combo=document.frm_olvido.olvido_cmbPregunta.value;
	
	if(usua=="" || usua ==null){
		alert("Escribe el usuario");	
		document.frm_olvido.txtUsur.focus();
		return;
	}
	if(combo==0){
		alert("Seleccione una pregunta");	
		return;
	}
	
	if(pass=="" || pass ==null){
		alert("Escribe la respuesta a tu pregunta");	
		document.frm_olvido.txtCve.focus();
		return;
	}
	
	document.frm_olvido.submit();	
}//fin validaAcceso de olvido contraseña


function validaAccesoPa(){
	//Funcion valida acceso nuevo password
	var passN=document.frm_olvido1.passNue.value;
	var passC=document.frm_olvido1.passCon.value;
	if(passN=="" || passN ==null){
		alert("Escribe el nuevo password");	
		document.frm_olvido1.passNue.focus();
		return;
	}
	
	if(passC=="" || passC ==null){
		alert("Confirma el nuevo password");	
		document.frm_olvido1.passCon.focus();
		return;
	}
	
	if(passC == passN){
		document.frm_olvido1.submit();	
	}else{
		alert("*** EL PASSWORD Y CONFIRMA PASSWORD DEBEN SER IGUALES ***");
		document.frm_olvido1.passNue.value="";
		document.frm_olvido1.passCon.value="";
		document.frm_olvido1.passNue.focus();
		return;
	}
	
}//fin validaAcceso de nuevo password





function abreOpCarta(ban){
	var ventana = null;
	switch(ban){
		case 1:
			ventana = window.open('cartaentradas.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 2:
			ventana = window.open('cartasopas.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 3:
			ventana = window.open('cartaarroz.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 4:
			ventana = window.open('cartaensaladas.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 5:
			ventana = window.open('cartapastas.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 6:
			ventana = window.open('cartateppanyakis.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 7:
			ventana = window.open('cartatempuras.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 8:
			ventana = window.open('cartaempanizados.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 9:
			ventana = window.open('cartamenumakis.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 10:
			ventana = window.open('cartatemakis.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 11:
			ventana = window.open('cartasashimis.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 12:
			ventana = window.open('cartasushi.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;

		case 13:
			ventana = window.open('cartapostres.html','','toolbar=no,height=510,width=390,top=150,left=250,status=no,scrollbars=no,menubar=no');
			break;
	}//fin switch	
}//fin abreOpCarta


function enviaEncuesta(ban){	
	switch(ban){
		case 1:		//ENCUENSTA RESTAURANTE	
		
			if(!document.Frm_Enc_Res.restaurante_pre1[0].checked && !document.Frm_Enc_Res.restaurante_pre1[1].checked){
				alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			if(!document.Frm_Enc_Res.restaurante_pre2[0].checked && !document.Frm_Enc_Res.restaurante_pre2[1].checked){
				alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			
			if(!document.Frm_Enc_Res.restaurante_pre3[0].checked && !document.Frm_Enc_Res.restaurante_pre3[1].checked){
				alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
		
			if(!document.Frm_Enc_Res.restaurante_pre4[0].checked && !document.Frm_Enc_Res.restaurante_pre4[1].checked){
				alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
		
			if(!document.Frm_Enc_Res.restaurante_pre5[0].checked && !document.Frm_Enc_Res.restaurante_pre5[1].checked){
				alert("*** LA PREGUNTA 5 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			if(!document.Frm_Enc_Res.restaurante_pre6[0].checked && !document.Frm_Enc_Res.restaurante_pre6[1].checked && !document.Frm_Enc_Res.restaurante_pre6[2].checked){
				alert("*** LA PREGUNTA 6 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			if(!document.Frm_Enc_Res.restaurante_pre7[0].checked && !document.Frm_Enc_Res.restaurante_pre7[1].checked){
				alert("*** LA PREGUNTA 7 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
		
			document.Frm_Enc_Res.action="encuesta_servrest.php";
			document.Frm_Enc_Res.submit();	
			break;
			
			
		case 2:		//ENCUENSTA PLATILLOS
		
			if(!document.Frm_Enc_Pla.platillos_pre1[0].checked && !document.Frm_Enc_Pla.platillos_pre1[1].checked && !document.Frm_Enc_Pla.platillos_pre1[2].checked){
				alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
		
			if(!document.Frm_Enc_Pla.platillos_pre2[0].checked && !document.Frm_Enc_Pla.platillos_pre2[1].checked && !document.Frm_Enc_Pla.platillos_pre2[2].checked){
				alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
		
			if(!document.Frm_Enc_Pla.platillos_pre3[0].checked && !document.Frm_Enc_Pla.platillos_pre3[1].checked && !document.Frm_Enc_Pla.platillos_pre3[2].checked){
				alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			if(!document.Frm_Enc_Pla.platillos_pre4[0].checked && !document.Frm_Enc_Pla.platillos_pre4[1].checked && !document.Frm_Enc_Pla.platillos_pre4[2].checked){
				alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			if(!document.Frm_Enc_Pla.platillos_pre5[0].checked && !document.Frm_Enc_Pla.platillos_pre5[1].checked && !document.Frm_Enc_Pla.platillos_pre5[2].checked){
				alert("*** LA PREGUNTA 5 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
		
			if(!document.Frm_Enc_Pla.platillos_pre6[0].checked && !document.Frm_Enc_Pla.platillos_pre6[1].checked && !document.Frm_Enc_Pla.platillos_pre6[2].checked){
				alert("*** LA PREGUNTA 6 NO DEBE QUEDAR SIN RESPUESTA ***");
				return;					
			}
			
			document.Frm_Enc_Pla.action="encuesta_platillos.php";
			document.Frm_Enc_Pla.submit();	
			break;
			
		
		
		case 3:   //ENCUENSTA DOMICILIO		
		
				if(!document.Frm_Enc_Dom.domicilio_preg1[0].checked && !document.Frm_Enc_Dom.domicilio_preg1[1].checked && !document.Frm_Enc_Dom.domicilio_preg1[2].checked){
					alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
				
				if(!document.Frm_Enc_Dom.domicilio_preg2[0].checked && !document.Frm_Enc_Dom.domicilio_preg2[1].checked && !document.Frm_Enc_Dom.domicilio_preg2[2].checked){
					alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
				
				if(!document.Frm_Enc_Dom.domicilio_preg3[0].checked && !document.Frm_Enc_Dom.domicilio_preg3[1].checked && !document.Frm_Enc_Dom.domicilio_preg3[2].checked){
					alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
				
				if(!document.Frm_Enc_Dom.domicilio_preg4[0].checked && !document.Frm_Enc_Dom.domicilio_preg4[1].checked ){
					alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
				if(!document.Frm_Enc_Dom.domicilio_preg5[0].checked && !document.Frm_Enc_Dom.domicilio_preg5[1].checked ){
					alert("*** LA PREGUNTA 5 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
				if(!document.Frm_Enc_Dom.domicilio_preg6[0].checked && !document.Frm_Enc_Dom.domicilio_preg6[1].checked && !document.Frm_Enc_Dom.domicilio_preg6[2].checked){
					alert("*** LA PREGUNTA 6 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
				if(!document.Frm_Enc_Dom.domicilio_preg7[0].checked && !document.Frm_Enc_Dom.domicilio_preg7[1].checked && !document.Frm_Enc_Dom.domicilio_preg7[2].checked){
					alert("*** LA PREGUNTA 7 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
				if(!document.Frm_Enc_Dom.domicilio_preg8[0].checked && !document.Frm_Enc_Dom.domicilio_preg8[1].checked && !document.Frm_Enc_Dom.domicilio_preg8[2].checked){
					alert("*** LA PREGUNTA 8 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
			
				document.Frm_Enc_Dom.action="encuesta_domicilio.php";
				document.Frm_Enc_Dom.submit();			
				break;
				
				
				
			case 4:		//ENCUENSTA UBICACIONES
			
				if(!document.Frm_Enc_Ubi.ubicaciones_pre1[0].checked && !document.Frm_Enc_Ubi.ubicaciones_pre1[1].checked){
					alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
				
				if(!document.Frm_Enc_Ubi.ubicaciones_pre2[0].checked && !document.Frm_Enc_Ubi.ubicaciones_pre2[1].checked && !document.Frm_Enc_Ubi.ubicaciones_pre2[2].checked){
					alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
				
				if(document.Frm_Enc_Ubi.ubicaciones_pre3.value == "" ){
					alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;				
				}
			
				if(!document.Frm_Enc_Ubi.ubicaciones_pre4[0].checked && !document.Frm_Enc_Ubi.ubicaciones_pre4[1].checked && !document.Frm_Enc_Ubi.ubicaciones_pre4[2].checked){
					alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
				if(!document.Frm_Enc_Ubi.ubicaciones_pre5[0].checked && !document.Frm_Enc_Ubi.ubicaciones_pre5[1].checked && !document.Frm_Enc_Ubi.ubicaciones_pre5[2].checked){
					alert("*** LA PREGUNTA 5 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
				}
			
			if(!document.Frm_Enc_Ubi.ubicaciones_pre6[0].checked && !document.Frm_Enc_Ubi.ubicaciones_pre6[1].checked) {
					alert("*** LA PREGUNTA 6 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
			
			if(!document.Frm_Enc_Ubi.ubicaciones_pre7[0].checked && !document.Frm_Enc_Ubi.ubicaciones_pre7[1].checked && !document.Frm_Enc_Ubi.ubicaciones_pre7[2].checked){
					alert("*** LA PREGUNTA 7 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
		
			document.Frm_Enc_Ubi.action="encuesta_ubicaciones.php";
			document.Frm_Enc_Ubi.submit();
			break;
			
			
		case 5:	//ENCUENSTA INSTALACIONES	 
			if(!document.Frm_Enc_Ins.instalaciones_pre1[0].checked && !document.Frm_Enc_Ins.instalaciones_pre1[1].checked && !document.Frm_Enc_Ins.instalaciones_pre1[2].checked){
					alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
		
			if(!document.Frm_Enc_Ins.instalaciones_pre2[0].checked && !document.Frm_Enc_Ins.instalaciones_pre2[1].checked && !document.Frm_Enc_Ins.instalaciones_pre2[2].checked){
					alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}

			if(!document.Frm_Enc_Ins.instalaciones_pre3[0].checked && !document.Frm_Enc_Ins.instalaciones_pre3[1].checked && !document.Frm_Enc_Ins.instalaciones_pre3[2].checked){
					alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}

			if(!document.Frm_Enc_Ins.instalaciones_pre4[0].checked && !document.Frm_Enc_Ins.instalaciones_pre4[1].checked && !document.Frm_Enc_Ins.instalaciones_pre4[2].checked){
					alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}

			if(!document.Frm_Enc_Ins.instalaciones_pre5[0].checked && !document.Frm_Enc_Ins.instalaciones_pre5[1].checked ){
					alert("*** LA PREGUNTA 5 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}

			if(!document.Frm_Enc_Ins.instalaciones_pre6[0].checked && !document.Frm_Enc_Ins.instalaciones_pre6[1].checked ){
					alert("*** LA PREGUNTA 6 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}

			if(!document.Frm_Enc_Ins.instalaciones_pre7[0].checked && !document.Frm_Enc_Ins.instalaciones_pre7[1].checked && !document.Frm_Enc_Ins.instalaciones_pre7[2].checked){
					alert("*** LA PREGUNTA 7 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
		
			document.Frm_Enc_Ins.action="encuesta_instalaciones.php";
			document.Frm_Enc_Ins.submit();
			break;
		
		
		case 6:   //ENCUENSTA CLIENTES	
		
			if(!document.Frm_Enc_Cliente.clientes_preg1[0].checked && !document.Frm_Enc_Cliente.clientes_preg1[1].checked && !document.Frm_Enc_Cliente.clientes_preg1[2].checked){
						alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}
		
			if(!document.Frm_Enc_Cliente.clientes_preg2[0].checked && !document.Frm_Enc_Cliente.clientes_preg2[1].checked ){
					alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}

//document.formul.miSelect.options[indice].value 
//document.Frm_Enc_Cliente.clientes_preg5.selectedIndex

			if(document.Frm_Enc_Cliente.clientes_preg3.options[document.Frm_Enc_Cliente.clientes_preg3.selectedIndex].value == "0"){
						alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
						document.Frm_Enc_Cliente.clientes_preg3.focus();
						return;					
				}


			if(document.Frm_Enc_Cliente.clientes_preg4.options[document.Frm_Enc_Cliente.clientes_preg4.selectedIndex].value == "0"){
						alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
						document.Frm_Enc_Cliente.clientes_preg4.focus();
						return;					
				}


			if(!document.Frm_Enc_Cliente.clientes_preg5[0].checked && !document.Frm_Enc_Cliente.clientes_preg5[1].checked && !document.Frm_Enc_Cliente.clientes_preg5[2].checked){
						alert("*** LA PREGUNTA 5 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}

			if(!document.Frm_Enc_Cliente.clientes_preg6[0].checked && !document.Frm_Enc_Cliente.clientes_preg6[1].checked && !document.Frm_Enc_Cliente.clientes_preg6[2].checked){
						alert("*** LA PREGUNTA 6 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}

				if(document.Frm_Enc_Cliente.clientes_preg7.value==""){
						alert("*** LA PREGUNTA 7 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}

		
				if(!document.Frm_Enc_Cliente.clientes_preg8[0].checked && !document.Frm_Enc_Cliente.clientes_preg8[1].checked && !document.Frm_Enc_Cliente.clientes_preg8[2].checked){
						alert("*** LA PREGUNTA 8 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}

		
				if(!document.Frm_Enc_Cliente.clientes_preg9[0].checked && !document.Frm_Enc_Cliente.clientes_preg9[1].checked && !document.Frm_Enc_Cliente.clientes_preg9[2].checked){
						alert("*** LA PREGUNTA 9 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}

				if(document.Frm_Enc_Cliente.clientes_preg10.value==""){
						alert("*** LA PREGUNTA 10 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}


			if(!document.Frm_Enc_Cliente.clientes_preg11[0].checked && !document.Frm_Enc_Cliente.clientes_preg11[1].checked){
						alert("*** LA PREGUNTA 11 NO DEBE QUEDAR SIN RESPUESTA ***");
						return;					
				}

			if(document.Frm_Enc_Cliente.clientes_preg11[0].checked){

					if(document.Frm_Enc_Cliente.clientes_preg12.value==""){
								alert("*** EL NOMBRE NO DEBE ESTAR VACIO ***");
								document.Frm_Enc_Cliente.clientes_preg12.focus();
								return;					
					}
		
					if(document.Frm_Enc_Cliente.clientes_preg13.value==""){
								alert("*** EL APELLIDO PATERNO NO DEBE ESTAR VACIO ***");
								document.Frm_Enc_Cliente.clientes_preg13.focus();
								return;					
					}
					
					if(document.Frm_Enc_Cliente.clientes_preg14.value==""){
								alert("*** EL APELLIDO MATERNO NO DEBE ESTAR VACIO ***");
								document.Frm_Enc_Cliente.clientes_preg14.focus();
								return;					
					}
		
					if(document.Frm_Enc_Cliente.clientes_preg15.options[document.Frm_Enc_Cliente.clientes_preg15.selectedIndex].value == "0"){
								alert("*** ELIGE EL DIA DEL CUMPLEAÑOS ***");
								document.Frm_Enc_Cliente.clientes_preg15.focus();
								return;					
					}
		
					if(document.Frm_Enc_Cliente.clientes_preg16.options[document.Frm_Enc_Cliente.clientes_preg16.selectedIndex].value == "0"){
								alert("*** ELIGE EL MES DEL CUMPLEAÑOS ***");
								document.Frm_Enc_Cliente.clientes_preg16.focus();
								return;					
					}
		
	
					if(document.Frm_Enc_Cliente.clientes_preg17.value==""){
							alert("*** EL CORREO NO DEBE ESTAR VACIO ***");
							document.Frm_Enc_Cliente.clientes_preg17.focus();
							return;					
					}
	
					
					if(!parseEmail(document.Frm_Enc_Cliente.clientes_preg17,"CORREO")){
						document.Frm_Enc_Cliente.clientes_preg17.focus();
						return;
					}

			}else{
				//Habilitamos los campos complementarios y los icializamos con blancos	
				document.Frm_Enc_Cliente.clientes_preg12.value="";	
				document.Frm_Enc_Cliente.clientes_preg13.value="";	
				document.Frm_Enc_Cliente.clientes_preg14.value="";			
				document.Frm_Enc_Cliente.clientes_preg15.selectedIndex = 0;
				document.Frm_Enc_Cliente.clientes_preg16.selectedIndex = 0;
				document.Frm_Enc_Cliente.clientes_preg17.value="";	
				document.Frm_Enc_Cliente.clientes_preg12.disabled=false;
				document.Frm_Enc_Cliente.clientes_preg13.disabled=false;
				document.Frm_Enc_Cliente.clientes_preg14.disabled=false;
				document.Frm_Enc_Cliente.clientes_preg15.disabled=false;
				document.Frm_Enc_Cliente.clientes_preg16.disabled=false;
				document.Frm_Enc_Cliente.clientes_preg17.disabled=false;	
			}
		
			document.Frm_Enc_Cliente.action="encuesta_pcliente.php";
			document.Frm_Enc_Cliente.submit();				
			break;
			
			
			case 7:   //ENCUESTA OPINION			
			
			
			if(!document.frm_opinion.opinion_pre1[0].checked && !document.frm_opinion.opinion_pre1[1].checked && !document.frm_opinion.opinion_pre1[2].checked){
					alert("*** LA PREGUNTA 1 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
			
			if(!document.frm_opinion.opinion_pre2[0].checked && !document.frm_opinion.opinion_pre2[1].checked && !document.frm_opinion.opinion_pre2[2].checked){
					alert("*** LA PREGUNTA 2 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
			
			if(!document.frm_opinion.opinion_pre3[0].checked && !document.frm_opinion.opinion_pre3[1].checked && !document.frm_opinion.opinion_pre3[2].checked){
					alert("*** LA PREGUNTA 3 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
			
			
			if(!document.frm_opinion.opinion_pre4[0].checked && !document.frm_opinion.opinion_pre4[1].checked){
					alert("*** LA PREGUNTA 4 NO DEBE QUEDAR SIN RESPUESTA ***");
					return;					
			}
			
			
			
			document.frm_opinion.action="encuesta_opinion.php";
			document.frm_opinion.submit();								
			break;			
	}//fin switch	
}//fin enviaEncuesta



function abreMakis(ban){
	switch(ban){
		case 1:		
			document.frm_makis.action="makistradicionales.html";
			document.frm_makis.submit();	
			break;
		case 2:		
			document.frm_makis.action="makisempanizados.html";
			document.frm_makis.submit();	
			break;
		case 3:		
			document.frm_makis.action="makiscapeados.html";
			document.frm_makis.submit();			
			break;
		case 4:		
			document.frm_makis.action="makispicositos.html";
			document.frm_makis.submit();
			break;
		case 5:		
			document.frm_makis.action="makiscubiertaespecial.html";
			document.frm_makis.submit();
			break;
		case 6:
			document.frm_makis.action="makisespeciales.html";
			document.frm_makis.submit();				
			break;
	}//fin switch	
}//fin abreMakis


function abreEquipo(ban){
	switch(ban){
		case 1:	
			document.frm_home.action="nuestroequipo.php";
			document.frm_home.submit();	
			break;
		case 2:
			document.frm_conocenos.action="nuestroequipo.php";
			document.frm_conocenos.submit();	
			break;
		case 3:
			document.frm_ubicaciones.action="nuestroequipo.php";
			document.frm_ubicaciones.submit();	
			break;
		case 4:
			document.frm_paseos.action="nuestroequipo.php";
			document.frm_paseos.submit();	
			break;	
		case 5:
			document.frm_eventos.action="nuestroequipo.php";
			document.frm_eventos.submit();	
			break;		
		case 6:
			document.frm_wallpaper.action="nuestroequipo.php";
			document.frm_wallpaper.submit();	
			break;	
		case 7:
			document.frm_cultura.action="nuestroequipo.php";
			document.frm_cultura.submit();	
			break;
		case 8:
			document.frm_equipo.action="nuestroequipo.php";
			document.frm_equipo.submit();	
			break;	
	}//fin switch	
}//fin abreEquipo



//++++++++++++  Funciones para la validación de los datos de nuerto equipo  ++++++++++++++++

function enviaInfoEquipo(){
	
	
	
	if(document.frm_equipo.cmbUnidad.value=="0"){
			alert("*** SELECCIONA UNIDAD ***");					
			document.frm_equipo.cmbUnidad.focus();
			return;		
	}
	
	
	if(document.frm_equipo.cmbPuesto.value=="0"){
			alert("*** SELECCIONA PUESTO ***");					
			document.frm_equipo.cmbPuesto.focus();
			return;		
	}
	
	document.frm_equipo.txtNom.value=TrimLR(document.frm_equipo.txtNom.value);	
	if (document.frm_equipo.txtNom.value=="") {
		alert("*** CAPTURA EL NOMBRE ***");
		document.frm_equipo.txtNom.focus();
		return;
	}  	
	
	if(!parseAZ(document.frm_equipo.txtNom,"NOMBRE")){
		document.frm_equipo.txtNom.focus();
		return;
	}
	
	
	if(TrimLR(document.frm_equipo.txtTel.value)=="" && document.frm_equipo.txtCorreo.value == "@"){
		alert("*** Es necesario un medio de contacto ***");
		document.frm_equipo.txtTel.focus();
		return;
	}
	
	
	//if (document.frm_equipo.txtTel.value=="") {
	//	alert("*** CAPTURA EL TELEFONO ***");
	//	document.frm_equipo.txtTel.focus();
	//	return;
	//}  	
	
	if(document.frm_equipo.txtTel.value.length < 10 && !TrimLR(document.frm_equipo.txtTel.value)=="" ){
		alert("*** El formato del teléfono es incorrecto, 3 digitos lada y 7 digitos teléfono ***");
		document.frm_equipo.txtTel.focus();
		return;		
	}
		
	
	document.frm_equipo.txtCorreo.value=TrimLR(document.frm_equipo.txtCorreo.value);	
	if(!(document.frm_equipo.txtCorreo.value=="@")  || (!(document.frm_equipo.txtCorreo.value=="") && TrimLR(document.frm_equipo.txtTel.value)=="")){
		if(!parseEmail(document.frm_equipo.txtCorreo,"CORREO")){
			document.frm_equipo.txtCorreo.focus();
			return;
		}
	}
	
	
	
	//alert("SU INFORMACIÓN HA SIDO ENVIADA, EN BREVE NOS COMUNICAREMOS CON USTED\n\n Sushi yen's AGRADECE SU PREFERENCIA");
	//document.frm_equipo.reset();
	document.frm_equipo.action="guarda_nuestroequipo.php";
	document.frm_equipo.submit();
}//fin enviaInfoEquipo




function js_validarNumTel(e){
var charCode
	if (navigator.appName == "Netscape") {
		charCode = e.which; 
	}
	else {
		charCode = e.keyCode;
	}	
	
	switch(charCode){
		case 8:
		case 32:	
		case 37:	
		case 39:
		case 46:
		case 48:
		case 49:
		case 50:
		case 51:
		case 52:
		case 53:
		case 54:
		case 55:
		case 56:
		case 57:
		case 189:			
			return true;
			break;		
		default:			
			return false;		
	}	
	
}

function js_validarNumLada(e){
var charCode
	if (navigator.appName == "Netscape") {
		charCode = e.which; 
	}
	else {
		charCode = e.keyCode;
	}
	switch(charCode){
		case 8:
		case 32:	
		case 37:	
		case 39:
		case 46:
		case 48:
		case 49:
		case 50:
		case 51:
		case 52:
		case 53:
		case 54:
		case 55:
		case 56:
		case 57:
		case 189:			
			return true;
			break;		
		default:			
			return false;		
	}	
}


function js_validarNumCP(e){
	var charCode
	if (navigator.appName == "Netscape") {
		charCode = e.which; 
	}
	else {
		charCode = e.keyCode;
	}
	if ( charCode >= 32 && ((charCode < 48 || charCode > 57)) ) {
		return false;
	}
	else {
		return true;
	}
}

function js_deshabilitaTeclado(e){
	var charCode
	if (navigator.appName == "Netscape") {
		charCode = e.which; 
	}
	else {
		charCode = e.keyCode;
	}
	
	alert(charCode);
	
	if ( charCode >= 0 && charCode <=127 ) {
		return false;
	}else{
		return false;	
	}	
}



function parseEmail(field, fieldName){	
	//expresion regular con la estructura de correo  "cadena@cadena.cadena[.cadena]"
	var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/;
	var invalidChars=" #%&/'¿?,;:()$!=+*\[]{}<>´áéíóúäëïöüÁÉÍÓÚÄËÏÖÜ¨";
	if ((!(b.test(field.value)) || !(parseInvalidChar(field.value, invalidChars))) && (field.value != '')){
		alert ('*** EL FORMATO DEL "' + fieldName + '" ES INCORRECTO ***' );
		return false;
	}
	return true;
}

function parseRFC(field,fieldName){
	var b=/^[A-Z]{4,4}[0-9]{6,6}$/;
	var invalidChars=" #%&/'¿?,;:()$!=+*\[]{}<>´áéíóúäëïöüÁÉÍÓÚÄËÏÖÜ¨";
	if ((!(b.test(field.value)) || !(parseInvalidChar(field.value, invalidChars))) && (field.value != '')){
		alert ('*** EL FORMATO DEL "' + fieldName + '" ES INCORRECTO ***' );
		return false;
	}
	return true;
	
}

function parseTel(field,fieldName){	
	var b = /^([0-9]+\-*[0-9]+)+$/;
	var invalidChars=" #%&/'¿?,;:()$!=+*\[]{}<>´áéíóúäëïöüÁÉÍÓÚÄËÏÖÜ¨";
	if ((!(b.test(field.value)) || !(parseInvalidChar(field.value, invalidChars))) && (field.value != '')){
		alert ('*** EL FORMATO DEL "' + fieldName + '" ES INCORRECTO ***' );
		return false;
	}	
	return true;	
}

function parseInvalidChar(cadena, invalidChars){
	for (var i = 0; i < cadena.length; i++) {
		if (invalidChars.indexOf(cadena.charAt(i)) != - 1)	//Encontro caracter inválido
			return false;
	}
	return true;
}

function parseAZ(field, fieldName){	
	var invalidChars="@#%/'¿?,;:()$!=+*\[]{}<>´äëïöüÁÉÍÓÚÄËÏÖÜ¨0123456789";
	if (!(parseInvalidChar(field.value, invalidChars))) {
		alert ('*** EL CAMPO "' + fieldName + '" CONTIENE CARACTERES INVALIDOS ***' );
		return false;
	}
	return true;
}	


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


function enviaContactanos(){	
	
	//Obtenemos el valor de los campos.
	var comentario = document.Frm_Contactanos.txtcomentarios.value;
	var app = document.Frm_Contactanos.txtapp.value;
	var apm = document.Frm_Contactanos.txtapm.value;
	var nombre = document.Frm_Contactanos.txtnom.value;
	var lada = document.Frm_Contactanos.txtlada.value;
	var tel = document.Frm_Contactanos.txttel.value;
	var mail = document.Frm_Contactanos.txtmail.value;
	
	//Quitamos los espacios en blanco.
	comentario = TrimLR(comentario);
	app = TrimLR(app);
	apm = TrimLR(apm);
	nombre = TrimLR(nombre);
	lada = TrimLR(lada);
	tel = TrimLR(tel);
	mail = TrimLR(mail);
	
	//Validamos los campos de entrada.
	if(comentario == "" || comentario == null){
		alert("*** FALTA COMENTARIO ***");
		document.Frm_Contactanos.txtcomentarios.focus();
		return;
	}	
	
	if(app == "" || app == null){
		alert("*** FALTA APELLIDO PATERNO ***");
		document.Frm_Contactanos.txtapp.focus();
		return;
	}	
	
	if(apm == "" || apm == null){
		alert("*** FALTA APELLIDO MATERNO ***");
		document.Frm_Contactanos.txtapm.focus();
		return;
	}
	
	if(nombre == "" || nombre == null){
		alert("*** FALTA NOMBRE ***");
		document.Frm_Contactanos.txtnom.focus();
		return;
	}
	
	//VALIDAMOS QUE NOS DEN POR LO MENOS UNA VIA DE CONTACTO,
	//ES DECIR, YA SEA EL TELEFONO O EL MAIL,
	
	if(lada == "" && tel == "" && mail == ""){
		alert("*** FAVOR DE PROPORCIONARNOS UN MEDIO DE CONTACTO ***");
		document.Frm_Contactanos.txtlada.focus();
		return;
	}else{
		if(!(lada == "" && tel =="")){
			//VALIDAMOS EL FORMATO DEL TELEFONO	
			
			if(lada.length < 3){
				alert("*** LADA INCORRECTA, MINIMO 3 DIGITOS ***");
				document.Frm_Contactanos.txtlada.focus();
				return;			
			}
			
			if(tel.length < 7){
				alert("*** TELEFONO INCORRECTO, MINIMO 7 DIGITOS ***");
				document.Frm_Contactanos.txttel.focus();
				return;			
			}
			
			
			if(!parseTel(document.Frm_Contactanos.txttel,"TELÉFONO")){
				document.Frm_Contactanos.txttel.focus();
				return;
			}
			
			
			
		}
		
		if(!mail==""){
			//VALIDAMOS EL FORMATO DEL MAIL
			if(!parseEmail(document.Frm_Contactanos.txtmail,"CORREO")){
				document.Frm_Contactanos.txtmail.focus();
				return;
			}
		}		
	}
	
	
	document.Frm_Contactanos.action="guarda_comentario.php";
	document.Frm_Contactanos.submit();	
}//fin enviaContactanos



function abreWallpapers(ban){	
	switch(ban){
		case 1:	
			document.frm_home.action="wallpapers.html";
			document.frm_home.submit();	
			break;
		case 2:
			document.frm_conocenos.action="wallpapers.html";
			document.frm_conocenos.submit();	
			break;
		case 3:
			document.frm_ubicaciones.action="wallpapers.html";
			document.frm_ubicaciones.submit();	
			break;
		case 4:
			document.frm_paseos.action="wallpapers.html";
			document.frm_paseos.submit();	
			break;
		case 5:
			document.frm_eventos.action="wallpapers.html";
			document.frm_eventos.submit();	
			break;	
		case 7:
			document.frm_cultura.action="wallpapers.html";
			document.frm_cultura.submit();	
			break;
		case 8:
			document.frm_equipo2.action="wallpapers.html";
			document.frm_equipo2.submit();	
			break;	
	}
}//fin abreWallpapers


function abreCultura(ban){
	switch(ban){
		case 1:	
			document.frm_home.action="cultura.html";
			document.frm_home.submit();	
			break;
		case 2:	
			document.frm_conocenos.action="cultura.html";
			document.frm_conocenos.submit();	
			break;
		case 3:	
			document.frm_ubicaciones.action="cultura.html";
			document.frm_ubicaciones.submit();	
			break;
		case 4:	
			document.frm_paseos.action="cultura.html";
			document.frm_paseos.submit();	
			break;
		case 5:
			document.frm_eventos.action="cultura.html";
			document.frm_eventos.submit();	
			break;
		case 6:
			document.frm_wallpaper.action="cultura.html";
			document.frm_wallpaper.submit();	
			break;	
		case 8:
			document.frm_equipo2.action="cultura.html";
			document.frm_equipo2.submit();	
			break;			
	}//fin switch	
}//fin abreCultura





function abreEncuestaServicio(ban){
	var ventana = null;
	
	switch (ban) {
		case 1:
			ventana = window.open('encuestarestaurante.html','','toolbar=no,height=340,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;
		case 2:
			ventana = window.open('encuestaplatillos.html','','toolbar=no,height=310,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
		case 3:
			ventana = window.open('encuestadomicilio.html','','toolbar=no,height=375,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
		case 4:
			ventana = window.open('encuestaubicaciones.html','','toolbar=no,height=340,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
		case 5:
			ventana = window.open('encuestainstalaciones.html','','toolbar=no,height=340,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
		case 6:
			ventana = window.open('encuestacliente.html','','toolbar=no,height=530,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
	}//fin switch
}// fin abreEncuestaServicio


function abreEventos(ban){
	switch(ban){
		case 1:	
			document.frm_home.action="eventos.html";
			document.frm_home.submit();	
			break;
		case 2:	
			document.frm_conocenos.action="eventos.html";
			document.frm_conocenos.submit();	
			break;
		case 3:	
			document.frm_ubicaciones.action="eventos.html";
			document.frm_ubicaciones.submit();	
			break;
		case 4:	
			document.frm_paseos.action="eventos.html";
			document.frm_paseos.submit();	
			break;
		case 6:
			document.frm_wallpaper.action="eventos.html";
			document.frm_wallpaper.submit();	
			break;		
		case 7:
			document.frm_cultura.action="eventos.html";
			document.frm_cultura.submit();	
			break;	
		case 8:
			document.frm_equipo2.action="eventos.html";
			document.frm_equipo2.submit();	
			break;		
	}//fin switch		
}// fin abreEventos



function abreEvento(ban){
	
	var ventana = null;
	
	switch (ban) {
		case 14:
			//14 de febrero
			ventana = window.open('eventos14febrero.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;

		case 10:
			//10 de mayo
			ventana = window.open('eventos10mayo.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;
		case 15:
			//15 de mayo
			ventana = window.open('eventos15mayo.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;	
		case 5:
			//5 de junio
			ventana = window.open('eventos5junio.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;	
		case 16:
			//16 de septiembre
			ventana = window.open('eventos16septiembre.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
		case 1:
			//primero y dos de noviembre
			ventana = window.open('eventos1noviembre.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;	
		case 20:
			//veinte de noviembre
			ventana = window.open('eventos20noviembre.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;	
		case 31:
			//veinte de noviembre
			ventana = window.open('eventos31diciembre.html','','toolbar=no,height=490,width=300,top=150,left=250,status=no,scrollbars=no,menubar=no');	
			break;		
		
	}//fin switch
}//fin abreEvento


function abreOpinion(){
	var ventana = null;
	ventana = window.open('opinion.html','','toolbar=no,height=490,width=300,top=100,left=250,status=no,scrollbars=no,menubar=no');	
}

//********* Seccion para validar datos de los formularios *********

function validaAcceso(){
	//Funcion valida acceso OnLine
	
	var usuario=document.frm_user.txtUser.value;
	var password=document.frm_user.txtClave.value;
	
	if(usuario=="" || usuario ==null){
		alert("*** ESCRIBE EL USUARIO ***");	
		document.frm_user.txtUser.focus();
		return;
	}
	
	if(password=="" || password ==null){
		alert("*** ESCRIBE LA CLAVE DEL USUARIO ***");	
		document.frm_user.txtClave.focus();
		return;
	}
	
	
	document.frm_user.action="valida_entrada_online.php";
	document.frm_user.submit();		
}//fin validaAcceso




function validaRegistro(){	
	//Datos generales
	var app = TrimLR(document.frm_datos.txtapp.value);	
	var apm = TrimLR(document.frm_datos.txtapm.value);
	var nom = TrimLR(document.frm_datos.txtnom.value);
	var lada = TrimLR(document.frm_datos.txtlada.value);
	var tel = TrimLR(document.frm_datos.txttel.value);
	var calle = TrimLR(document.frm_datos.txtcalle.value);
	var col = TrimLR(document.frm_datos.txtcol.value);
	var cp = TrimLR(document.frm_datos.txtcp.value);
	var edo = document.frm_datos.txtedo.options[document.frm_datos.txtedo.selectedIndex ].value; 
	var ciu = TrimLR(document.frm_datos.txtciu.value);
	var ref = TrimLR(document.frm_datos.txtref.value);
	var mail = TrimLR(document.frm_datos.txtmail.value);
	//var rfc = TrimLR(document.frm_datos.txtrfc.value);
	//var homo = TrimLR(document.frm_datos.txthomo.value);
	var dia = document.frm_datos.cmddia.options[document.frm_datos.cmddia.selectedIndex ].value; 
	var mes = document.frm_datos.cmdmes.options[document.frm_datos.cmdmes.selectedIndex ].value; 	
	//Datos de la factura
	var fac = null;
	if (document.frm_datos.opFac[0].checked){
        fac = document.frm_datos.opFac[0].value;
    }else if (document.frm_datos.opFac[1].checked){
		fac = document.frm_datos.opFac[1].value;
	}    
	var rfc1 = TrimLR(document.frm_datos.txtrfc1.value);
	var homo1 = TrimLR(document.frm_datos.txthomo1.value);	
	var calle1 = TrimLR(document.frm_datos.txtcalle1.value);
	var col1 = TrimLR(document.frm_datos.txtcol1.value);
	var cp1 = TrimLR(document.frm_datos.txtcp1.value);
	var edo1 = document.frm_datos.txtedo1.options[document.frm_datos.txtedo1.selectedIndex ].value;            	
	var ciu1 = TrimLR(document.frm_datos.txtciu1.value);	
	//Datos del nick
	var nick = TrimLR(document.frm_datos.txtnick.value);
	var pass = TrimLR(document.frm_datos.txtpass.value);
	var pass1 = TrimLR(document.frm_datos.txtpass1.value);
	var preg = document.frm_datos.cmbpreg.options[document.frm_datos.cmbpreg.selectedIndex ].value; 
	var res = TrimLR(document.frm_datos.txtres.value);
	
		
	if(app == "") {
		alert("*** FALTA APELLIDO PATERNO ***");
		document.frm_datos.txtapp.focus();	
		return;
	}
	
	if(apm == "") {
		alert("*** FALTA APELLIDO MATERNO ***");
		document.frm_datos.txtapm.focus();	
		return;
	}
	
	if(nom == "") {
		alert("*** FALTA NOMBRE(S) ***");
		document.frm_datos.txtnom.focus();		
		return;
	}

	
	if(lada == "") {
		alert("*** FALTA LADA ***");
		document.frm_datos.txtlada.focus();		
		return;
	}



	if(lada.length < 3){
		alert("*** LADA DE 3 DIGITOS ***");
		document.frm_datos.txtlada.focus();		
		return;		
	}
	//Validamos que el telefomo no este vacio	
	if(tel == "") {
		alert("*** FALTA TELÉFONO ***");
		document.frm_datos.txttel.focus();		
		return;
	}
	
	if(tel.length < 7){
		alert("*** TELÉFONO DE 7 DIGITOS ***");
		document.frm_datos.txttel.focus();		
		return;		
	}
	//Si el telefono no esta vacio validamos el formato
	if(!parseTel(document.frm_datos.txttel,"TELÉFONO")){
		document.frm_datos.txttel.focus();
		return;
	}
	//Validmos que el telefono no empiece con cero
	
	if(tel.substring(0,1)=="0"){
		alert("*** EL NUMERO DE TELÉFONO NO DEBE INICIAR CON CERO ***");
		document.frm_datos.txttel.focus();		
		return;		
	}



	if(calle == "") {
		alert("*** FALTA CALLE ***");
		document.frm_datos.txtcalle.focus();		
		return;
	}


	if(col == "") {
		alert("*** FALTA COLONIA ***");
		document.frm_datos.txtcol.focus();		
		return;
	}

	if(cp == "") {
		alert("*** FALTA CÓDIGO POSTAL ***");
		document.frm_datos.txtcp.focus();		
		return;
	}
	
	
	if(cp.length < 5){
		alert("*** CODIGO POSTAL DE 5 DIGITOS ***");
		document.frm_datos.txtcp.focus();		
		return;		
	}
	
	if(ciu == "") {
		alert("*** FALTA CIUDAD ***");
		document.frm_datos.txtciu.focus();		
		return;
	}
	
	if(edo == "0") {
		alert("*** FALTA SELECCIONAR ESTADO ***");
		document.frm_datos.txtedo.focus();		
		return;
	}

	
	

	
	if(ref == "") {
		alert("*** FALTA REFERENCIA ***");
		document.frm_datos.txtref.focus();		
		return;
	}
	
	//Validamos que el mail no este vacio
	if(mail == "") {
		alert("*** FALTA CORREO ***");
		document.frm_datos.txtmail.focus();		
		return;
	}
	//Si el mail no esta vacio validamos el formato
	if(!parseEmail(document.frm_datos.txtmail,"CORREO")){
		document.frm_datos.txtmail.focus();
		return;
	}


	//if(rfc == "") {
	//	alert("*** FALTA RFC ***");
	//	document.frm_datos.txtrfc.focus();		
	//	return;
	//}

	if(dia == "0") {
		alert("*** FALTA SELECCIONAR DIA DE CUMPLEAÑOS ***");
		document.frm_datos.cmddia.focus();		
		return;
	}
	
	if(mes == "0") {
		alert("*** FALTA SELECCIONAR MES DE CUMPLEAÑOS ***");
		document.frm_datos.cmdmes.focus();		
		return;
	}
	
	//validamos campos dela factura	
	if (fac=="1"){
		//Validamos que el RFC no este vacio
		if(rfc1 == "") {
			alert("*** FALTA RFC DE LA FACTURA ***");
			document.frm_datos.txtrfc1.focus();		
			return;
		}
		
		//Si el RFC no esta vacio validamos el formato
		if(!parseRFC(document.frm_datos.txtrfc1,"RFC")){
			document.frm_datos.txtrfc1.focus();
			return;
		}
		
		if(homo1 == "") {
			alert("*** FALTA HOMOCLAVE DE LA FACTURA ***");
			document.frm_datos.txthomo1.focus();		
			return;
		}
		
		if(homo1.length < 3) {
			alert("*** ERROR EN EL FORMATO DE LA HOMOCLAVE ***");
			document.frm_datos.txthomo1.focus();		
			return;
		}
		
		
		
		if(calle1 == "") {
			alert("*** FALTA CALLE DE LA FACTURA ***");
			document.frm_datos.txtcalle1.focus();		
			return;
		}
	
	
		if(col1 == "") {
			alert("*** FALTA COLONIA DE LA FACTURA ***");
			document.frm_datos.txtcol1.focus();		
			return;
		}
	
		if(cp1 == "") {
			alert("*** FALTA CÓDIGO POSTAL DE LA FACTURA ***");
			document.frm_datos.txtcp1.focus();		
			return;
		}
		
		if(cp1.length < 5){
			alert("*** CODIGO POSTAL DE 5 DIGITOS ***");
			document.frm_datos.txtcp1.focus();		
			return;		
		}
		
		if(edo1 == "0") {
			alert("*** FALTA SELECCIONAR ESTADO DE LA FACTURA***");
			document.frm_datos.txtedo1.focus();		
			return;
		}
	
		
		if(ciu1 == "") {
			alert("*** FALTA CIUDAD DE LA FACTURA ***");
			document.frm_datos.txtciu1.focus();		
			return;
		}
		
	}else{
		
		document.frm_datos.txtrfc1.disabled=false;
		document.frm_datos.txthomo1.disabled=false;
		document.frm_datos.txtcalle1.disabled=false;
		document.frm_datos.txtcol1.disabled=false;
		document.frm_datos.txtcp1.disabled=false;
		document.frm_datos.txtedo1.disabled=false;
		document.frm_datos.txtciu1.disabled=false;
		document.frm_datos.txtrfc1.value="";
		document.frm_datos.txthomo1.value="";	
		document.frm_datos.txtcalle1.value="";
		document.frm_datos.txtcol1.value="";
		document.frm_datos.txtcp1.value="";
		document.frm_datos.txtedo1.options[document.frm_datos.txtedo1.selectedIndex ].value;  
		document.frm_datos.txtciu1.value="";	
		
	}
	
	
	//Validamos campos del resgistro de la clave del usuario
	if(nick == "") {
		alert("*** FALTA USUARIO ***");
		document.frm_datos.txtnick.focus();	
		return;
	} 
	
	if(pass == "") {
		alert("*** FALTA PASSWORD DEL USUARIO ***");
		document.frm_datos.txtpass.focus();	
		return;
	}
	
	if(pass1 == "") {
		alert("*** FALTA CONFIRMAR PASSWORD DEL USUARIO ***");
		document.frm_datos.txtpass1.focus();	
		return;
	}
	
	if(!(pass == pass1)) {
		alert("*** EL PASSWORD Y CONFIRMAR PASSWORD DEBEN SER IGUALES ***");
		document.frm_datos.txtpass.value="";	
		document.frm_datos.txtpass1.value="";	
		document.frm_datos.txtpass.focus();	
		return;
	}
	
	if(preg == "0") {
		alert("*** FALTA SELECCIONAR PREGUNTA DEL USUARIO ***");
		document.frm_datos.cmbpreg.focus();		
		return;
	}
	
	if(res == "") {
		alert("*** FALTA RESPUESTA DE LA PREGUNTA DEL USUARIO***");
		document.frm_datos.txtres.focus();	
		return;
	}	
	
	document.frm_datos.action="enviaRegistro.php";
	document.frm_datos.submit();	
	
}//fin validaRegistro





function enviaRegistro(){
	window.close();  //cerramos la ventana actual		
	var ventana = null;
	ventana = window.open('online.html','','toolbar=no,height=465,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');
}


function validaCarta(){	
	//Enviamos a validar en los datos en php
	document.frm_carta.action="confirmacarta.html";
	document.frm_carta.submit();	
}//fin validaCarta

function enviaPagar(){
	//Enviamos a validar en los datos en php
	document.frm_pedido.action="capturapago.html";
	document.frm_pedido.submit();	
}



function muestraFecha(){
	var fecha = new Date();
	var mes = "";
	switch(fecha.getMonth() +1 ) {
		case 1: mes=" de Enero de "; break;
		case 2: mes=" de Febrero de "; break;
		case 3: mes=" de Marzo de "; break;
        case 4: mes=" de Abril de "; break;
		case 5: mes=" de Mayo de "; break;
		case 6: mes=" de Junio de "; break;
		case 7: mes=" de Julio de "; break;
		case 8: mes=" de Agosto de "; break;
		case 9: mes=" de Septiembre de "; break;		
		case 10: mes=" de Octubre de "; break;
		case 11: mes=" de Noviembre de "; break;
		case 12: mes=" de Diciembre de "; break;
	}	
	document.write(fecha.getDate() + mes + fecha.getFullYear());	
}



<!--

//Eventos dinámicos para la CARTA
//Texto dinamico
function movein(which,html,caja){
	//alert("movein"+which);
	//which.style.background='white';
	if (document.getElementById)
		document.getElementById(caja).innerHTML=html;
	else
		boxdescription.innerHTML=html;
}

function moveout(which,caja,html){
	//alert("moveout"+which);
	//which.style.background='bisque';
	if (document.getElementById)
		document.getElementById(caja).innerHTML=html;  
	else
		boxdescription.innerHTML=html;
}

function moveout2(which,caja){
	//alert("moveout"+which);
	//which.style.background='bisque';
	if (document.getElementById)
		document.getElementById(caja).innerHTML='&';  
	else
		boxdescription.innerHTML='&nbsp;';
}

//Imagenes dinamicas
function moveinImg(html,id){

	var buf = '<iframe frameborder="0" name="foto" hspace="0" vspace="0" marginheight="0" scrolling="no" src="'+ html +'" width="155" height="195"><img src="img/e_01.jpg" align="absbottom"></iframe>';
	//alert("movein"+which);
	//which.style.background='white';
	if (document.getElementById)
		document.getElementById(id).innerHTML=buf;
	else
		boxdescription.innerHTML=buf;
}

function moveoutImg(id){
	//alert("moveout"+which);
	//which.style.background='bisque';
	if (document.getElementById)
		document.getElementById(id).innerHTML='>';  
	else
		boxdescription.innerHTML='>';
}



//Eventos dinámicos para PASEOS
function moveinPaseos(which,html,caja){
	if (document.getElementById)
		document.getElementById(caja).innerHTML=html;
	else
		boxdescription.innerHTML=html;
}
function moveoutPaseos(which,caja){
	if (document.getElementById)
		document.getElementById(caja).innerHTML='>';  
	else
		boxdescription.innerHTML='>';
}

//Imagenes dinamicas
function moveinImgPaseos(html,id,id2){

	var buf = '<iframe name="sucursal" scrolling="auto" frameborder="0" hspace="0" vspace="0" width="450" height="200" src="' + html + '"></iframe>';		
	if (document.getElementById)
		document.getElementById(id).innerHTML=buf;
	else
		boxdescription.innerHTML=buf;
	
	var buf2='';
	if(id2=="opc1"){
		buf2='Juarez <img src="img/vin_abierta.gif">';
		document.getElementById(id2).innerHTML=buf2;		
		document.getElementById('opc2').innerHTML='Tecnológico <img src="img/vin_cerrada.gif">';
	}else if(id2=="opc2"){
		buf2='Tecnológico <img src="img/vin_abierta.gif">';
		document.getElementById(id2).innerHTML=buf2;
		document.getElementById('opc1').innerHTML='Juarez <img src="img/vin_cerrada.gif">';
	}		
}

function moveoutImgPaseos(id){
	if (document.getElementById)
		document.getElementById(id).innerHTML='>';  
	else
		boxdescription.innerHTML='>';
}




//Eventos dinámicos para SONIDOS
var aySound = new Array();
aySound[0] = "img/01.mp3";
aySound[1] = "img/02.mp3";
aySound[2] = "img/03.mp3";
aySound[3] = "img/04.mp3";

document.write('<BGSOUND ID="auIEContainer" loop="-1">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
	if (!ver4) return;
	if (NS) auEmb = new Layer(0,window);
	else {
		Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
		document.body.insertAdjacentHTML("BeforeEnd",Str);
	}
	var Str = '';
	for (i=0;i<aySound.length;i++)
		Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE' loop='true'>"
	if (IE) auEmb.innerHTML = Str;
	else {
		auEmb.document.open();
		auEmb.document.write(Str);
		auEmb.document.close();
	}
	auCon = IE? document.all.auIEContainer:auEmb;
	auCon.control = auCtrl;
}

function auCtrl(whSound,play) {
	if (IE) this.src = play? aySound[whSound]:'';
	else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}

function playSound(whSound) { 
	switch(whSound){
		case 0:		
			if (window.auCon) auCon.control(1,false); 
			if (window.auCon) auCon.control(2,false); 
			if (window.auCon) auCon.control(3,false); 
			if (window.auCon) auCon.control(0,true); 				
			break;
		case  1:
			if (window.auCon) auCon.control(0,false); 
			if (window.auCon) auCon.control(2,false); 
			if (window.auCon) auCon.control(3,false); 
			if (window.auCon) auCon.control(1,true); 				
			break;
		case 2:
			if (window.auCon) auCon.control(0,false); 
			if (window.auCon) auCon.control(1,false); 
			if (window.auCon) auCon.control(3,false); 
			if (window.auCon) auCon.control(2,true); 				
			break;
		case 3:
			if (window.auCon) auCon.control(0,false); 
			if (window.auCon) auCon.control(1,false); 
			if (window.auCon) auCon.control(2,false); 
			if (window.auCon) auCon.control(3,true); 				
			break;			
	}
	
}


function stopSound() { 
	if (window.auCon) auCon.control(0,false); 
	if (window.auCon) auCon.control(1,false); 
	if (window.auCon) auCon.control(2,false); 
	if (window.auCon) auCon.control(3,false); 
}




function activaCamposCliente(ban){
	//ban = 1 activa los campos
	//ban = 0 desactiva los campos
	if(ban==1){
		document.Frm_Enc_Cliente.clientes_preg12.value="";	
		document.Frm_Enc_Cliente.clientes_preg13.value="";	
		document.Frm_Enc_Cliente.clientes_preg14.value="";			
		document.Frm_Enc_Cliente.clientes_preg15.selectedIndex = 0;
		document.Frm_Enc_Cliente.clientes_preg16.selectedIndex = 0;
		document.Frm_Enc_Cliente.clientes_preg17.value="";	
		document.Frm_Enc_Cliente.clientes_preg12.disabled=false;
		document.Frm_Enc_Cliente.clientes_preg13.disabled=false;
		document.Frm_Enc_Cliente.clientes_preg14.disabled=false;
		document.Frm_Enc_Cliente.clientes_preg15.disabled=false;
		document.Frm_Enc_Cliente.clientes_preg16.disabled=false;
		document.Frm_Enc_Cliente.clientes_preg17.disabled=false;	
		document.Frm_Enc_Cliente.clientes_preg12.focus();
	}else if(ban==0){		
		document.Frm_Enc_Cliente.clientes_preg12.value="";
		document.Frm_Enc_Cliente.clientes_preg13.value="";
		document.Frm_Enc_Cliente.clientes_preg14.value="";		
		document.Frm_Enc_Cliente.clientes_preg15.selectedIndex = 0;
		document.Frm_Enc_Cliente.clientes_preg16.selectedIndex = 0;
		document.Frm_Enc_Cliente.clientes_preg17.value="";	
		document.Frm_Enc_Cliente.clientes_preg12.disabled=true;
		document.Frm_Enc_Cliente.clientes_preg13.disabled=true;
		document.Frm_Enc_Cliente.clientes_preg14.disabled=true;
		document.Frm_Enc_Cliente.clientes_preg15.disabled=true;
		document.Frm_Enc_Cliente.clientes_preg16.disabled=true;
		document.Frm_Enc_Cliente.clientes_preg17.disabled=true;		
	}	
	
}


function validaPago(){
	document.frm_pedido.action="enviaPago.html";
	document.frm_pedido.submit();	
}


//Funcion que al teclear ENTER nos coloca en el foco que le pasemos como parametro.
function siguienteCampo(dom){
    if(event.keyCode==13) dom.focus();
}




//ELIMINA ESPACIOS EN BLANCO DE UN STRING
//
//FUNCION TrimLR
function TrimLR(str) {
	var dato = "";	
	dato = TrimLeft(str);
	dato = TrimRight(dato);
	return dato;
}

//FUNCION TrimLeft
function TrimLeft( str ) {
	var resultStr = "";
	var i = len = 0;
	if (str+"" == "undefined" || str == null) return "";
	str += "";
	if (str.length == 0) resultStr = "";
	else { 			
		len = str.length;			
		while ((i <= len) && (str.charAt(i) == " ")) i++;
		resultStr = str.substring(i, len);
	}
	return resultStr;
}

//FUNCION TrimRight
function TrimRight( str ) {
	var resultStr = "";
	var i = 0;
	if (str+"" == "undefined" || str == null) return "";
	str += "";
	if (str.length == 0) resultStr = "";
	else {
		i = str.length - 1;
		while ((i >= 0) && (str.charAt(i) == " ")) i--;
		resultStr = str.substring(0, i + 1);
	}
	return resultStr; 
}

// TERMINA TrimLR.js




//FUNCION PARA LA VALIDACIÓN DE LOS CAMPOS DEL USUARIO
function activaCampos(ban){
	//ban = 1 activa los campos
	//ban = 0 desactiva los campos
	if(ban==1){
		document.frm_datos.txtrfc1.disabled=false;
		document.frm_datos.txthomo1.disabled=false;
		document.frm_datos.txtcalle1.disabled=false;
		document.frm_datos.txtcol1.disabled=false;
		document.frm_datos.txtcp1.disabled=false;
		document.frm_datos.txtedo1.disabled=false;
		document.frm_datos.txtciu1.disabled=false;
		document.frm_datos.txtrfc1.value="";
		document.frm_datos.txthomo1.value="";
		document.frm_datos.txtcalle1.value="";
		document.frm_datos.txtcol1.value="";
		document.frm_datos.txtcp1.value="";
		document.frm_datos.txtedo1.selectedIndex = 0;
		//document.frm_datos.txtedo1.value="";
		document.frm_datos.txtciu1.value="";
		document.frm_datos.txtrfc1.focus();
	}else if(ban==0){
		document.frm_datos.txtrfc1.disabled=true;
		document.frm_datos.txthomo1.disabled=true;
		document.frm_datos.txtcalle1.disabled=true;
		document.frm_datos.txtcol1.disabled=true;
		document.frm_datos.txtcp1.disabled=true;
		document.frm_datos.txtedo1.disabled=true;
		document.frm_datos.txtciu1.disabled=true;
		document.frm_datos.txtrfc1.value="";
		document.frm_datos.txthomo1.value="";
		document.frm_datos.txtcalle1.value="";
		document.frm_datos.txtcol1.value="";
		document.frm_datos.txtcp1.value="";
		document.frm_datos.txtedo1.selectedIndex = 0;
		//document.frm_datos.txtedo1.value="";
		document.frm_datos.txtciu1.value="";		
	}	
	
}//fin activaCampos



function abreComanda(nick){	
	window.close();  //cerramos la ventana de registro actual.
	var ventana = null;
	ventana = window.open('carta.php?txtNick='+nick,'','toolbar=no,height=700,width=670,top=10,left=250,status=no,scrollbars=yes,menubar=no');	
}//fin abreComanda


//**********************************************
//Validamos la parte del administrador
//**********************************************

function abreRegistroEmpleado(){
	window.opener=top;
	window.close();
	var ventana = null;
	ventana = window.open('ingresa_admin.html','','toolbar=no,height=410,width=600,top=100,left=250,status=no,scrollbars=no,menubar=no');	
}


function validaUserAdmin(){
	var usu = document.frm_admin.txtUser.value;
	var cve = document.frm_admin.txtClave.value;
	
	if(TrimLR(usu) == "" || usu == null ){
		alert("*** DEBES CAPTURAR EL USUARIO ***");	
		document.frm_admin.txtUser.value = "";
		document.frm_admin.txtUser.focus();
		return;
	}
	
	if(TrimLR(cve) == "" || cve == null ){
		alert("*** DEBES CAPTURAR EL PASSWORD ***");	
		document.frm_admin.txtClave.value = "";
		document.frm_admin.txtClave.focus();
		return;
	}

	document.frm_admin.action="validaUserAdmin.php";
	document.frm_admin.submit();	

}


function abreMenuAdmin(usu){
	window.close();  //cerramos la ventana de registro actual.
	var ventana = null;
	ventana = window.open('muenu_admin.php?txtUsu='+usu,'','toolbar=no,height=405,width=600,top=100,left=250,status=no,scrollbars=no,menubar=no');	
}




function validaRFC(ban){
	var rfc = document.Frm_rfc.txtrfc.value;
	
	if(TrimLR(rfc)=="" || rfc==null){
		alert("*** EL NOMBRE ES INVALIDO ***");
		document.Frm_rfc.txtrfc.value="";
		document.Frm_rfc.txtrfc.focus();
		return;
	}
	
	if(ban=='0'){
		document.Frm_rfc.submit();
	}else if(ban=='1'){
		var respuesta=confirm("*** ¿ESTAS SEGURO DE DAR DE BAJA AL EMPLEADO? ***");
		if (respuesta==true) document.Frm_rfc.submit();
		else return;
	}	
}



function abreAtenderPedidos(id_empleado,rol){
	
	if(rol != "1"){
		window.close();		
	}	
	var ventana = null;
	ventana = window.open('pedidos.php?txtUsu='+id_empleado+'&rol='+rol,'','toolbar=no,height=500,width=420,top=100,left=250,status=no,scrollbars=yes,menubar=no');	
}


function abreAtenderPedidosError(id_empleado){
	window.close();
	var ventana = null;
	ventana = window.open('pedidoserror.php?txtUsu='+id_empleado,'','toolbar=no,height=500,width=420,top=100,left=250,status=no,scrollbars=yes,menubar=no');	
	
}



function imprimirNota(){
	
	
	
}



//***********************************************





//******************* DESHABILITA EL BOTON DERECHO DEL MOUSE ************************
var message="© 2007 Sushi yen´s S.A de C.V World Wide, Inc. Todos los derechos reservados"; 
function click(e) {
	/*
	if (document.all) {
		if (event.button == 2) {
			alert(message);
			return false;
		}
	}
	if (document.layers) {
		if (e.which == 3) {
			alert(message);
			return false;
		}
	}*/
	
	return true;
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
}

document.onmousedown=click;
// --> 
//**************************************************************************************++



//Función que cierra la ventana de proceso exitoso del registro de usuario y abre la vantana de online

function continuaRegistro(nick){
	window.close();
	//var ventana = null;	
	abreComanda(nick);	
	//ventana = window.open('online.html','','toolbar=no,height=465,width=400,top=150,left=250,status=no,scrollbars=no,menubar=no');	
}


//Función para obtener los datos del usuario para cuando olvido su password

function olvido(){
	
	var user = TrimLR(document.frm_user.txtUser.value);
	
	if(user == null || user == ""){
		alert("*** PARA RECUPERAR TU CONTRASEÑA, POR FAVOR CAPTURA TU USUARIO ***");
		document.frm_user.txtUser.value="";
		document.frm_user.txtUser.focus();
		return;		
	}
	
	document.frm_user.action="olvido.php?user="+user;	
	document.frm_user.submit();	
}



//VALIDAMOS LOS DATOS DE ENTRATAT AL DAR DE ALTA UN EMPLEADO.

function validaAltaEmpleado(){

	var nombre = TrimLR(document.Frm_altas_empleados.txtemp.value);
	var rol = document.Frm_altas_empleados.combo_rol.value;
	var sucursal = document.Frm_altas_empleados.combo_sucursal.value;
	var user = TrimLR(document.Frm_altas_empleados.txtusu.value);
	var pass = TrimLR(document.Frm_altas_empleados.txtpass.value);
	
	if(nombre=="" || nombre == null){
		alert("*** Falta el nombre del empleado ***");
		document.Frm_altas_empleados.txtemp.value="";
		document.Frm_altas_empleados.txtemp.focus();
		return;
	}
	
	if(rol=="0" || rol == null){
		alert("*** Falta el seleccionar el rol del empleado ***");
		document.Frm_altas_empleados.combo_rol.focus();
		return;
	}
	
	if(sucursal=="0" || sucursal == null){
		alert("*** Falta el seleccionar la sucursal del empleado ***");
		document.Frm_altas_empleados.combo_sucursal.focus();
		return;
	}
	
	if(user=="" || user == null){
		alert("*** Falta el usuario del empleado ***");
		document.Frm_altas_empleados.txtusu.focus();
		return;
	}
	
	if(pass=="" || pass == null){
		alert("*** Falta el password del empleado ***");
		document.Frm_altas_empleados.txtpass.focus();
		return;
	}
	
	
	document.Frm_altas_empleados.submit();

}

function js_validarNumCantidadP(e){
	var charCode
	if (navigator.appName == "Netscape") {
		charCode = e.which; 
	}
	else {
		charCode = e.keyCode;
	}
	if ( charCode >= 32 && ((charCode < 48 || charCode > 57)) ) {
		return false;
	}
	else {
		return true;
	}
}



function validaModificaEmpleado(){
	
	var nom = TrimLR(document.Frm_modifica_empleado.txtemp.value);
	var rol = document.Frm_modifica_empleado.combo_rol.value;
	var suc = document.Frm_modifica_empleado.combo_sucursal.value;  
	var sta = document.Frm_modifica_empleado.combo_estatus.value; 
	
	if(nom == "" || nom == null){
		alert("*** Falta el nombre del empleado ***");
		document.Frm_modifica_empleado.txtemp.value="";
		document.Frm_modifica_empleado.txtemp.focus();
		return;
	}
	
	
	if(rol=="0" || rol == null){
		alert("*** Falta el seleccionar el rol del empleado ***");
		document.Frm_modifica_empleado.combo_rol.focus();
		return;
	}
	
	if(suc=="0" || suc == null){
		alert("*** Falta el seleccionar la sucursal del empleado ***");
		document.Frm_modifica_empleado.combo_sucursal.focus();
		return;
	}

	if(sta=="0" || sta == null){
		alert("*** Falta el seleccionar el estatus del empleado ***");
		document.Frm_modifica_empleado.combo_estatus.focus();
		return;
	}

	document.Frm_modifica_empleado.submit();
	
}

//-->


