// JavaScript Document
<!--


self.name = "main"; // names current window as "main"

PicVar = 0;

// Object Pictures 

function Pictures(PicVal, TitVal, TxtVal) { 

   this.PicVal = PicVal 

   this.TitVal = TitVal 

   this.TxtVal = TxtVal 

} 


// Create new main array. 

var Array = new Array()

// The following lines are the ONLY LINES that you need to change

// Array[PicVar++] = new Pictures("date", "picname.jpg", "pic title", "pic description")

Array[PicVar++] = new Pictures("images/Corey-Promise.jpg", "Corey and Promise", "<p style=\"font-weight: bold; color: white;\"></p>")
Array[PicVar++] = new Pictures("images/Debbie.jpg", "Debbie", "<p style=\"font-weight: bold; color: white;\"></p>")
Array[PicVar++] = new Pictures("images/Mirage.jpg", "Mirage", "<p style=\"font-weight: bold; color: white;\"></p>")
Array[PicVar++] = new Pictures("images/Roxie.jpg", "Roxie", "<p style=\"font-weight: bold; color: white;\"></p>")
Array[PicVar++] = new Pictures("images/Trixy.jpg", "Trixy", "<p style=\"font-weight: bold; color: white;\"></p>")
Array[PicVar++] = new Pictures("images/Unknown.jpg", "Unknown", "<p style=\"font-weight: bold; color: white;\"></p>")


last = PicVar - 1;

current = 0;

function ShowPic(newpic) {

// (not working on some browsers)   document.playsound.play();

  current = newpic;

  document.getElementById("Pic").innerHTML = '<img name="PicShowing" src=' + Array[current].PicVal + ' border=0>';

  document.getElementById("Journal").outerHTML = '<div id=journal>' + Array[current].TxtVal + '</div>';

  

}

function PreviousPic() {

  last = current;

  current--;

  if(current<0) current = PicVar - 1;

  ShowPic(current);

}

function NextPic() {

  last = current;

  TotalImages = document.Form.Dropdown.options.length;

  current++;

  if (current>=PicVar) current = 0;

  ShowPic(current);

}

function PicRemote(picName,whichPic) {

    ShowingImage = new Image();

    ShowingImage.src = picName;

    wid = ShowingImage.width;

    hei = ShowingImage.height;

  /*if (wid < 30 || hei < 30) {

    wid=350;

    hei=200;

  }*/

  if (screen.width < wid || screen.height < hei) {

    wid = screen.width - 50;

    hei = screen.height - 50;

  }

  OpenWindow = window.open("http://www.raven-business-solutions.com", "remoteWin", "resizable=1, scrollbars=1, toolbar=0, left=15, top=10, width=" + wid + ", height=" + hei);

  OpenWindow.document.write('<html><body background=parchment.jpg><img src=' + picName + '></body></html>');

  OpenWindow.document.close();

}

function FindPic() {

  TotalFound = 0;

  SearchString = document.Form.SearchWord.value;

  SearchString = SearchString.toLowerCase();

  WriteResults = window.open("clear.html","resultwindow","height=300, width=300, toolbar=0, status=0, menubar=0, resizable=1, scrollbars=1");

  WriteResults.document.open();

  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 = Array[loop].TxtVal;

    Keyword = Keyword.toLowerCase();

    URL = Array[loop].PicVal;

    title = Array[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:ShowPic(' + loop + '); target="main">' + title + '</a>');

      TotalFound++;

    }

  }

  WriteResults.document.write('<p><b>Returned ' + TotalFound + ' results.</b>');

  WriteResults.document.close();

  if(javascript_version > 1.0)  {

    //delay a bit here because IE4 encounters errors

    //when trying to focus a recently opened window

    setTimeout('WriteResults.focus();',250);

  }



}
//-->
