﻿var blbCancelClose = false;

animatedcollapse.addDiv('logoDropDown', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem1', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem2', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem3', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem4', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem5', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem6', 'fade=0,speed=400,hide=1')
animatedcollapse.addDiv('navItem7', 'fade=0,speed=400,hide=1')

animatedcollapse.ontoggle = function($, divobj, state) { //fires each time a DIV is expanded/contracted
    //$: Access to jQuery
    //divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
    //state: "block" or "none", depending on state
}

animatedcollapse.init()

//preload rollovers
if (document.images) {
    pic0 = new Image(1, 1); pic0.src = "images/master/bjl-logo-yellow.gif";
    pic1 = new Image(1, 1); pic1.src = "images/titles/whoweare-yellow.gif";
    pic2 = new Image(1, 1); pic2.src = "images/titles/whatwedo-yellow.gif";
    pic3 = new Image(1, 1); pic3.src = "images/titles/howwedoit-yellow.gif";
    pic4 = new Image(1, 1); pic4.src = "images/titles/whofor-yellow.gif";
    pic5 = new Image(1, 1); pic5.src = "images/titles/whatsnew-yellow.gif";
    pic6 = new Image(1, 1); pic6.src = "images/titles/content-yellow.gif";
    pic7 = new Image(1, 1); pic7.src = "images/titles/contactus-yellow.gif";
}

function collapseAllBut(object) {
    object.className = "selected";

    var strObjectName = object.id;

    switch (strObjectName) {
        case "whoWeAre":
            animatedcollapse.hide('navItem2');
            animatedcollapse.hide('navItem3');
            animatedcollapse.hide('navItem4');
            animatedcollapse.hide('navItem5');
            animatedcollapse.hide('navItem6');
            animatedcollapse.hide('navItem7');
            setTimeout("document.location.href = 'who-we-are/about-us.aspx';", 400);
            break;
        case "whatWeDo":
            animatedcollapse.hide('navItem1');
            animatedcollapse.hide('navItem3');
            animatedcollapse.hide('navItem4');
            animatedcollapse.hide('navItem5');
            animatedcollapse.hide('navItem6');
            animatedcollapse.hide('navItem7');
            setTimeout("document.location.href = 'what-we-do.aspx';", 400);
            break;
        case "howWeDoIt":
            animatedcollapse.hide('navItem1');
            animatedcollapse.hide('navItem2');
            animatedcollapse.hide('navItem4');
            animatedcollapse.hide('navItem5');
            animatedcollapse.hide('navItem6');
            animatedcollapse.hide('navItem7');
            setTimeout("document.location.href = 'how-we-do-it/how-we-work.aspx';", 400);
            break;
        case "whoFor":
            animatedcollapse.hide('navItem1');
            animatedcollapse.hide('navItem2');
            animatedcollapse.hide('navItem3');
            animatedcollapse.hide('navItem5');
            animatedcollapse.hide('navItem6');
            animatedcollapse.hide('navItem7');
            setTimeout("document.location.href = 'who-for.aspx';", 400);
            break;
        case "whatsNew":
            animatedcollapse.hide('navItem1');
            animatedcollapse.hide('navItem2');
            animatedcollapse.hide('navItem3');
            animatedcollapse.hide('navItem4');
            animatedcollapse.hide('navItem6');
            animatedcollapse.hide('navItem7');
            setTimeout("document.location.href = 'whats-new.aspx';", 400);
            break;
        case "content":
            animatedcollapse.hide('navItem1');
            animatedcollapse.hide('navItem2');
            animatedcollapse.hide('navItem3');
            animatedcollapse.hide('navItem4');
            animatedcollapse.hide('navItem5');
            animatedcollapse.hide('navItem7');
            setTimeout("document.location.href = 'content/';", 400);
            break;
        case "contactUs":
            animatedcollapse.hide('navItem1');
            animatedcollapse.hide('navItem2');
            animatedcollapse.hide('navItem3');
            animatedcollapse.hide('navItem4');
            animatedcollapse.hide('navItem5');
            animatedcollapse.hide('navItem6');
            setTimeout("document.location.href = 'contact-us.aspx';", 400);
            break;
    }
}

function openNav() {
    animatedcollapse.show('navItem1');
    animatedcollapse.show('navItem2');
    animatedcollapse.show('navItem3');
    animatedcollapse.show('navItem4');
    animatedcollapse.show('navItem5');
    animatedcollapse.show('navItem6');
    animatedcollapse.show('navItem7');
}

function openLogo() {
    document.getElementById('logo_logoHead').className = "selected";
    animatedcollapse.show('logoDropDown');
}

function closeLogo() {
    if (!blbCancelClose) {
        document.getElementById('logo_logoHead').className = "";
        animatedcollapse.hide('logoDropDown');
    }
}
