//This code is executed when the page is loaded to set variables and preload images
var imagesloaded;

function doOnLoad(path)
{

    //This is the list of images to be preloaded
    imageLoadList =  new Array(
        "flying",
        "adventure",
        "contact",
        "howto",
        "links",
        "locator",
        "squadron",
        "summer");

    loadImageList(imageLoadList, path);
}


//This function generates a new instance of an image with the given src URL
function generateImage(src) 
{
    if (browserCompatible) 
    {
        var newImage;
        newImage = new Image();
        newImage.src= src + ".gif";
        return newImage;
    }
}


//Function which takes an array of images and preloads them
function loadImageList(imageList, path)
{
    var i;
    var evalString;
    for (i=0; i<imageList.length; i++)
    {
        evalString = "img_" + imageList[i] + "_over = generateImage(\"" + path + imageList[i] + "_over\")";
		eval(evalString);
    }
    return;
}

function getRandomNumber(maxNum)
{
	return randomnum= Math.round(Math.random()*maxNum);
}
