function FindPic() { // The search for a photo feature.
  TotalFound = 0;
  SearchString = document.arbForm.SearchWord.value;
  SearchString = SearchString.toLowerCase();
  WriteResults = window.open("","resultwindow","height=310, width=290, toolbar=0, status=0, menubar=0, resizable=1, scrollbars=1");
  WriteResults.document.open();
  WriteResults.document.write('<style type=text/css>body{background:url(parchment.jpg); font:8pt}'
    + 'a{text-decoration:none}'
	+ 'img{border:2px ridge #ffaaaa; height:50px; vertical-align:middle}'
	+ '</style>'
    + 'You searched for:  <i>' + SearchString + '</i>'
	+ '<br>Category:  <i>' + parent.document.arbForm.CategoryDropdown.options.value + '</i>'
	+ '<p><b>Results:</b><br>');
  for (loop=0; loop < ActiveVar ; loop++) {
    Keyword = ActiveArray[loop].TxtVal;
    Keyword = Keyword.toLowerCase();
    URL = ActiveArray[loop].PicVal;
    title = ActiveArray[loop].TitVal;
    title = title.toLowerCase();
    SearchResult = Keyword.indexOf(SearchString);
    SearchResult2 = title.indexOf(SearchString);
    if (SearchResult != "-1" || SearchResult2 != "-1") {
      WriteResults.document.write('<p><a href=javascript:ShowarbPic(' + loop + '); target="main"><img src=' + ActiveArray[loop].PicVal + '></a>  ' + title);
      TotalFound++;
    }
  }
  WriteResults.document.write('<p><b>Returned ' + TotalFound + ' results.</b><p><a href="javascript:window.close();">close window</a>');
  WriteResults.document.close();
}

function RunLoader() { // Pre-loads all images every 5 seconds, if checkbox is selected.
  timerLoad = setTimeout("PreLoader()",5000)
}

function RunSlideShow() { // Shuffles the photos in a slide show.
    timerSlideShow = setTimeout("NextarbPic();",document.arbForm.Timer.value*1000)
}

function arbPicRemote(picName) { // Pops up the photo in a remote window.
    ShowingImage = new Image();
    ShowingImage.src = picName;
    wid = ShowingImage.width + 50;
    hei = ShowingImage.height + 60;
  if (wid < 30 || hei < 30) {
    wid=650;
    hei=490;
  }
  if (screen.width < wid || screen.height < hei) {
    wid = screen.width - 50;
    hei = screen.height - 50;
  }
  OpenWindow = window.open("", "remoteWin", "resizable=1, scrollbars=1, toolbar=0, left=15, top=10, width=" + wid + ", height=" + hei);
  OpenWindow.document.open();
  OpenWindow.document.write('<html><head><title>' + ActiveArray[current].TitVal + '</title></head>'
    + '<body style="background:url(parchment.jpg); font:8pt verdana; margin:2px"><center>' + ActiveArray[current].DatVal + '<br>'
    + '<img src=' + picName + '><br>' + ActiveArray[current].TxtVal
	+ '<br><a href="javascript:window.close();">close window</a></center></body></html>');
  OpenWindow.document.close();
}