/**********************************************************
 * Pix & Text rotator
 **********************************************************/
self.name = "main"; // If you are using frames, change "main" to the name of the frame that the rotator script is in.

ActiveVar = 0; // Sets up the variable that counts the pictures.
var ActiveArray = new Array() // Sets up the active array.
for (loop=0; loop < MainVar; loop++) {
  ActiveArray[ActiveVar++] = new Fix(MainArray[loop].DatVal, MainArray[loop].PicVal, MainArray[loop].TitVal, MainArray[loop].CatVal, MainArray[loop].TxtVal)
}

LoadThis = 0;
function PreLoader() { // If checked, preloads all images into cache.  Five second interval between pics.
  if (SuzyForm.PreloadPics.checked && ++LoadThis < MainVar) {
    ShowingImage = new Image();
    ShowingImage.src = MainArray[LoadThis].PicVal;
	window.status="Pre-Loading image... '" + MainArray[LoadThis].PicVal + "'";
    RunLoader();
  } else {
	window.status=" ";
  }
}

function RandomJRCPic() { // Shows a random photo.
  randompic = Math.floor(Math.random()*ActiveVar);
  ShowJRCPic(randompic);
}

current = Math.floor(Math.random()*ActiveVar); // "current = 0;" sets the current picture being shown to the first one.

function LoadPiclist() { // Loads initial list of pictures on web page.
  for (loop=0; loop < MainVar; loop++)  {
    document.write("<option value=" + ActiveArray[loop].PicVal + ">" + ActiveArray[loop].TitVal + "</option>");
  }
    document.write("<option selected>-- Show That Again? --</option>");
}

function ShowJRCPic(newpic) { // Shows the photo and text on the page.
  current = newpic;
  SelectionBox = document.JRCForm.JRCDropdown;
  SelectionBox.options[current].selected = true;
  document.getElementById("JRCSpot").innerHTML = '<img name="PicShowing" src=' + ActiveArray[current].PicVal + ' width=140 border=0>';
  document.getElementById("PxTextTitle").innerHTML = '<div id=PxTextTitle><b>' + ActiveArray[current].TitVal + '</b>'+ '</div>';
  document.getElementById("PxTextDescr").innerHTML = '<div id=PxTextDescr class=alignleft>' + ActiveArray[current].TxtVal + '</div>';
}
