self.name = "main"; // names current window as "main"
PicVar = 0;
// Object Fix 
function Fix(DatVal, PicVal, TitVal, TxtVal) { 
   this.DatVal = DatVal 
   this.PicVal = PicVal 
   this.TitVal = TitVal 
   this.TxtVal = TxtVal 
} 
// Create new main array. 
var JobArray = new Array()
// The following lines are the ONLY LINES in this whole script that you need to change!
// JobArray[PicVar++] = new Fix("date", "picname.jpg", "pic title", "pic description")
JobArray[PicVar++] = new Fix("", "", "- - - Click here to select a career - - -", "")
JobArray[PicVar++] = new Fix("22/11/2002", "./images/DCP_1856-01.jpg", "The Job Table at the Award Ceremony", "")
JobArray[PicVar++] = new Fix("22/11/2002", "./images/DCP_1862-01.jpg", "That is Clive Anderson in the Far Distance.", "")
JobArray[PicVar++] = new Fix("22/11/2002", "./images/DCP_1865-01.jpg", "The Presentation.", "")
JobArray[PicVar++] = new Fix("22/11/2002", "./images/DCP_1866-01.jpg", "The Presentation 2.", "")
JobArray[PicVar++] = new Fix("22/11/2002", "./images/DCP_1867-01.jpg", "The Presentation 3.", "")
JobArray[PicVar++] = new Fix("22/11/2002", "./images/DCP_1868-01.jpg", "The Presentation 4.", "")
last = PicVar - 1;
current = 0;
function ShowJobPic(newpic) {
// (not working on some browsers)   document.playsound.play();
  current = newpic;
  SelectionBox = document.JobForm.JobDropdown;
  SelectionBox.options[current].selected = true;
  document.getElementById("JobSpot").innerHTML = '<a href=javascript:JobPicRemote("' + JobArray[current].PicVal + '","last");><img name="PicShowing" src=' + JobArray[current].PicVal + ' height=200 border=0></a>';
  document.getElementById("Journal").innerHTML = '<br>' + JobArray[current].DatVal + '<p style="text-align:justify; text-indent:25px">' + JobArray[current].TxtVal;
  if (document.JobForm.WhereView[1].checked) {
    timerID = setTimeout("JobPicRemote(JobArray[current].PicVal,'current')",1000)
  }
}
function RandomJobPic() {
  randompic = Math.floor(Math.random()*PicVar);
  last = current;
  ShowJobPic(randompic);
}
function PreviousJobPic() {
  last = current;
  current--;
  if(current<0) current = PicVar - 1;
  ShowJobPic(current);
}
function NextJobPic() {
  last = current;
  TotalImages = document.JobForm.JobDropdown.options.length;
  current++;
  if (current>=PicVar) current = 0;
  ShowJobPic(current);
}
function JobPicRemote(picName,whichPic) {
    ShowingImage = new Image();
    ShowingImage.src = picName;
    wid = ShowingImage.width + 50;
    hei = ShowingImage.height + 50;
  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(picName, "remoteWin", "resizable=1, scrollbars=1, toolbar=0, left=15, top=10, width=" + wid + ", height=" + hei);
}
function FindPic() {
  TotalFound = 0;
  SearchString = document.JobForm.SearchWord.value;
  SearchString = SearchString.toLowerCase();
  WriteResults = window.open("searchclear.htm","resultwindow","height=300, width=300, toolbar=0, status=0, menubar=0, resizable=1, scrollbars=1");
  WriteResults.document.write('<div style="text-align:center; font:8pt verdana">'
    + 'You searched for:<br><i>' + SearchString + '</i><br><b>Results:</b><br>');
  for (loop=0; loop < PicVar ; loop++) {
    Keyword = JobArray[loop].TxtVal;
    Keyword = Keyword.toLowerCase();
    URL = JobArray[loop].PicVal;
    title = JobArray[loop].TitVal;
    title = title.toLowerCase();
    SearchResult = Keyword.indexOf(SearchString);
    SearchResult2 = title.indexOf(SearchString);
    if (SearchResult != "-1" || SearchResult2 != "-1") {
      last = current;
      WriteResults.document.write('<br><a href=javascript:ShowJobPic(' + loop + '); target="main">' + title + '</a>');
      TotalFound++;
    }
  }
  WriteResults.document.write('<p><b>Returned ' + TotalFound + ' results.</b>');
}

