function toggle(menu) {
    for( var i=0; i < menu.childNodes.length; i++ ) {
        if( menu.childNodes[i].nodeName == "UL" ) {
            menu.childNodes[i].style.display = "block";
        }
    }
}
    

function untoggle(menu) {
    for( var i=0; i < menu.childNodes.length; i++ ) {
        if( menu.childNodes[i].nodeName == "UL" ) {
            menu.childNodes[i].style.display = "none";
        }
    }
}
    
    
function changeColor(menu) {
    menu.style.backgroundColor = "rgb(106,140,176)";
    menu.style.color = "rgb(32,44,58)";
}

function changeColorBack(menu) {
    menu.style.backgroundColor = "rgb(19,28,40)";
    menu.style.color = "rgb(106,140,176)";
}

// used to untoggle when a dropdown link is clicked
function untogglefromlink(t)
{
    // when a link is clicked in the drop down you can call this function to hide it, eg:
    // <a href="page.html" onclick="untogglefromlink(this);">whatever</a>.
    toggle(t.parentNode.parentNode.parentNode);
}


function popUp(url,h,w) {
    newwindow=window.open(url, 'popUp1', 'height=' + h + ',width=' + w + ',left=80,top=140,resizable=yes,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    return false;
}


function emailProtect(email) {
    var a = "dcvo";
    var e = "gel@";
    var d = "livingtheanswer.";
    var c = "blah";
    var b = 'org';
    var f = '"mailto:';
    if(email == "self") text = a + e + d + b;
    else text = email;
    document.write('<a href=' + f + a + e + d + b + '">'+text+'</a>');
}