function ExecLighBox(){
    var Box = document.getElementById("LightBox");
    setTimeout("AnimacionLightBox('Abrir',0)",30);
    document.body.style.overflow = "hidden";
}

function CerrarLightBox(){
    if(navigator.appName == "Microsoft Internet Explorer"){
        setTimeout("AnimacionLightBox('Cerrar',100)",20)
    }else{
        setTimeout("AnimacionLightBox('Cerrar',1)",20)
    }
    document.body.style.overflow = "auto";
}

function AnimacionLightBox(Instancia,Transparencia){
    var Box = document.getElementById("LightBox");
    
    if(navigator.appName == "Microsoft Internet Explorer"){
        var incremento = 10;
        var Condicion = 100;
    }else{
        var incremento = 0.1;
        var Condicion = 1;
    }
    var repetir = true;
    if( Instancia == "Abrir"){
        if (Transparencia < Condicion || Transparencia < Condicion){
            Transparencia+=incremento;
            Box.style.opacity = Transparencia;
            Box.style.filter = "alpha(opacity ="+ Transparencia+")";
            document.getElementById("LightBox").style.display = "block";
        }else{
            repetir =false;
        }
    }else{
        if (Transparencia > 0){
            Transparencia-=incremento;
            Box.style.opacity = Transparencia;
            Box.style.filter = "alpha(opacity ="+ Transparencia+")";
        }else{
            repetir =false;
            document.getElementById("LightBox").style.display = "none";
            //document.body.removeChild(Box);
        }
    }
    if(repetir){
        setTimeout("AnimacionLightBox('"+Instancia+"',"+Transparencia+")",30);
    }
    
}
