// Create image objects, preload all active and inactive images.
img1on = new Image();
img1on.src = "images/button-001-over.jpg";
img2on = new Image();
img2on.src = "images/button-002-over.jpg";
img3on = new Image();
img3on.src = "images/button-003-over.jpg";
img4on = new Image();
img4on.src = "images/button-004-over.jpg";

img1off = new Image();
img1off.src = "images/button-001.jpg";
img2off = new Image();
img2off.src = "images/button-002.jpg";
img3off = new Image();
img3off.src = "images/button-003.jpg";
img4off = new Image();
img4off.src = "images/button-004.jpg";

// Function to "activate" images.
function imgAct(imgName)
{
    document.getElementById(imgName).src = eval(imgName + "on.src");
}

// Function to "deactivate" images.
function imgInact(imgName)
{
    document.getElementById(imgName).src = eval(imgName + "off.src");
}

function currentBtn()
{
    //Get the full path
    var sPath = window.location.pathname;
    //Get the page name
    //var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
    //alert(sPath);
    
    for (i=0; i<document.images.length; i++)
    {
        //alert("elem: " + document.images[i].href);
        
        if (document.images[i].title == sPath)
            document.images[i].src = eval(document.images[i].id + "on.src");            
    }
}
