//if browser version supports the following elements, initialise the page
if (document.getElementById && document.getElementsByTagName && document.createElement) {
    window.onload = initPage;
}

//initialise all dynamic elements on the page
function initPage() {
    if (document.bgColor== "#000001") {
        //check if images and CSS are enabled	
		
        //find all headings in the navigation section
        var t_nav = document.getElementById('navigation').getElementsByTagName('h3')
        //find all headings in the news section
        var t_news = document.getElementById('body').getElementsByTagName('h2')
        //find all news articles
        var t_cap = document.getElementById('body').getElementsByTagName('p')
        //find menu items
        //var t_bonsai = document.getElementById('bonsai').getElementsByTagName('li');
        //find page caps
        var t_cap = document.getElementById('body').childNodes;
        
        var y = 0;
		
        //identify the first Paragraphs after the news titles - mark them for a first letter change
        for (var i = 0; i < t_cap.length; i++) {
            if (t_cap[i].nodeName == "H2") { 
                y = 1; 
            }
            if (t_cap[i].nodeName == "P" && y == 1 ) {
                t_cap[i].className="news";
                y = 0;
            }
        }
    }
}

//hides and shows submenus
function browser_hideShowDir(item) {
    listitem = item.childNodes;
    for (var i=0;i<listitem.length;i++){
        if(listitem[i].nodeName=="UL") {
            listitem=listitem[i];
            break;
        }
    }
    if (listitem.className == "hide") {
        listitem.className = "show";
    } else {
        listitem.className = "hide";
    }
}

