function mostrarContacto(){
	window.open("contactar.html", "", 'width=480, height=320, toolbar=0,resizable=0,location=0,status=0,scrollbars=0');
}

function mostrarAviso(url){
	window.open(url, "", 'width=400, height=500, toolbar=0,resizable=0,location=0,status=0,scrollbars=0');
}


function abrir(url){
	window.open(url, '', 'width=700, height=600,resizable=1,scrollbars=1');
}

function abrirActividades(url){
	var dir = "actividades/" + url + ".php";
	window.open(dir, '', 'width=900, height=700,scrollbars=1 ');	
}


function mostrarCancion(cancion)
{
    // 1.- Creamos el objeto xmlHttpRequest
    CreateXmlHttp();
    
    // 2.- Definimos la llamada para hacer un simple GET.
    var ajaxRequest = "cancion.php?cancion=" + cancion;
	
    // 3.- Marcar qué función manejará la respuesta
    xmlHttp.onreadystatechange = escribirCancion;
  
    // 4.- Enviar
	xmlHttp.open("GET", ajaxRequest, true);
    xmlHttp.send("");
}

function escribirCancion()
{
    if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
        var div = document.getElementById("cancionesDerecha");
		var letra = "<br/>";
		div.innerHTML = letra + xmlHttp.responseText;
    }
}



function mostrarOracion(oracion){
	// 1.- Creamos el objeto xmlHttpRequest
    CreateXmlHttp();
   
    // 2.- Definimos la llamada para hacer un simple GET.
    var ajaxRequest = "oracion.php?oracion=" + oracion;
	
    // 3.- Marcar qué función manejará la respuesta
    xmlHttp.onreadystatechange = escribirOracion;
  
    // 4.- Enviar
    xmlHttp.open("GET", ajaxRequest, true);
    xmlHttp.send("");
}

function escribirOracion()
{
    if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
        var div = document.getElementById("oracionesDerecha");
		var letra = "<br/>";
		div.innerHTML = letra + xmlHttp.responseText;
    }
}


function mostrarImagen(foto)
{
	var img = "imagenes/fotos/" + foto + ".jpg";
	fin = window.open(img,'windowFotos','left=200,top=100,width=700,height=600,toolbar=0,resizable=0,location=0,status=0,scrollbars=0');
}

function trailerPelicula(titulo){
	var url = "";
	if (titulo == "bella"){
		url = "http://www.youtube.com/watch?v=xkMUo7J03QU";
	}else if (titulo == "copying"){
		url = "http://www.youtube.com/watch?v=1O1PUXPcz6g";
	}else if (titulo == "pruebaDeFuego"){
		url = "http://www.youtube.com/watch?v=utKNzSA49qU";
	}else if (titulo == "laUltimaCima"){
		url = "http://www.youtube.com/watch?v=HSOcooyH_Fc&feature=related";
	}else if (titulo == "invictus"){
		url = "http://www.youtube.com/watch?v=zk9lt4SkwG4";
	}else if (titulo == "narnia"){
		url = "http://www.youtube.com/watch?v=k9OucvlJAcU";
	}else if (titulo == "leones"){
		url = "http://es.youtube.com/watch?v=iVvwoPTIL5c";
	}else if (titulo == "family"){
		url = "http://es.youtube.com/watch?v=YGPVCKph8_s&feature=related";
	}else if (titulo == "oh"){
		url = "http://es.youtube.com/watch?v=y_bPYTLJIDE";
	}else if (titulo == "cometas"){
		url = "http://es.youtube.com/watch?v=8IDO18mVqPo";
	}else if (titulo == "cadena"){
		url = "http://es.youtube.com/watch?v=fhane7ji8pI";
	}else if (titulo == "pasion"){
		url = "http://es.youtube.com/watch?v=ITcHyWlUODI";
	}else if (titulo == "escafandra"){
		url = "http://es.youtube.com/watch?v=WS984Ri6Ngc";
	}else if (titulo == "vida"){
		url = "http://es.youtube.com/watch?v=9R91nhL3Chk";
	}else if (titulo == "indomable"){
		url = "http://es.youtube.com/watch?v=z02M3NRtkAA";
	}else if (titulo == "diarios"){
		url = "http://es.youtube.com/watch?v=dCymgLz_w3w";
	}else if (titulo == "enBusca"){
		url = "http://www.youtube.com/watch?v=AOA9H1jruUY";
	}else if (titulo == "descubriendo"){
		url = "http://www.youtube.com/watch?v=1QwM_viT5js";
	}else if (titulo == "titanes"){
		url = "http://www.youtube.com/watch?v=4lxPPa--NLo";
	}else if (titulo == "cinderella"){
		url = "http://www.youtube.com/watch?v=DlbHzcH4VJY";
	}else if (titulo == "pianista"){
		url = "http://www.youtube.com/watch?v=itR0-I9idXk";
	}else
alert(titulo);
	
	window.open(url, '', 'width=700, height=600');
}

function visitarLugar(lugar){
	var url = "";
	if (lugar == "toledo"){
		url = "http://www.architoledo.org/catedral/Default.htm";
	}else if (lugar == "guadalupe"){
		url = "http://www.monasterioguadalupe.com/";
	}else if (lugar == "segovia"){
		url = "http://www.arteguias.com/catedral/segovia.htm";
	}else if (lugar == "cerro"){
		url = "http://es.wikipedia.org/wiki/Cerro_de_los_%C3%81ngeles";
	}
	window.open(url, '', 'width=1000, height=600, scrollbars=1');
}

function visitarPagina(lugar){
	var url = "";
	if (lugar == "arvo"){
		url = "http://www.arvo.net";
	}else if (lugar == "manosUnidas"){
		url = "http://www.manosunidas.org";
	}else if (lugar == "caritas"){
		url = "http://www.caritas.es";
	}else if (lugar == "mercaba"){
		url = "http://www.mercaba.org";
	}else if (lugar == "catholic"){
		url = "http://www.es.catholic.net/";
	}else if (lugar == "misas"){
		url = "http://www.misas.org/";
	}else if (lugar == "derecho"){
		url = "http://www.derechoavivir.org/";
	}else if (lugar == "wikipedia"){
		url = "http://es.wikipedia.org/wiki/Carranque";
	}	
	window.open(url, '', 'width=1000, height=900, scrollbars=1,resizable=1');
}

var xmlHttp;
function CreateXmlHttp(){
    // Probamos con IE
    try{
        // Funcionará para JavaScript 5.0
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e){
        try{
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(oc){  
            xmlHttp = null;
        }
    }
    // Si no se trataba de un IE, probamos con esto
    if(!xmlHttp && typeof XMLHttpRequest != "undefined"){
        xmlHttp = new XMLHttpRequest();
    }
	return xmlHttp;
}

