var enlaces = new Array();
function lanzar(pagina) {
	if ((navigator.appName.indexOf('etscape') == -1) && document.getElementsByTagName("A")[0].src) {
		enlaces = document.getElementsByTagName("A");
		window.open(enlaces[0].src, "_blank", "width=793, height=543, top=0, left=0, resizable=yes, scrollbars=no, menubar=no, toolbar=no, status=no, location=no");
	}
	else {
		if (pagina == "inicio/inicio.htm") {
		window.open(pagina, "_blank", "width=793, height=543, top=0, left=0, resizable=yes, scrollbars=no, menubar=no, toolbar=no, status=no, location=no");
		}
		if (pagina == "index.htm") {
		window.open(pagina, "_top", "resizable=yes, scrollbars=no, menubar=no, toolbar=no, status=no, location=no");
		window.moveTo(33, 20);
		window.resizeTo(730, 485);
		}
	}
}

function cerrar()
{
	self.close()
}

function cargar(pag)
{
	window.open(pag,"principal","")
}

function barrabien() 
{
window.defaultStatus = "BIENVENIDOS A ''EL BUEN PASTOR NETWORK'' - SITIO PERSONAL SIN FINES DE LUCRO";
}

function barra()
{
	var hoy = new Date();
	var anio = hoy.getYear();
	var mName = hoy.getMonth() + 1;
	var dName = hoy.getDay() + 1;
	var diaNr = ((hoy.getDate()<10) ? "" : "") + hoy.getDate();
	if(dName==1) Dia = "Domingo";
	if(dName==2) Dia = "Lunes" ;
	if(dName==3) Dia = "Martes";
	if(dName==4) Dia = "Miércoles";
	if(dName==5) Dia = "Jueves";
	if(dName==6) Dia = "Viernes";
	if(dName==7) Dia = "Sábado";
	if(mName==1) Mes = "Enero" ;
	if(mName==2) Mes = "Febrero";
	if(mName==3) Mes = "Marzo" ;
	if(mName==4) Mes = "Abril" ;
	if(mName==5) Mes = "Mayo" ;
	if(mName==6) Mes = "Junio" ;
	if(mName==7) Mes = "Julio" ;
	if(mName==8) Mes = "Agosto";
	if(mName==9) Mes = "Septiembre";
	if(mName==10) Mes = "Octubre";
	if(mName==11) Mes = "Noviembre";
	if(mName==12) Mes = "Diciembre";

	window.defaultStatus = "BIENVENIDO A ''EL BUEN PASTOR NETWORK'' - " + "Hoy: " + Dia + " " + diaNr + " de " + Mes + " de " + anio + "."
}

<!-- Impresión del Marco Pricipal
function imprimir()
{
	parent.principal.focus();
	parent.principal.print()
}
//-->

<!-- Calendario Completo de Tiempo Real ddffmmaa
function LanzarCalendario()
{
	var hoy = new Date(); 
	var Anio = hoy.getYear(); 
	var MesN = hoy.getMonth() + 1; 
	var FechaN = ((hoy.getDate()<10) ? "" : "")+ hoy.getDate(); 
	var DiaN = hoy.getDay();

	if(MesN==1) Mes="enero"; 
	if(MesN==2) Mes="febrero"; 
	if(MesN==3) Mes="marzo"; 
	if(MesN==4) Mes="abril"; 
	if(MesN==5) Mes="mayo"; 
	if(MesN==6) Mes="junio"; 
	if(MesN==7) Mes="julio"; 
	if(MesN==8) Mes="agosto"; 
	if(MesN==9) Mes="setiembre"; 
	if(MesN==10) Mes="octubre"; 
	if(MesN==11) Mes="noviembre"; 
	if(MesN==12) Mes="diciembre"; 
	if(DiaN==1) Dia="Lunes"; 
	if(DiaN==2) Dia="Martes"; 
	if(DiaN==3) Dia="Miércoles"; 
	if(DiaN==4) Dia="Jueves"; 
	if(DiaN==5) Dia="Viernes"; 
	if(DiaN==6) Dia="Sábado"; 
	if(DiaN==0) Dia="Domingo"; 

	document.Calendario.FechadeHoy.value = (Dia + ", " + FechaN + " de " + Mes + " de " + Anio) 
}
//-->

