function initialize_full_screen_gallery(APP_ROOT, minwidth)
{
    Galleria.loadTheme(APP_ROOT + 'media/photo-gallery/fullscreen/galleria.fullscreen.js');
    
    minwidth = typeof(minwidth) != 'undefined' ? minwidth : 150;
    
    gal = $('#galleria').galleria
    ({
        autoplay   : 8000,
        frame      : false,
        thumbnails : false,
        transition : "flash",
        on_image   : function(image, thumbnail) 
        {
            var index = $(".galleria-counter .current").text() - 1;

            $("#galleria-nav ul li").each(function()
            {
                if( index == $(this).index())
                {
                    $(this).find("div").addClass("selected");
                }
                else 
                {
                    $(this).find("div").removeClass("selected");
                }
            });

            $("#galleria-nav .legend").text($(".galleria-info-description").text());
        }
    });

    // create nav
    if($("#galleria-nav"))
    {
        d = $("<div>").appendTo("div#galleria-nav .middle");
        d.addClass('legend');
        $("div#galleria-nav .middle").append("<ul>");

        var l = $("div#galleria img").length;
        for (var i = 0; i < l; i++) 
        {  
            elem = $("<li></li>").appendTo("div#galleria-nav ul");
            $("<div></div>").appendTo(elem);

            elem.click(function()
            {
                gal.show($(this).index());
            });
        }

        $("div#galleria-nav ul li:last").addClass('last');
        var midWidth = (30 * l) + (10 * (l-1));
        $("div#galleria-nav .middle ul").css({"width" : midWidth + "px"});
        midWidth = Math.max(minwidth, midWidth);

        if(typeof(galleriaNavWidth) != 'undefined') {
            midWidth = galleriaNavWidth;
        }

        $("div#galleria-nav").css({"width" : 42 + midWidth + 42 + "px"});   

        $("div#galleria-nav div.middle").append("<div class=\"clear\"></div>");

        $("div#galleria-nav div.middle").css({"width" : midWidth + "px"});  

        $(".left-button").click(function()
        {
            gal.prev();
        });

        $(".right-button").click(function()
        {
            gal.next();
        });
    }
}
