function leftMenuClick(strKey){
    switch(strKey){
        case "Staff"       : window.location = strRootPath + "Staff.aspx";               break;
        case "History"     : window.location = strRootPath + "History.aspx";             break;
        case "Contact"     : window.location = strRootPath + "Contact.aspx";             break;
        case "Awards"      : window.location = strRootPath + "Awards.aspx";              break;
        case "Commercial"  : window.location = strRootPath + "Portfolio/?s=Commercial";  break;
        case "Educational" : window.location = strRootPath + "Portfolio/?s=Educational"; break;
        case "G20"         : window.location = strRootPath + "Portfolio/?s=G20";         break;        
        case "Graphics"    : window.location = strRootPath + "Portfolio/?s=Graphics";    break;        
        case "Industrial"  : window.location = strRootPath + "Portfolio/?s=Industrial";  break;
        case "Hospitality" : window.location = strRootPath + "Portfolio/?s=Hospitality"; break;
        case "Religious"   : window.location = strRootPath + "Portfolio/?s=Religious";   break;
        case "Residential" : window.location = strRootPath + "Portfolio/?s=Residential"; break;
        case "Healthcare"  : window.location = strRootPath + "Portfolio/?s=Healthcare";  break;
    }
}

function leftMenuHover(strKey){ SwapKeyImage(strKey); }

function mainNavClick(strKey, bMain){
    if (bMain != undefined && bMain) {
        $("#LeftMenu").SlideOutRight(500, function() { mainNavClick(strKey) });
        $("#RightMenu").SlideOutLeft(500);
        return;
    }
    switch(strKey){
        case "Portfolio"   : window.location = strRootPath + "Portfolio";        break;
        case "Firm"        : window.location = strRootPath + "Firm.aspx";        break;
        case "OnTheBoards" : window.location = strRootPath + "OnTheBoards.aspx"; break;
    }
}

function contactSubmit(frm){
    var fields = "";
    if (frm.contactName.value     == "") { fields += "<li>Name    </li>"; }
    if (frm.contactEmail.value    == "") { fields += "<li>Email   </li>"; }
    if (frm.contactComments.value == "") { fields += "<li>Comments</li>"; }
    if (fields != "") {
        $("#message").html("<hr />Please fill out the entire form before submitting. You've left the following fields empty:<ul>" + fields + "</ul>").show();
        return false;
    }
    frm.submit();
    return false;
}

function randomNumber(max){
    return randomnumber=Math.floor(Math.random()*max)
}

function SwapKeyImage(key){
    if (key >= 0 && key < 9) { $("div.KeyImage img").attr("src",img[key].src).show(); }
}

function slideUp(strQuery, strSpeed) {
    if (!$(strQuery).attr("class") || $(strQuery).attr("class").indexOf("HiddenContent") < 0) {
        $(strQuery).slideUp(strSpeed);
        $(strQuery).addClass("HiddenContent");
    }
}
function slideDown(strQuery, strSpeed) {
    if ($(strQuery).attr("class").indexOf("HiddenContent") >= 0) {
        $(strQuery).slideDown(strSpeed);
        $(strQuery).removeClass("HiddenContent");
    }
}

function ToggleSubCategory(sc, strSpeed){
    var strIcon = $("#scImg" + sc).attr("src");
    if (strIcon.indexOf("09-plus.gif") >= 0) {
        $("#sc"    + sc).slideDown(strSpeed);
        $("#scImg" + sc).attr("src",strIcon.replace("09-plus.gif","09-minus.gif"));
        $("#scImg" + sc).attr("alt","Close this Category");
    } else {
        $("#sc"    + sc).slideUp(strSpeed);
        $("#scImg" + sc).attr("src",strIcon.replace("09-minus.gif","09-plus.gif"));
        $("#scImg" + sc).attr("alt","See Projects in this Category");
    }
//    $("#"+sc).slideToggle();
}

