function NuevoAjax(){
var xmlhttp=false;
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}

if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}

function Cargar(url, channel){
var contenido, preloader;
contenido = document.getElementById(channel);
preloader = document.getElementById('loading_cont');
//creamos el objeto XMLHttpRequest
ajax= new NuevoAjax();
//peticionamos los datos, le damos la url enviada desde el link
ajax.open("GET", url, true);
ajax.onreadystatechange=function(){
if(ajax.readyState==1){
contenido.innerHTML = preloader.innerHTML
document.getElementById('contenido_preload').style.display = 'none';
document.getElementById('loading_cont').style.display = 'block';
//modificamos el estilo de la div, mostrando una imagen de fondo
//preloader.style.background = "url('loading.gif') no-repeat";
}else if(ajax.readyState==4){
    	if(ajax.status==200){
//mostramos los datos dentro de la div
contenido.innerHTML = ajax.responseText;
if (ajax.readyState==4){
document.getElementById('loading_cont').style.display = 'none';
document.getElementById('contenido_preload').style.display = 'block';

  }
document.body.style.display = 'block';
readchannels();
//preloader.innerHTML = "Cargado.";
//preloader.style.background = "url('loaded.gif') no-repeat";
}else if(ajax.status==404){
preloader.innerHTML = "La página no existe";
}else{
//mostramos el posible error
preloader.innerHTML = "Error:".ajax.status;
}
}
}
ajax.send(null);
}



function actua(url, channel) {
this.url = url;
this.channel = channel;
}

carga = new Array();

cargaActual = 0;
carga[0] = new actua("../../rss/bloque_noticias.php", "rsschannel");


function readchannels() {
if (cargaActual < carga.length) Cargar(carga[cargaActual].url, carga[cargaActual++].channel);
//Cargar("../../rss/bloque_tips.php", "capa1");
}


window.onload = readchannels;




