//Add JavaScript File from AdvisorChoice main.
document.write(unescape("%3Cscript src=\"../top.js\" type=\"text/javascript\"%3E%3C/script%3E"));

function setOnLoadEventsIRIA(objFunctionName) {
    //Works for NON-IE Browsers
    if (window.addEventListener) {
        window.addEventListener("load", objFunctionName, false);
    }
    else { //Works for IE Browsers versions 6 - 8
        window.attachEvent("onload", objFunctionName);
    }
}

setOnLoadEventsIRIA(setSiloPageSettings);

//Set global variable to TRUE
siloPageCurrent = true;

function setSiloPageSettings() {
    //Get the specific page name from the URL;
    var locHrefArray = location.href.split("/");
    var currentPage = locHrefArray[locHrefArray.length - 1];

    //If there is a querystring remove from the "currentPage" value.
    if (location.search != "" && currentPage.indexOf(location.search) > -1) {
        currentPage = currentPage.substring(0, currentPage.indexOf(location.search));
    }

    //Check Current Page and set to INDEX if empty
    if (currentPage == "") {
        currentPage = "index.asp"
    }

    //Button setting options
    var pgBtnDONOTSET = "DO NOT SET";
    var pgBtnSETONPAGE = "SET ON PAGE";
    //var btnStr1 = new Array("111221_regrep", "techdemo", "ceotransition20100512", "annualreport09");
    //var btnStr2 = new Array("transitions", "commentarypodcast", "tjbwtb20100128", "111221_regrep");
    var btnStr1 = new Array("2011_10Webinar", "transitionStories");
    var btnStr2 = new Array("turbulentTimesWP");

    /*
    Use an Array to set the assocaition between
    pgArray[pgCount++] = new Array(FILE NAME, VAR for MAIN NAV ID, BUTTONS);
    */
    var pgArray = new Array();
    var pgCount = -1;
    pgArray[pgCount++] = new Array("index.asp", btnStr1, btnStr2);
    pgArray[pgCount++] = new Array("business_planning.asp", pgBtnDONOTSET, pgBtnDONOTSET);

    var item;
    for (item in pgArray) {
        if (pgArray[item][0] == currentPage) {
            setSideBarSettings(pgArray[item][1], pgArray[item][2]);
        }
    }
}

