function random_image(imgid, pathnum){
    var navimage = document.getElementById(imgid);
    switch(pathnum){
        case 1:{
            var srcfolder = "images/homepage_images/";
        }
        break;
        case 2:{
            var srcfolder = "images/nav_images/";
        }
        break;
        default:{
            break;
        }
    }
        
    var theImages = new Array();

    /** add the images to the array since we have no scripting language
     *   available to dynamically count and retrieve the image names
     **/
    theImages[0] = '1.jpg'
    theImages[1] = '2.jpg'
    theImages[2] = '3.jpg'
    theImages[3] = '4.jpg'
	theImages[4] = '5.jpg'
	theImages[5] = '6.jpg'
	theImages[6] = '7.jpg'
	theImages[7] = '8.jpg'
	
    var p = theImages.length;
    
    /** use this to preload the images so there's no delay when
     * the image gets loaded
     **/
    var preBuffer = new Array()
    for (i = 0; i < p; i++){
       preBuffer[i] = new Image()
       preBuffer[i].src = theImages[i]
    }
    var whichImage = Math.round(Math.random()*(p-1));
    
    var newimg = srcfolder + theImages[whichImage];
    navimage.src = newimg;
    
}