function validarEmail(valor,alerttxt) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    return (true);
  } else {
   alert(alerttxt);
   return (false);
  }
 }

function validate_required(field,alerttxt)
  {
	with (field)
  {
	if (value==null||value=="")
       {alert(alerttxt);return false}
    else {return true}
	}
}

function validate_form(thisform,i)
{
	with (thisform)
		{
			if (validate_required(Nombre,"Por favor llene el siguiente campo: Nombre")==false)
  				{Nombre.focus();return false}
			if (validate_required(FechaNacimiento,"Por favor llene el siguiente campo: Fecha de Nacimiento")==false)  				{FechaNacimiento.focus();return false}
			if (validate_required(Lugar,"Por favor llene el siguiente campo: Lugar de Residencia")==false)
  				{Lugar.focus();return false}
			if (validate_required(Telefono,"Por favor llene el siguiente campo: Telefono")==false)
  				{Telefono.focus();return false}
			if (validarEmail(Email.value,"Favor de escribir un correo electronico valido.")==false)
				{Email.focus();return false}   			
			if (validate_required(Nivel,"Por favor llene el siguiente campo: Nivel de Conocimiento")==false)
  				{Nivel.focus();return false}
			if (validate_required(Duracion,"Por favor llene el siguiente campo: Fechas Aproximadas")==false)
  				{Duracion.focus();return false}
			if (validate_required(Instituto,"Por favor llene el siguiente campo: Instituto de Preferencia")==false)
  				{Instituto.focus();return false}
			if (validate_required(Frecuencia,"Por favor llene el siguiente campo: Frecuencia de Horas Lectivas Semanales")==false)
  				{Frecuencia.focus();return false}
			if (validate_required(Alojamiento,"Por favor llene el siguiente campo: Alojamiento")==false)
  				{Alojamiento.focus();return false}	
			else {document.forms.form1.submit();}
		}
}