/*
 * Fonctions lancées au démarrage
 */

function changeSecureImage(relative) {
    $("#captcha").attr("src",relative+"/wm-public/tools/securimage/securimage_show.php?sid=" + Math.random());
    return false;
}

$(document).ready( function () {
    
        if($(".item a").length>0) {

                $(".portfolio a").lightBoxPortFolio({
                    overlayBgColor: "#000",
                    containerResizeSpeed: 350,
					imageLoading: '../images/template/lightbox/loading.gif',
					imageBtnClose: 'images/template/lightbox/close.gif',
					imageBtnPrev: '../images/template/lightbox/btn-prev.gif',
					imageBtnNext: '../images/template/lightbox/btn-next.gif',
                    txtImage: "",
                    txtOf: "/"
                });

                $("a.portfolio").lightBoxPortFolio({
                    overlayBgColor: "#000",
                    containerResizeSpeed: 350,
					imageLoading: '../images/template/lightbox/loading.gif',
					imageBtnClose: 'images/template/lightbox/close.gif',
					imageBtnPrev: '../images/template/lightbox/btn-prev.gif',
					imageBtnNext: '../images/template/lightbox/btn-next.gif',
                    txtImage: "",
                    txtOf: "/"
                });
        }

        $(".directories").click(function(){

            $(".directories").removeClass("active");
            $(this).addClass("active");

            $.ajax({
                type: "POST",
                url: urlConfig+"/wm-public/scripts/getByDirectory.ajax.php",
                data: "directoryToDisplay="+$(this).attr("id"),
                success: function(data){
                    $("#scrollBar").html('<div id="scrollBarInvisble" style="width:600px;"></div>');
                    $("#slider").html(data).delay("500");
                    initScrollerBar ();
                    initALL();
                }
            });

        });
});
