$(document).ready(function()
{
    
    var globalTime = 300;
    
    // ---------------------------------------------------------------------- \\
    // --- navigation --- \\
    
    function menuToggle(item,list)
    {
        $(list).slideToggle(globalTime, function()
        {
            if($(list).is(":visible"))
            {
                $(item).css(
                {
                    "list-style-image" : "url(images/navCollapse.gif)",
                    "list-type" : "disc"
                });
            }
            else if($(list).is(":hidden"))
            {
                $(item).css(
                {
                    "list-style-image" : "url(images/navExpand.gif)",
                    "list-type" : "circle"
                });
            }
        });
    }
    
    $('#navAbout').click(function()
    {
        menuToggle('#navAbout','#navAboutList');
    });
    
    $('#navDev').click(function()
    {
        menuToggle('#navDev','#navDevList');
    });
    
    $('#navMat').click(function()
    {
        menuToggle('#navMat','#navMatList');
    });
    
    $('#navPrayer').click(function()
    {
        menuToggle('#navPrayer','#navPrayerList');
    });
    
    $('#navServe').click(function()
    {
        menuToggle('#navServe','#navServeList');
    });
    
    // ---------------------------------------------------------------------- \\
    // --- home page rotator --- \\
    
    // JAVASCRIPT VARS
    // cache buster
    var cacheBuster = "?t=" + Date.parse(new Date());
    // stage dimensions		
    var stageW = "640";//"100%";
    var stageH = "120";//"100%";
    
    
    // ATTRIBUTES
    var attributes = {};
    attributes.id = 'homeRotoator';
    attributes.name = 'homeRotoator';
    
    // PARAMS
    var params = {};
    params.bgcolor = "#ffffff";
    params.menu = "false";
    params.scale = 'noScale';
    params.wmode = "transparent";
    params.allowfullscreen = "true";
    params.allowScriptAccess = "always";			
    
    
    /* FLASH VARS */
    var flashvars = {};
    
    /// if commented / delete these lines, the component will take the stage dimensions defined 
    /// above in "JAVASCRIPT SECTIONS" section or those defined in the settings xml
    flashvars.componentWidth = stageW;
    flashvars.componentHeight = stageH;
    
    /// path to the content folder(where the xml files, images or video are nested)
    /// if you want to use absolute paths(like "http://domain.com/images/....") then leave it empty("")			
    flashvars.pathToFiles = "flash/homeRotator/banner/";
    
    // path to content XML
    flashvars.xmlPath = "xml/banner.xml";
    
    
    /** EMBED THE SWF**/
    swfobject.embedSWF("flash/homeRotator/homeRotator.swf"+cacheBuster, attributes.id, stageW, stageH, "9.0.124", "js/expressInstall.swf", flashvars, params, attributes);

});
