///   Nav drop down functionality   ///
function hideAll() {
    var navList = document.getElementById("nav");
    for (var i=0; i<navList.childNodes.length; i++) {
        var node = navList.childNodes[i];
        if (node.tagName == "LI") {
        	node.innerHTML = node.innerHTML.replace("-","+");
            node.className = node.className.replace(new RegExp("\s?active", "i"), "");
        }
    }
}

window.onload = function () {
    var navList = document.getElementById("nav");
    for (var i=0; i<navList.childNodes.length; i++) {
        var node = navList.childNodes[i];
        if (node.tagName == "LI") {
            node.onclick = function() {
                if(this.className=="active") {
                	hideAll();
                }
                else {
                	this.childNodes[0].innerHTML = this.childNodes[0].innerHTML.replace("+","-");
                	this.className += "active";
                }
            }
        }
    }
}
