function finishMenus() {
    $(".menubar").buildMenu({
        template:"menu.htm",
        openOnRight:false,
        menuSelector: ".menuContainer",
        iconPath:"images/",
        hasImages:true,
        fadeInTime:100,
        fadeOutTime:300,
        adjustLeft:2,
        minZindex:"auto",
        adjustTop:10,
        opacity:.95,
        shadow:true,
        openOnClick:false,
        closeOnMouseOut:true,
        closeAfter:1500,
        hoverIntent: 100
    });
}

// Expand include files; execute on_include sections
function expandIncludes(onLoaded) {
    $(".js_include").each(
        function() {
            var uri = document.URL;
            uri = uri.replace(/[^\/\\]+?(\?.*)?$/, "");
            uri += $(this).attr("include");//debug + "?t=" + Math.random();
            $(this).removeClass("js_include");
            $(this).load(
                uri, '',
                function (responseText, textStatus, XMLHttpRequest) {
                    if (onLoaded)
                        onLoaded();
                });
        });
}

$(document).ready(
    function() {
        $('body').gradient({ from: 'fbfed6', to: 'a0b551'/*778c46*/ });
        expandIncludes(function() { finishMenus() });
    });
