

    //___________________________  BEGIN SIDENAV ___________________________//
    
    //Setup Inital Stuff
    var navDivs = new Array()
    var currentNav = null;

    //Search a sepcific div id and get all the div ids within it and put them in the Nav Array
    function getNavDivs(whichDiv) {
	    var mainID = document.getElementById(whichDiv);
	    var subDivs = mainID.getElementsByTagName('div');
	    for (var i=0;i<subDivs.length;i++){
		    navDivs[i] = subDivs[i].id;
	    }
    }
    
    //Search a sepcific div id and count the links in it
    function countNavLinks(whichDiv) {
	    var mainID = document.getElementById(whichDiv);
	    var links = mainID.getElementsByTagName('a');
	    var numberOfLinks = 0;
	    for (var i=0;i<links.length;i++){
		    numberOfLinks++;
	    }
	    return numberOfLinks;
    }
    
    //Hide all divs in the Nav Array
    function hideNavDivs() {
	    for (var i=0;i<navDivs.length;i++){
		    document.getElementById(navDivs[i]).style.display = 'none';
	    }
    }
    //Reset all nav links to not highlighted
    function hideNavLinks() {
	    for (var i=0;i<navDivs.length;i++){
	        currentNavLink = navDivs[i]+'link';
		    document.getElementById(currentNavLink).className = 'navoff';
	    }
    }
    
    //Make the div passed magically apear and everything else magically disappear
    function showNavDiv(divID) {
        if (divID != ""){
	        hideNavDivs();
	        hideNavLinks();
	        var numberOfLinks = countNavLinks(divID);
	        var currentNavLink = divID+'link';
    	    
	        //Last Opened should be the currently opened section... check if they match
	        //They dont match... Set divID as current
	        //They do match.. leave the section closed.. and reset so they can open it again
	        //Also check number of links in the div.. if no links then we dont want to the nav to open either
	        if ((currentNav != divID) && (numberOfLinks > 0)){
	            currentNav = divID;
	            document.getElementById(currentNavLink).className = 'navon';
	            document.getElementById(divID).style.display = 'block';
	        }else{
	            document.getElementById(currentNavLink).className = 'navoff';
	            currentNav = null;
	        }
	    }
    }
    
    //___________________________  END SIDENAV ___________________________//
    
    
    
    
    
    //___________________________  BEGIN TOPNAV ___________________________//
    
    // show iframe helper for topnav dropdown
    function showIFrame()
    {
        var iFRef = document.getElementById('dropcover');
        var divRef = document.getElementById('mp'); //my pregnancy dropdown list

            iFRef.style.width = divRef.offsetWidth;
            iFRef.style.height = divRef.offsetHeight;
            iFRef.style.top = divRef.style.top;
            iFRef.style.left = divRef.style.left;
            iFRef.style.zIndex = divRef.style.zIndex -1;
            iFRef.style.display = "block";

    }
    // topnav hover function for IE

    tnHover = function() {
	    var topNav = document.getElementById("topnav");
	    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+=" tnhover";
		    }
		    tnEls[i].onmouseout=function() {
			    this.className=this.className.replace(new RegExp(" tnhover\\b"), "");
		    }
	    }
    }
    if (window.attachEvent) window.attachEvent("onload", tnHover);

    //___________________________  END TOPNAV ___________________________//
    
    
    
    
    //___________________________  BEGIN CGMPROMO ___________________________//
    
    CIBeWindow = function(href) {
        window.open(href, 'popup', 'resizable=yes,scrollbars=yes,width=450,height=480'); 
    }
    
    //___________________________  END CGMPROMO ___________________________//
   
    

	    
    
    //______________________  BEGIN HOMEPAGE TAKEOVER _______________________//
    
    HideHomepageTakeover = function() {
        document.getElementById("homepageTakeover").style.display = 'none';
    }
    
    ShowHomepageFlash = function() {
        var so = new SWFObject("../assets/swf/Home/cib_home.swf", "homeflash", "760", "315", "8", "");
	    so.addParam("loop", "true");
	    so.addParam("quality", "high");
	    so.addParam("wmode", "transparent");
	    so.write("homeflash");
	}
	
	SkipTakeover =function() {
	    ShowHomepageFlash();
	    HideHomepageTakeover();
	}