<!-- Hide this script from non-javascript-enabled browsers
//this code is for the banner ad swap - mick
// Global variable declarations
var whichImg = 1
var nextImage

/////////////////////////////////////////////
// This function swaps the current image
// for the incoming parameter newImage;
// then it calls itself every 5 seconds,
// passing itself a different newImage
// each time.  The result is a simple
// on/off animation.
/////////////////////////////////////////////

function animate(newImage) {

        swap('animatedFace', newImage);

        if (whichImg == 1) {
            nextImage = "images/agun_banner2.gif"
            whichImg = 0
        }
        else {
            nextImage = "images/gun-data_banner4.gif"
            whichImg = 1
        }

        setTimeout("animate(nextImage)", 5000)
}

/////////////////////////////////////////////
// The preloadImages() function pulls both
// the image files used in this simple animation
// into memory as soon as it's called (in
// this case, as soon as the page loads).
// Doing this helps prevent an unattractive
// lag time between the time the first
// "on" and first "off" image appears.
/////////////////////////////////////////////

function preloadImages() {
    if (document.images) {
       var imgFiles = preloadImages.arguments;
       var preloadArray = new Array();

        for (var i=0; i<imgFiles.length; i++) {
            preloadArray[i] = new Image;
            preloadArray[i].src = imgFiles[i];
        }
    }
}

/////////////////////////////////////////////
// The swap() function replaces the image
// associated with the first input
// parameter (id) with the image specified
// for the second input parameter (newSrc)
/////////////////////////////////////////////

function swap(id, newSrc) {
    var theImage = findImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

/////////////////////////////////////////////
// The findImage() function locates and
// returns an Image objectUsing a document, 
// the name of an image to find, and an index 
// (the three input parameters).
/////////////////////////////////////////////

function findImage(doc, name, j) {

    // Declare a variable to hold the image
    // (if/when we find it)
    var theImage = false;

    // The document object's images property contains a 
    // collection of all the images in a document.

    if (doc.images) {
        theImage = doc.images[name];
    }

    // Return the image if we've already found it
    if (theImage) {
        return theImage;
    }

    // Otherwise, return an error
    return (false);
}
// stop hiding -->
