 
function initPage()
{
	//	alert("llega?")
	var http_request = false;

	var url = "http://www.tvanime.es/informe.xml";
	makeRequest(url)
    function makeRequest(url) {

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Falla :( No es posible crear una instancia XMLHTTP');
            return false;
        }


		
        http_request.onreadystatechange =  parsear;
		try{
		
			http_request.open('GET', url, true);
        }
		catch(e){
			//alert(e)
		}
		http_request.send(null);

    }


	function parsear ()
	{
		var contenido, preloader;
        contenido = document.getElementById('conConexion');
        preloader = document.getElementById('sinConexion');
		

		if(http_request.readyState==4)
		{
			
			if(http_request.status==200)
			{				
				
			
				var xml  = http_request.responseXML.documentElement;//mensaje, mensaje, texto	     
				var info = document.getElementById('datos');	
				
				var recogerInfo="<span class='newSeries'><marquee behavior='scroll' direction='up' style='position:relative; top:-70px;  left:340px; width:180px; height:100px;' scrollamount='1'>";

				var nombre ="";
				var link="";
				var cap ="";
				var fecha="";
				
				recogerInfo+="<span style='color: red; margin-left: 5px; font-size:11px; width:180px; display: block;'>&Uacute;ltimos 10 cap&iacute;tulos a&ntilde;adidos</span></br>";

				var min = xml.getElementsByTagName('entrada').length - 10;
				
				for (var i = xml.getElementsByTagName('entrada').length; i > min ; i--)
				{			
					var listaNodos = xml.getElementsByTagName('entrada')[i-1].childNodes;
					nombre= xml.getElementsByTagName('entrada')[i-1].childNodes[0].firstChild.nodeValue;	
					link= xml.getElementsByTagName('entrada')[i-1].childNodes[1].firstChild.nodeValue;	
					cap= xml.getElementsByTagName('entrada')[i-1].childNodes[2].firstChild.nodeValue;		
					fecha= xml.getElementsByTagName('entrada')[i-1].childNodes[3].firstChild.nodeValue;		
					recogerInfo +="<span style='color: silver; margin-left:50px; display: block;'>"+fecha+"</span></br>";
					recogerInfo +="<a style='margin-left:0px; margin-right:0px; width:180px; display: block; text-align: center;' class='newSeries' href='"+link+"'title='"+nombre+"'>"+nombre+" "+cap+"<a/></br>";				
					recogerInfo +="<span style='margin-left:90px'><img src='imagenes/esfera.png'></span><br>";						
				}
					
				recogerInfo+="</marquee></span>";
				info.innerHTML = recogerInfo;	

			}
			else {
				//alert("fallo peticion: "+http_request.status)
			}
		}
		
	}
		
		
		
		
		
}