<!--Reloj de 24 Horas de Tiempo Real hhmmss
function showFilled(Value)
{
	return (Value > 9) ? "" + Value : "0" + Value;
}

function LanzarReloj24()
{
	Ahora = new Date;
	document.Reloj.HoraActual.value = "  " + showFilled(Ahora.getHours()) + ":" + showFilled(Ahora.getMinutes()) + ":" +   	showFilled(Ahora.getSeconds());
	setTimeout("LanzarReloj24()",1000)
}
//-->

function bienvenida()
{
	function GetCookie(nombre)
	{
		var Arg = nombre + "="
		var longArg = Arg.length
		var longCookie = document.cookie.length
		var i = 0
		while ( i < longCookie)
		{
			if (document.cookie.substring(i, i + longArg ) == Arg)
				return true
			i = document.cookie.indexOf(" ", i) + 1
			if (i == 0)
				break
		}
	return false
	}

	function Caduca(dias)
	{
		var hoy = new Date()			//recoge la fecha actual
		var msEnXDias = eval(dias) * 24 * 60 * 60 * 1000	//pasa los dias a mseg.
		hoy.setTime(hoy.getTime() + msEnXDias)	//fecha de caducidad: actual + caducidad
		return (hoy.toGMTString())
	}

              var visitado = GetCookie("visitado")
              if ( !visitado )
	{
		var archivo = window.location.href;
		var barra = archivo.lastIndexOf("/");
		var direccion =  archivo.substring(0, barra+1) + "inicio/introito-popup.htm";
		var caducidad = Caduca(31)
		var galleta = "visitado=1; expires=" + caducidad + "; path=/"
		document.cookie = galleta
		window.open(direccion, "","width=530,height=440,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no")
	}
}

function isMail(Cadena)
{
	Punto = Cadena.substring(Cadena.lastIndexOf('.') + 1, Cadena.length)		// Cadena del .com
	Dominio = Cadena.substring(Cadena.lastIndexOf('@') + 1, Cadena.lastIndexOf('.')) 	// Dominio @lala.com
	Usuario = Cadena.substring(0, Cadena.lastIndexOf('@'))				// Cadena lalala@
	Reser0 = " àèìòùÁÉÍÓÚÀÈÌÒÙäâëêïîöôüûÄÂËÊÏÎÖÔÜÛÑñ´`¨=|"
	Reserv = "@/º\"\'+*{}\\<>?¿[]áéíóú#·¡!^*;,:" + Reser0				// Letras Reservadas
	ReserU = "." + Reserv
	
	// Añadida por El Codigo para poder emitir un alert en funcion de si email valido o no
	valido = true
	
	// verifica que el Usuario no tenga un caracter especial
	for (var Cont=0; Cont<Usuario.length; Cont++)
	{
		X = Usuario.substring(Cont,Cont+1)
		if (ReserU.indexOf(X)!=-1)
                	valido = false
	}

	// verifica que el Punto no tenga un caracter especial
	for (var Cont=0; Cont<Punto.length; Cont++)
	{
		X=Punto.substring(Cont,Cont+1)
		if (Reserv.indexOf(X)!=-1)
			valido = false
	}
                        
	// verifica que el Dominio no tenga un caracter especial
	for (var Cont=0; Cont<Dominio.length; Cont++)
	{
		X=Dominio.substring(Cont,Cont+1)
		if (Reserv.indexOf(X)!=-1)
			valido = false
	}

	// Verifica la sintaxis básica.....
	if (Punto.length<2 || Dominio <1 || Cadena.lastIndexOf('.')<0 || Cadena.lastIndexOf('..')>0 || Cadena.lastIndexOf('@.')>0 || Cadena.lastIndexOf('@')<0 || Usuario<1)
	{
		valido = false
	}
	
	// Añadido por El Código para que emita un alert de aviso indicando si email válido o no
	if (valido)
	{
		alert('Email válido.')
		return true	//cambiar por return true para hacer el submit del formulario en caso de validacion correcta
	}
	else
	{
		alert('Email no válido. Verifique, por favor.')
		return false
	}
}