function envia()
{
document.form1.submit;
}

function esNulo(valor) {
	return !valor.match(/\S/)
	}

function ValidaForma(form1) 
	{
		with (document.form1) 
		{
			if (esNulo(txtNombreConv.value))
			{
				alert("POR FAVOR ESCRIBA EL NOMBRE DEL CONVENCIONISTA");
				txtNombreConv.focus();
				return false;
			}	
					
			if (compania[0].checked == false && compania[1].checked == false)
			{
			alert("ELIJA UNA OPCION SI ASISTIRA CON ACOMPANANTE");				
			return(false);
			}
			if (compania[0].checked == true)
			{
				if (esNulo(txtAcompanante.value))
				{
				alert("POR FAVOR ESCRIBA EL NOMBRE DE SU ACOMPANANTE");
				txtAcompanante.focus();
				return false;
				}
			}
			if (esNulo(txtTel.value))
			{
				alert("CAMPO TELEFONO ESTA VACIO");
				txtTel.focus();
				return false;
			}
			if (isNaN(txtTel.value) || txtTel.value.length != 10)
			{
				alert("POR FAVOR ESCRIBA 10 DIGITOS EN EL CAMPO TELEFONO, SIN SIGNOS");
				txtTel.focus();
				return false;
			}
				 
			if (esNulo(txtEmail.value))
			{
				alert("POR FAVOR ESCRIBA SU E-MAIL");
				txtEmail.focus();
				return false;
			}
			if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txtEmail.value))
			{
		   	    alert("POR FAVOR VERIFIQUE SU E-MAIL")
				txtEmail.focus();
				return false;
			}

			
			if (esNulo(txtRazon.value))
			{
				alert("CAMPO RAZON SOCIAL ESTA VACIA");
				txtRazon.focus();
				return false;
			}			
			if (esNulo(txtRFC.value))
			{
				alert("EL RFC NO FUE PROPORCIONADO");
				txtRFC.focus();
				return false;
			}			
			if (esNulo(txtDomicilio.value))
			{
				alert("EL CAMPO DOMICILIO FISCAL ESTA VACIO");
				txtDomicilio.focus();
				return false;
			}
				
			
			if (esNulo(txtColonia.value))
			{
				alert("CAMPO COLONIA ESTA VACIO");
				txtColonia.focus();
				return false;
			}		

			if (esNulo(txtDelMpio.value))
			{
				alert("CAMPO DELEGACION/MUNICIO ESTA VACIO");
				txtDelMpio.focus();
				return false;
			}		

			if (esNulo(txtEstado.value))
			{
				alert("CAMPO ESTADO ESTA VACIO");
				txtEstado.focus();
				return false;
			}		

			if (esNulo(txtCP.value))
			{
				alert("CAMPO CP ESTA VACIO");
				txtCP.focus();
				return false;
			}
			if (isNaN(txtCP.value) || txtCP.value.length != 5)
			{
				alert("CAMPO CP ESCRITO EN FORMATO INCORRECTO");
				txtCP.focus();
				return false;
			}
			if (esNulo(txtFechaPago.value))
			{
				alert("CAMPO FECHA DE PAGO ESTA VACIO");
				txtFechaPago.focus();
				return false;
			}
			 if (txtFechaPago.value.length != 10) { 
				   	 alert("CAMPO FECHA CON FORMATO INCORRECTO");
 				     txtFechaPago.focus();
			         return false; 
			   } 
			   for (j=0; j<txtFechaPago.value.length; j++) { 
			   //all figures and spacers in place? 
			     if ((j == 2) || (j == 5)) { 
			       if (txtFechaPago.value.charAt(j) != "/") { 
				   	 alert("LA FECHA DE PAGO NO FUE PROPORCIONADA EN FORMATO CORRECTO");
 				     txtFechaPago.focus();
			         return false; 
			       } 
			     } else if ((txtFechaPago.value.charAt(j)<"0") || (txtFechaPago.value.charAt(j)>"9")) { 
				  alert("LA FECHA DE PAGO NO FUE PROPORCIONADA EN FORMATO CORRECTO");
				  txtFechaPago.focus();
			  return false; 
		     } 
		   } 
			bits = txtFechaPago.value.split("/"); 
			days = Number(bits[0]); 
			month = Number(bits[1]); 
			year=Number(bits[2]); 
			if (days > 31) {alert("EL DIA EN FECHA DE PAGO NO ES CORRECTO");
				txtFechaPago.focus(); return false;} 
			else if (month > 12) {alert("EL MES EN FECHA DE PAGO NO ES CORRECTO");
				txtFechaPago.focus(); return false;} 
			else if (year != 2010) { alert("EL ANIO EN FECHA DE PAGO NO ES CORRECTO");
				txtFechaPago.focus();return false;} 

			
			if (esNulo(txtBanco.value))
			{
				alert("EL CAMPO NOMBRE DEL BANCO ESTA VACIO");
				txtBanco.focus();
				return false;
			}
			
			if (esNulo(txtCiudadPago.value))
			{
				alert("EL CAMPO CIUDAD DE FACTURACION ESTA VACIO");
				txtCiudadPago.focus();
				return false;
			}			
			if (esNulo(txtImporte.value))
			{
				alert("EL CAMPO IMPORTE DE PAGO ESTA VACIO");
				txtImporte.focus();
				return false;
			}
			pos = txtImporte.value.indexOf(",");
				if (pos > 0)
					{
						alert("Por favor no escriba comas en el campo importe");
						txtImporte.focus();
						return false;
					}
			if (radTipoPago[0].checked == false && radTipoPago[1].checked == false)
			{
			alert("POR FAVOR, SELECCIONE US / MX EN CAMPO IMPORTE DE PAGO");				
			return(false);
			}
			if (esNulo(txtFechaArribo.value))
			{
				alert("CAMPO FECHA DE ARRIBO ESTA VACIO");
				txtFechaArribo.focus();
				return false;
			}
			 if (txtFechaArribo.value.length != 10) { 
				   	 alert("EL FORMATO EN CAMPO FECHA DE ARRIBO ES INCORRECTO");
 				     txtFechaArribo.focus();
			         return false; 
			   } 
			   for (j=0; j<txtFechaArribo.value.length; j++) { 
			   //all figures and spacers in place? 
			     if ((j == 2) || (j == 5)) { 
			       if (txtFechaArribo.value.charAt(j) != "/") { 
				   	 alert("EL FORMATO EN CAMPO FECHA DE ARRIBO ES INCORRECTO");
 				     txtFechaArribo.focus();
			         return false; 
			       } 
			     } else if ((txtFechaArribo.value.charAt(j)<"0") || (txtFechaArribo.value.charAt(j)>"9")) { 
				  alert("EL FORMATO EN CAMPO FECHA DE ARRIBO ES INCORRECTO");
				  txtFechaArribo.focus();
			  return false; 
		     } 
		   } 
			bits = txtFechaArribo.value.split("/"); 
			days = Number(bits[0]); 
			month = Number(bits[1]); 
			year=Number(bits[2]); 
			if (days > 31) {alert("EL DIA EN CAMPO FECHA DE ARRIBO ES INCORRECTO");
				txttxtFechaArribo.focus(); return false;} 
			else if (month > 12) {alert("EL MES EN CAMPO FECHA DE ARRIBO ES INCORRECTO");
				txttxtFechaArribo.focus(); return false;} 
			else if (year != 2010) { alert("EL ANIO EN CAMPO FECHA DE ARRIBO ES INCORRECTO");
				txtFechaArribo.focus();return false;} 
			
			
			if (esNulo(txtFechaSalida.value))
			{
				alert("CAMPO FECHA DE SALIDA ESTA VACIO");
				txtFechaSalida.focus();
				return false;
			}			
						 if (txtFechaSalida.value.length != 10) { 
				   	 alert("FORMATO EN CAMPO FECHA DE SALIDA ESTA VACIO");
 				     txtFechaSalida.focus();
			         return false; 
			   } 
			   for (j=0; j<txtFechaSalida.value.length; j++) { 
			   //all figures and spacers in place? 
			     if ((j == 2) || (j == 5)) { 
			       if (txtFechaSalida.value.charAt(j) != "/") { 
				   	 alert("FORMATO EN CAMPO FECHA DE SALIDA ESTA VACIO");
 				     txtFechaSalida.focus();
			         return false; 
			       } 
			     } else if ((txtFechaSalida.value.charAt(j)<"0") || (txtFechaSalida.value.charAt(j)>"9")) { 
				  alert("FORMATO CAMPO FECHA DE SALIDA ES INCORRECTO");
				  txtFechaSalida.focus();
			  return false; 
		     } 
		   } 
			bits = txtFechaSalida.value.split("/"); 
			days = Number(bits[0]); 
			month = Number(bits[1]); 
			year=Number(bits[2]); 
			if (days > 31) {alert("DIA EN CAMPO FECHA DE SALIDA ES INCORRECTO");
				txtFechaSalida.focus(); return false;} 
			else if (month > 12) {alert("DIA EN CAMPO FECHA DE SALIDA ES INCORRECTO");
				txtFechaSalida.focus(); return false;} 
			else if (year != 2010) { alert("DIA EN CAMPO FECHA DE SALIDA ES INCORRECTO");
				txtFechaSalida.focus();return false;} 

		}
		document.form1.submit();
	}
