
// The preloadImages() function preloads images for immediate rollovers

function preloadImages() {

// If statement checks for images embedded in document...

    if (document.images) {

// Set imgFiles variable equal to an array of all image files and pass arguments to preloadImages() function.

       var imgFiles = preloadImages.arguments;

// Create new array called preloadArray

       var preloadArray = new Array();

// For each rollover image file send arguments to preloadImages() - 14 for this page

       for (var i=0; i < imgFiles.length; i++) {

// Create a new Image object in the preloadArray array and associate it with source file thereby preloading image into memory.

            preloadArray[i] = new Image;
            preloadArray[i].src = imgFiles[i];
       }
    }
}


// The swap() function accepts arguments for internal name of an image, and image file, and replaces associated image with new image file.

function swap(id, newsrc) {
    var theImage = locateImage(id);
    if (theImage) {
        theImage.src = newsrc;
    }
}

//The locateImage() function takes an image name 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 NewWindow(url, windowName, w, h, scroll) {
	winprops = 'height='+h+',width='+w+',scrollbars='+scroll+',resizeable';
	win = window.open(url, windowName, winprops);
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus(); 
	}
}

var w = window;
function openWin(url) {
   if ((w == window) || w.closed) {
      w = open(url, "_blank", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=810,height=560");
   } else {
      w.location.href = url
      w.focus('yougo_win');
   }
   return(false);
}
