// The following code was programmed by Joel Dixon and Belinda Cecere of Ladybug Web Design,  2005

var prefix = ["inde", "abou", "serv", "proj", "test", "phot", "cont"];

// The following code pre-loads all images for the menu bar, to ensure mouse-over changes look seemless

if (document.images)
{
    var norm = new Array();
    var over = new Array();
    var curr = new Array();


    for (i = 0; i < prefix.length; i++)
    {
        norm[i] = new Image();
        norm[i].src = "./images/" + prefix[i] + "norm.gif";
        over[i] = new Image();
        over[i].src = "./images/" + prefix[i] + "over.gif";
        curr[i] = new Image();
        curr[i].src = "./images/" + prefix[i] + "curr.gif";
    }
}

// The following method changes the image of the button the mouse is over

function swapBtn(btnNum, state)
{
    switch (state)
    {
        case 'norm':
            document.images[prefix[btnNum]].src = norm[btnNum].src;
            break;
        case 'over':
            document.images[prefix[btnNum]].src = over[btnNum].src;
            break;
    }
}



// Sub Menu functionality

var subColPrefix = ["col_what", "col_colo"];

// The following code pre-loads all images for the menu bar, to ensure mouse-over changes look seemless

if (document.images)
{
    var subColNorm = new Array();
    var subColOver = new Array();
    var subColCurr = new Array();


    for (i = 0; i < prefix.length; i++)
    {
        subColNorm[i] = new Image();
        subColNorm[i].src = "./images/" + subColPrefix[i] + "norm.gif";
        subColOver[i] = new Image();
        subColOver[i].src = "./images/" + subColPrefix[i] + "over.gif";
        subColCurr[i] = new Image();
        subColCurr[i].src = "./images/" + subColPrefix[i] + "curr.gif";
    }
}

// The following method changes the image of the button the mouse is over

function swapSubBtn(btnNum, state)
{
    switch (state)
    {
        case 'norm':
            document.images[subColPrefix[btnNum]].src = subColNorm[btnNum].src;
            break;
        case 'over':
            document.images[subColPrefix[btnNum]].src = subColOver[btnNum].src;
            break;
    }
}
