﻿
// replaces one image with another. used primarily with 
// onmouseover and onmouseout for image rollovers.
// imageName - the img ID/Name 
// current - string to be replaced within the current src value
// replacement - replacement string within the src value
function SwitchImage(imageName, current, replacement)
{
    var theImage = document.images[imageName];
    theImage.src = theImage.src.replace(current, replacement);
    
    return;
}

// loads images whose paths are input as a series of strings. intended
// to be called with onload in the body tag:
// <body onload="PreloadImages('images/image1.gif', 'images/image2.gif' ...);" />
function PreloadImages()
{
    images = PreloadImages.arguments;
    
    for (i=0; i < images.length; i++)
    {
        tempImage = new Image;
        tempImage.src = images[i];
    }

    return;
}

