//var id;
/////////////////////////////////////////////////////////
// The displayMsg() function displays a message at the
// bottom of the browser window.
/////////////////////////////////////////////////////////

function displayMsg(message) {
    window.status=message
}

//////////////////////////////////////////////////////////////////
// The preloadImages() function preloads all the "flipped" images
// so that when a user mouses over a navigation button,
// the rollover takes place immediately.  (If you do not
// preload images, the first time a user mouses over each
// navigation button the "mouseover" image must TRavel
// from the Web server, causing an unatTRactive delay.
///////////////////////////////////////////////////////////////////

function preloadImages() {
    // If there are images embedded in the document...

    if (document.images) {

       // Set the imgFiles variable equal to an array of all the
       // image files passed as arguments to the preloadImages() function.

       var imgFiles = preloadImages.arguments;

       // Create a new array called preloadArray

       var preloadArray = new Array();

       // For each image file sent as an argument to preloadImages()
       // (all 13 of them)...

       for (var i=0; i < imgFiles.length; i++) {

            // Create a new Image object in the preloadArray array
            // and associate it with a source file, thus loading
            // that image into memory.

            preloadArray[i] = new Image;
            preloadArray[i].src = imgFiles[i];
       }
    }
}


/////////////////////////////////////////////////////////
// The swap() function accepts two arguments - the
// internal name of an image, and an image file -
// and replaces whatever file was associated with the
// image name to the new image file.
/////////////////////////////////////////////////////////

function swapFirst(id, newsrc) {
    var theImage = locateImage(id);

    if (theImage) {
        theImage.src = newsrc;
				theImage.width = 200;
				theImage.height = 145;
    }
}

function swap(id, newsrc) {
    var theImage = locateImage(id);
		var fNum;
		var sidePic = new Array(31);
		fNum = generate();
		//alert(fNum)
		sidePic[0] = 'content/MysticCompNov08_2/images/p1020231.jpg';
		sidePic[1] = 'content/MysticCompNov08_2/images/dance__4.jpg';
		sidePic[2] = 'content/MysticCompNov08_2/images/p1020236.jpg';
		sidePic[3] = 'content/MysticCompNov08_2/images/p1020237.jpg';
		sidePic[4] = 'content/MysticCompNov08_2/images/p1020242.jpg';
		sidePic[5] = 'content/MysticCompNov08_2/images/p1020250.jpg';
		sidePic[6] = 'content/MysticCompNov08_2/images/p1020263.jpg';
		sidePic[7] = 'content/MysticCompNov08_2/images/p1020288.jpg';
		sidePic[8] = 'content/MysticCompNov08_2/images/p1020355.jpg';
		sidePic[9] = 'content/MysticCompNov08_2/images/p1020381.jpg';
		sidePic[10] = 'content/MysticCompNov08_2/images/p1020383.jpg';
		sidePic[11] = 'content/MysticCompNov08_2/images/p1020470.jpg';
		sidePic[12] = 'content/MysticCompNov08_2/images/pictures_from_november_comp_08_128.jpg';
		sidePic[13] = 'content/MysticCompNov08_2/images/pictures_from_november_comp_08_168.jpg';
		sidePic[14] = 'content/MysticCompNov08_2/images/pictures_from_november_comp_08_099.jpg';
		sidePic[15] = 'content/MysticCompNov08_2/images/pictures_from_november_comp_08_043.jpg';
		sidePic[16] = 'content/MysticCompNov08_2/images/pictures_from_november_comp_08_074.jpg';
		sidePic[17] = 'content/MysticCompAug08/images/colonial_classic_2008_019.jpg';
		sidePic[18] = 'content/MysticCompAug08/images/colonial_classic_2008_008.jpg';
		sidePic[19] = 'content/MysticCompAug08/images/colonial_classic_2008_035.jpg';
		sidePic[20] = 'content/MysticCompAug08/images/colonial_classic_2008_044.jpg';
		sidePic[21] = 'content/MysticCompAug08/images/colonial_classic_2008_070.jpg';
		sidePic[22] = 'content/MysticCompAug08/images/colonial_classic_2008_076.jpg';
		sidePic[23] = 'content/MysticCompAug08/images/colonial_classic_2008_150.jpg';
		sidePic[24] = 'content/MysticCompAug08/images/colonial_classic_2008_120.jpg';
		sidePic[25] = 'content/MysticCompAug08/images/colonial_classic_2008_132.jpg';
		sidePic[26] = 'content/MysticCompAug08/images/colonial_classic_2008_141.jpg';
		sidePic[27] = 'content/MysticCompAug08/images/colonial_classic_2008_220.jpg';
		sidePic[28] = 'content/MysticCompAug08/images/fads0808_a09101224.jpg';
		sidePic[29] = 'content/MysticCompAug08/images/p1010791.jpg';
		sidePic[30] = 'content/MysticCompAug08/images/p1010839.jpg';
		newsrc = sidePic[fNum];
		

    if (theImage) {
        theImage.src = newsrc;
				theImage.width = 200;
				theImage.height = 145;
    }
}
function generate()
{
 var my_num = Math.random();
 floorNum = Math.floor(my_num*31);
 return floorNum;
}
/*
function getImage(imageId)
{
m ='';
m+='<img src="content/menuIcons/signupIcon.jpg"><\/img>';
document.getElementById('zone').innerHTML=m;
}
*/
/////////////////////////////////////////////////////////
// The locateImage() function accepts the name of an
// an image and returns the Image object associated
// with that name.
/////////////////////////////////////////////////////////

function locateImage(name) {

    var theImage = false;
    if (document.images) {
        theImage = document.images[name];

    }
    if (theImage) {
        return theImage;
    }
    return (false);
}
function NewImageSwap(newImage) {

    var fileName = newImage
	
}

