

function getPhoto(photoName) {
    texto = photoName.replace('_mini', '');
    var actual_photo  = document.getElementById("actual_photo");
    actual_photo.innerHTML = "<img id=\"myImage\" src=\""+texto+"\" alt=\""+actual_photo+"\" style=\"filter:alpha(opacity=0); opacity:0.0;\">";
    fadeIn('myImage');
};


function loadPhotos() {
    var numeroFotos = 25;
    var video_catalog  = document.getElementById("video_slider");
    texto = "";
    
    for (i=1; i<=numeroFotos; i++) {
        texto += "<a border=\"0\" href=\"#\">";
        if (i % 2 == 0) {
            texto += "<img src=\"album/Foto_"+i+"_mini.jpg\" " +
                    "     id=\"Foto_"+i+"_mini\"" +
                    "     alt=\"Foto_"+i+"_mini\"" +
                    "     style=\"float:right;\"" +
                    "     onclick=\"getPhoto(this.src);\"" +
                    "></img>";
        } else {
            texto += "<img src=\"album/Foto_"+i+"_mini.jpg\" " +
                    "     alt=\"Foto_"+i+"_mini\"" +
                    "     style=\"float:left;\"" +
                    "     onclick=\"getPhoto(this.src);\"" +
                    "></img>";
        }
        texto += "</a>";
    }
    video_catalog.innerHTML = texto;
    video_catalog.scrollTop = 0;
};


var AccionAlbum = ""; 


function SubirAlbum(cantidad) {
    var video_catalog  = document.getElementById("video_slider");
    video_catalog.scrollTop = Math.max(video_catalog.scrollTop - cantidad, 0);
}

function BajarAlbum(cantidad) {
    var video_catalog  = document.getElementById("video_slider");
    video_catalog.scrollTop = Math.min(video_catalog.scrollTop + cantidad,
                                       video_catalog.scrollHeight);
}


function scrollUp () {
    AccionAlbum = setInterval("SubirAlbum(5)",30);
}


function scrollDown () {
    AccionAlbum = setInterval("BajarAlbum(5)",30);
}


function scrollStop () {
    clearInterval(AccionAlbum);
}





function fadeIn(nombre) {
    var imagen = document.getElementById(nombre);
    if (imagen.style.filter) {
        var opacidad = imagen.style.filter.replace('alpha(opacity=','');
        opacidad = opacidad.replace(')','');
        if (eval(opacidad) < 100) {
            opacidad = eval(opacidad) + 5;
            imagen.style.filter = "alpha(opacity="+opacidad+")";
            setTimeout("fadeIn('"+nombre+"')",50);
        };

    } else if (imagen.style.opacity) {
        if (imagen.style.opacity < 1.0) {
            imagen.style.opacity = eval(imagen.style.opacity) + 0.05;
            setTimeout("fadeIn('"+nombre+"')",50);
        };
    };
};



function fadeOut(nombre) {
    var imagen = document.getElementById(nombre);
    if (imagen.style.filter) {
        var opacidad = imagen.style.filter.replace('alpha(opacity=','');
        opacidad = opacidad.replace(')','');
        if (eval(opacidad) > 0) {
            opacidad = eval(opacidad) - 5;
            imagen.style.filter = "alpha(opacity="+opacidad+")";
            setTimeout("fadeOut('"+nombre+"')",50);
        };

    } else if (imagen.style.opacity) {
        if (imagen.style.opacity > 0.0) {
            imagen.style.opacity = eval(imagen.style.opacity) - 0.05;
            setTimeout("fadeOut('"+nombre+"')",50);
        };
    };
};



function disappear(nombre) {
    var imagen = document.getElementById(nombre);
    if (imagen.style.filter) {
        imagen.style.filter = "alpha(opacity=0)";
    } else if (imagen.style.opacity) {
        imagen.style.opacity = 0.0;
    };
};

