function verifica() {
if ((document.enviar.nombre.value == '') || (document.enviar.nombre.value == null)) {
alert('Debes indicar un nombre de contacto'); 
document.enviar.nombre.focus();
return false;
}
else
if ((document.enviar.email.value == '') || (document.enviar.email.value == null)) {
alert('Debes indicar tu correo electónico'); 
document.enviar.email.focus();
return false;
}
else if (document.enviar.email.value!='')
{
var s = document.enviar.email.value;
var filter=/^[A-Za-z0-9-.][A-Za-z0-9-._]*@[A-Za-z0-9-\-._]+\.[A-Za-z0-9_.]+[A-za-z]$/;
if (s.length == 0 ) return true;
if (filter.test(s))
return true;
else
alert('Ingresa una dirección de correo válida');
document.enviar.email.focus();
return false;
}
return true;
}
//nivel
function verifica_nivel() {
if ((document.nivel.nombre.value == '') || (document.nivel.nombre.value == null)) {
alert('Debes indicar tu nombre'); 
document.nivel.nombre.focus();
return false;
}
else 
if ((document.nivel.email.value == '') || (document.nivel.email.value == null)) {
alert('Debes indicar tu correo electónico'); 
document.nivel.email.focus();
return false;
}
else if ((document.nivel.telefono.value == '') || (document.nivel.telefono.value == null)) {
alert('Debes indicar tu telefono'); 
document.nivel.telefono.focus();
return false;
}
else if (document.nivel.email.value!='')
{
var s = document.nivel.email.value;
var filter=/^[A-Za-z0-9-.][A-Za-z0-9-._]*@[A-Za-z0-9-\-._]+\.[A-Za-z0-9_.]+[A-za-z]$/;
if (s.length == 0 ) return true;
if (filter.test(s))
return true;
else
alert('Ingresa una dirección de correo válida');
document.nivel.email.focus();
return false;
}
return true;
}
//matricula
function verifica_matr() {
if ((document.matricula.nombre.value == '') || (document.matricula.nombre.value == null)) {
alert('Debes indicar tu nombre'); 
document.matricula.nombre.focus();
return false;
}
else 
if ((document.matricula.apellidos.value == '') || (document.matricula.apellidos.value == null)) {
alert('Debes indicar tus apellidos'); 
document.matricula.apellidos.focus();
return false;
}
else 
if ((document.matricula.telefono.value == '') || (document.matricula.telefono.value == null)) {
alert('Debes indicar tu telefono'); 
document.matricula.telefono.focus();
return false;
}
else
if ((document.matricula.nacionalidad.value == '') || (document.matricula.nacionalidad.value == null)) {
alert('Debes indicar tu nacionalidad'); 
document.matricula.nacionalidad.focus();
return false;
}
else 
if ((document.matricula.leng_mat.value == '') || (document.matricula.leng_mat.value == null)) {
alert('Debes indicar tu lengua materna'); 
document.matricula.leng_mat.focus();
return false;
}
else 
if ((document.matricula.direccion.value == '') || (document.matricula.direccion.value == null)) {
alert('Debes indicar tu direccion'); 
document.matricula.direccion.focus();
return false;
}
else 
if ((document.matricula.poblacion.value == '') || (document.matricula.poblacion.value == null)) {
alert('Debes indicar tu poblacion'); 
document.matricula.poblacion.focus();
return false;
}
else 
if ((document.matricula.fecha_inicio.value == '') || (document.matricula.fecha_inicio.value == null)) {
alert('Debes indicar la fecha de inicio del curso'); 
document.matricula.fecha_inicio.focus();
return false;
}
else 
if ((document.matricula.horas.value == '') || (document.matricula.horas.value== null)) {
alert('Debes indicar el numero de horas de clases a la semana'); 
document.matricula.horas.focus();
return false;
}
else 
if ((document.matricula.dias.value == '') || (document.matricula.dias.value == null)) {
alert('Debes indicar los dias y las horas a la semana para realizar el curso'); 
document.matricula.dias.focus();
return false;
}
else 
if ((document.matricula.dias.value == '') || (document.matricula.dias.value == null)) {
alert('Debes indicar los dias y las horas a la semana para realizar el curso'); 
document.matricula.dias.focus();
return false;
}
else 
if ((document.matricula.tipo.value == '') || (document.matricula.tipo.value == null)) {
alert('Debes indicar el tipo de curso'); 
document.matricula.tipo.focus();
return false;
}
else
if (document.matricula.condiciones.checked==false) 	{
alert('Debes leer y aceptar las condiciones generales de matricula');
document.matricula.condiciones.focus();
return false;
}
else 
if ((document.matricula.email.value == '') || (document.matricula.email.value == null)) {
alert('Debes indicar tu correo electónico'); 
document.matricula.email.focus();
return false;
}
else if (document.matricula.email.value!='')
{
var s = document.matricula.email.value;
var filter=/^[A-Za-z0-9-.][A-Za-z0-9-._]*@[A-Za-z0-9-\-._]+\.[A-Za-z0-9_.]+[A-za-z]$/;
if (s.length == 0 ) return true;
if (filter.test(s))
return true;
else
alert('Ingresa una dirección de correo válida');
document.matricula.email.focus();
return false;
}
return true;
}

function mostrar(textoid)
{
switch (textoid)
{
case "otros":
if (document.enviar.form_origen.value=="Otros") {
document.getElementById("otros").style.display="inline";
}
else {
document.getElementById("otros").style.display="none";
}
break;
}
}


function Abrir_ventana (pagina) {
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=508, height=365, top=85, left=140";
window.open(pagina,"Navidad Links&Lynx",opciones);
}


