﻿// TOPNAV HOVER FOR IE
stnHover = function() {
    var topNav = document.getElementById("stnav");
    if (topNav == null) return;

    var tnEls = topNav.getElementsByTagName("LI");
    if (tnEls == null) return;

    for (var i = 0; i < tnEls.length; i++) {
        tnEls[i].onmouseover = function() {
            this.className += " stnhover";
        }
        tnEls[i].onmouseout = function() {
            this.className = this.className.replace(new RegExp(" stnhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", stnHover);


// SIMPLE HIDE/SHOW DIV FUNCTION
// MUST SUPPLY DIV ID
function hidediv(div_id) {
    var div = document.getElementById(div_id);
    if(div != null)
        div.style.display = 'none';
}

function showdiv(div_id) {
    var div = document.getElementById(div_id);
    if(div != null)
        div.style.display = 'block';
}


// FUNCTIONS TO POPUP NUTRITION FACTS FROM FLASH
function openBDFacts() {
    window.open('Brain-Development-Nutrition-Info.aspx', 'bdni', 'width=645, height=600, scrollbars=yes');
}
function openImmFacts() {
    window.open('Immunity-Nutrition-Info.aspx', 'immni', 'width=645, height=600, scrollbars=yes');
}