function initNav(nodeID, hasChildren, displayEffect) {
    
    if (hasChildren)
    {
        myStretch = [document.getElementById('stretch'+nodeID)];
        myStretcher = [document.getElementById('stretcher'+nodeID)];
        
        if (displayEffect) {
            // Create the accordian, initializing with zero delay and duration to make initial toggle invisible:
            myAccordion = new fx.Accordion(myStretch, myStretcher, {opacity: false, duration: 500, delay: 100, transition: fx.linear});
            myStretcher[0].style.display="block";
            myAccordion.showThisHideOpen(myStretcher[0]);
        } else {
            myStretcher[0].style.display="block";
            myStretcher[0].style.height = myStretcher[0].scrollHeight + 'px';
            //myStretcher[0].o.toggle();
        }
    }
}

function selectButton(distributionName, id, image) {
    var selectedImage = image.substr(0,image.indexOf('.')) + 'Selected.gif';
    MM_swapImage('imageID'+id,'','/App_Themes/Default/Images/Buttons/Navigation/'+distributionName+'/'+selectedImage,1);
}

function hoverMenu(element) 
{
    element.style.backgroundColor="#bd0a18";
}

function unhoverMenu(element) 
{
    element.style.backgroundColor="transparent";
}

function showChannelSelector() 
{
    document.getElementById("channelSelectorPopup").style.visibility="visible";   
    document.getElementById("channelSelectorPopupLink").style.color="#FFFFFF";
    document.getElementById("channelSelectorPopupLink").style.backgroundColor="#bd0a18";
}

function hideChannelSelector() 
{
    document.getElementById("channelSelectorPopup").style.visibility="hidden";   
    document.getElementById("channelSelectorPopupLink").style.color="#000000";
    document.getElementById("channelSelectorPopupLink").style.backgroundColor="transparent";
}