﻿var hdrImgArray = new Array("images/home_header1.png", "images/home_header2.png", "images/home_header3.png");
var focusImgArray = new Array("images/focus1.png", "images/focus2.png", "images/focus3.png");
var alsofocusImgArray = new Array("images/alsofocus1.png", "images/alsofocus2.png", "images/alsofocus3.png");
imgCt = hdrImgArray.length;

function choosePic() {
    if (document.images) {
        randomNum = Math.floor((Math.random() * imgCt));
        document.imgHdr.src = hdrImgArray[randomNum];
        document.imgFocus.src = focusImgArray[randomNum];
        document.imgAlsoFocus.src = alsofocusImgArray[randomNum];
    }
}

function toggleDiv(divid) {
    var imagename = "img" + divid;
    var myimage;
    if (document.getElementById(divid).style.display == 'block') {
        document.getElementById(divid).style.display = 'none';
        myimage = "images/plus.gif";
        document.getElementById(imagename).setAttribute('src', myimage);
    } else {
        document.getElementById(divid).style.display = 'block';
        myimage = "images/minus.gif";
        document.getElementById(imagename).setAttribute('src', myimage);
    }
}

function ClearSearch() {
    window.event.srcElement.value = ""
}

function loadAdvisor(adv) {
    var myimage;
    var mydivid = "div" + adv;
    
    /* turn everything off */
    document.getElementById("advcc").setAttribute('src', "images/advisornotselectedtabcc.gif");
    document.getElementById("advfa").setAttribute('src', "images/advisornotselectedtabfa.gif");
    document.getElementById("advhr").setAttribute('src', "images/advisornotselectedtabhr.gif");
    document.getElementById("advog").setAttribute('src', "images/advisornotselectedtabog.gif");
    document.getElementById("advpl").setAttribute('src', "images/advisornotselectedtabpl.gif");

    document.getElementById("divadvcc").style.display = 'none';
    document.getElementById("divadvfa").style.display = 'none';
    document.getElementById("divadvhr").style.display = 'none';
    document.getElementById("divadvog").style.display = 'none';
    document.getElementById("divadvpl").style.display = 'none';
    
    switch (adv) {
        case "advcc": myimage = "images/advisorselectedtabcc.gif"; break;
        case "advfa": myimage = "images/advisorselectedtabfa.gif"; break;
        case "advhr": myimage = "images/advisorselectedtabhr.gif"; break;
        case "advog": myimage = "images/advisorselectedtabog.gif"; break;
        case "advpl": myimage = "images/advisorselectedtabpl.gif"; break;
    }

    document.getElementById(adv).setAttribute('src', myimage);
    document.getElementById(mydivid).style.display = 'block';
}
