var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
var restoreImg = new Array(); //source last image switched, for RestoreImage
var numSwaps; //number of images last swapped, so we know how many to restore

function PreloadImages() {
  if (document.images) {
    var imgFiles = PreloadImages.arguments;
    //create array for preloaded images if it doesn't exist
    if (document.Preloaded==null) document.Preloaded = new Array();
    //i is length of array, so we can append if necessary
    var i = document.Preloaded.length;
    //loop through each argument and add it to array
    with (document) for (var j=0; j<imgFiles.length; j++) {
      Preloaded[i] = new Image;
      Preloaded[i++].src = imgFiles[j];
  } }
}


function SwapImage () {
  var args = SwapImage.arguments;
  var i = args.length;
  numSwaps = i;
  if (document.images) {
   for (var j=0; j < i; j+=2) {
    restoreImg[j] = document.images[args[j]].src;
    document.images[args[j]].src=args[j+1];
    restoreImg[j+1] = args[j];
    }
  }
}

function RestoreImage () {
  if (document.images) {
   for (var j = 0; j < numSwaps; j+=2) {
   document.images[restoreImg[j+1]].src=restoreImg[j];
   }
  }
}

if (IE4) {
document.write("<STYLE TYPE='text/css'>");
document.write("A:link { text-decoration: none} ");
document.write("A:visited { text-decoration: none} ");
document.write("A:hover { text-decoration: underline} ");
document.write("A.more:link { text-decoration: underline} ");
document.write("A.more:visited { text-decoration: underline} ");
document.write("A.more:hover { text-decoration: underline} ");

document.write("</STYLE>");}
