function cargaHito(annio, lang, load){
    ajax(returnCargaHito, 'thema/'+ annio +'.php?lang='+ lang +'&load='+ load);
}

function returnCargaHito(resp){
    document.getElementById('cargaHitos').innerHTML = resp;
}

function abrirVisor(e, ruta){
    newwindow = window.open("thema/vcl_visorFotos.php?photo="+ e.title +"&ruta="+ ruta ,"","width=1040,height=880,status=NO,resizable=NO,scrollbars=YES")
    newwindow.creator=self
}

var time;
var time2;

var opcion1 = 0;
// AŅADIR AQUI LAS FOTOS DE LA CARPETA (Imagenes_Pagina/carrusel);
var arrBanners = Array('02.jpg','01.jpg', '03.jpg', '04.jpg','05.jpg', '06.jpg', '07.jpg', '08.jpg', '09.jpg', '96.jpg');
function rotarBanner(){
    try{
        opcion1 = (opcion1 +1 < arrBanners.length) ? opcion1+1 : 0;

        if(opcion1%2 == 0){
            document.getElementById('fotoBanner').src = 'Imagenes_Pagina/carrusel/'+ arrBanners[opcion1];

            time2 = setInterval('desvanecimientoIMG("fotoBanner2", "off")',30);
        }
        else{
            document.getElementById('fotoBanner2').src = 'Imagenes_Pagina/carrusel/'+ arrBanners[opcion1];

            time2 = setInterval('desvanecimientoIMG("fotoBanner2", "on")',30);
        }
        
        clearInterval(time); 
    }
    catch(e){
        
    }
}

var desvanecimiento = 0;
var sinEntrar = 2;
function desvanecimientoIMG(e, tipo){
    try{
        e = document.getElementById(e);
    
        if(sinEntrar == 2){
            if(tipo == 'on') desvanecimiento = 5;
            if(tipo == 'off') desvanecimiento = 95;
            sinEntrar = 3;
        }
        
        if(desvanecimiento != 0 && desvanecimiento != 100){
            if(tipo == 'on') desvanecimiento = desvanecimiento+5;
            if(tipo == 'off') desvanecimiento = desvanecimiento-5;
            
            e.style.filter = 'alpha(opacity='+ desvanecimiento +')';
            e.style.opacity = desvanecimiento / 100;
        }
        
        if(desvanecimiento == 0 || desvanecimiento == 100){ 
            sinEntrar = 2; 
            clearInterval(time2); 
            time = setInterval('rotarBanner()',3000);
        }  
    }
    catch(e){
        
    }
}

window.onload = function() {
    time = setInterval('rotarBanner()',3000);
}
  
/*function reswidth() {
    return screen.width;
}
function resheight(){
    return screen.height;
}*/;
