// An object which contains two images.
function dualImage(onSource, offSource)
{
//    if (document.images)
//    {
        this.on = new Image();
        this.on.src = onSource;
        this.off = new Image();
        this.off.src = offSource;
//    }
}

// Create a new dual image object in the 'item' array.
function dualImageNew(name, offSource, onSource)
{
    dualImage[name] = new dualImage(onSource, offSource);
}

// Switch to the 'on' image.
function itemon(buttonName)
{
    // If the document images are loaded and the button is defined...
    if (document.images && dualImage[buttonName])
    {
        document.images[buttonName].src = dualImage[buttonName].on.src;
    }
}

// Switch to the 'off' image.
function itemoff(buttonName)
{
    // If the document images are loaded and the button is defined...
    if (document.images && dualImage[buttonName])
    {
        document.images[buttonName].src = dualImage[buttonName].off.src;
    }
}

// Define two images for button1
dualImageNew("button1", "images/face118x150.jpg", "images/facewink.jpg");





