/* *************************************************************
** JSALBUM.JS
** ==========
** This library contains global variables and functions to power
** the JS PhotoAlbum, as presented in 12/99's ScriptHead column.
** Use it in good health! Please maintain this header, and let
** me know what you've done with the code: rachmiel@hotmail.com 
**
** Author      Ver  Date     Comments
** ======      ===  ====     ========
** Rick Scott  1.0  12/1/99  First release
**
** Copyright 1999, Rick Scott, all rights reserved.
**
** USAGE
** =====
** To make the PhotoAlbum easy to customize, *all* of the code 
** you must change to create your own PhotoAlbum is in *this* 
** file (jsalbum.js). You'll find instructions below.
**
** Unless you are fluent in coding JS, don't mess around with 
** the other Album files:
**   jsalbum.html - frameset doc for entire PhotoAlbum
**   non-js.html - displays warning msg for JS-incapable users
**   lpage.html - frameset doc for left PhotoAlbum page
**   rpage.html - frameset doc for right PhotoAlbum page
**   thumb.html - displays/processes PhotoAlbum thumbnails
**   thumbctr.html - thumbnail control panel
**   photo.html - displays/processes full PhotoAlbum photos
**   photoctr.html - photo control panel
************************************************************* */


/* ********************************************************** */
/* GLOBAL VARIABLES                                           */
/* ================                                           */
/* The follow global variables are loaded into the Album's    */
/* topmost frameset document (jsalbum.html) to enable the     */
/* Album to "save state" (remember variable values).          */
/* ********************************************************** */

// don't change these!
var origPhotoObjectsArray = new Array();  // array of orig Photo objects
var currPhotoObjectsArray = new Array();  // array of current Photo objects
var currPhotoObjectsArrayIndex = 0;       // index into currPhotoObjectsArray
var currPhotoObjectsArrayLength = 0;      // length of currPhotoObjectsArray

// these you can change
var thumbctrFrameVisible = true;  // show/hide (true/false) thumbnail controls
var photoctrFrameVisible = true;  // show/hide (true/false) photo controls
var looping = true;               // enable/disable (true/false) < > looping

// don't change these!
var currKeyword = "All";   // currently selected keyword for thumbnail display
var currKeywordIndex = 0;  // index into keywordsArray

// Replace these keywordsArray strings with your keywords;
// they will show up as options in your Show: select-box.
// If you're not going to use keywords, create empty array:
//   var keywordsArray = new Array();
// (see KEYWORDS, below, for more on keyword usage)
var keywordsArray = new Array(
	"sites",
	"nature",
	"schools",
	"parks"
   );


/* ********************************************************** */
/* Herein lies the Photo object constructor function. Don't   */
/* change this code (unless you really know what yer doin')!  */
/* ********************************************************** */

var photoNum = 0;  // index into origPhotoObjectsArray

function Photo(url, thumburl, caption, commentary, keywords)
  {
  this.url = url;                // Photo.url property
  this.thumburl = thumburl;      // Photo.thumburl property
  this.caption = caption;        // Photo.caption property
  this.commentary = commentary;  // Photo.commentary property
  this.keywords = keywords;      // Photo.keywords property

  this.suppLinksNum = arguments.length - 5;  // 6th+ args are suppLinks
  if (this.suppLinksNum > 0)
    {
    this.suppLinksArray = new Array();
    for (var i=0; i<this.suppLinksNum; i++)
      this.suppLinksArray[i] = arguments[i+5];
    }
  origPhotoObjectsArray[photoNum++] = this;  // to update thumbs dynamically
  }


/* ********************************************************** */
/* PHOTO OBJECTS                                              */
/* =============                                              */
/* Here's where you create your Photo objects, one for each   */
/* photo in your album. Use this syntax:                      */
/*                                                            */
/* var photoObjName = new Photo(                              */
/*     "photoURL",                                            */
/*     "thumbnailURL",                                        */
/*     "caption",                                             */
/*     "commentary",                                          */
/*     "keywords"                                             */
/*    );                                                      */
/*                                                            */
/*   photoObjName - any legal JS identifier                   */
/*   photoURL - absolute/relative URL of photo                */
/*   thumbnailURL - absolute/relative URL of thumbnail        */
/*   caption - string (use \' for ', don't use ")             */
/*   commentary - string (ditto on \' and ")                  */
/*   keywords - string of form: "keyword1, keyword2, etc."    */
/*                                                            */
/* To display 1-N supplemental links beneath the photo,       */
/* append 1-N of the following lines to the above construct:  */
/*                                                            */
/*   "linktext^linkURL"                                       */
/*                                                            */
/*   linktext - the text that is linked (underlined)          */
/*   ^ - required delimiter between linktext and linkURL      */
/*   linkURL - the URL to load when the link is clicked       */
/*                                                            */
/* Make sure that all your Photo() arguments are separated    */
/* by commas, except for the last argument. Here are two      */
/* examples; the first has 0 supp links, the second has 2:    */
/*                                                            */
/* var brownie = new Photo(                                   */
/*     "brownie.jpg",           // photoURL                   */
/*     "brownie-.jpg",          // thumbnailURL               */
/*     "Kodak Brownie Camera",  // caption                    */
/*     "This 1900 ad extols the virtues ...",  // commentary  */
/*     "1900-10"                // keywords                   */
/* );                                                         */
/*                                                            */
/* var robbery = new Photo(                                   */
/*     "robbery.jpg",           // photoURL                   */
/*     "robbery-.jpg",          // thumbnailURL               */
/*     "The Train Robbery",     // caption                    */
/*     "In this scene from the film ...",  // commentary      */
/*     "Trains, Movies",        // keywords                   */
/*     "Watch Movie^samp.mov",  // supplemental link 1        */
/*     "Jump to URL^jump.html"  // supplemental link 2        */
/* );                                                         */
/*                                                            */
/* KEYWORDS                                                   */
/* ========                                                   */
/* To enable the keyword feature to work (i.e., user selects  */
/* a keyword from the Show: select box to display only those  */
/* thumbnails that are associated with this keyword):         */
/*                                                            */
/* 1. Enter your keywords in the keywordsArray array (above). */
/* 2. Enter the appropriate keywords in each photo object's   */
/*    keywords argument (below).                              */
/* Note: Keyword spelling/case is critical!                   */
/*                                                            */
/* If you choose not to use keywords at all, create an empty  */
/* keywordsArray array (as described above) and leave all of  */
/* your photo objects' keywords arguments blank "".           */
/* ********************************************************** */


var plfalls1 = new Photo(
    "plfalls1.jpg", 
    "plfalls1.jpg.thmb.jpg", 
    "Taylor Creek, above Princess Louise Falls", 
    "Taylor Creek is an original creek feeding what is now called Princess Louise Falls.  It is accessible from Princess Louise Drive.",
    "sites,nature"
);

var plfalls2 = new Photo(
    "plfalls2.jpg", 
    "plfalls2.jpg.thmb.jpg", 
    "Taylor Creek, above Princess Louise Falls", 
    "This is part of an extensive nature trail system along the escarpment above St Joseph Blvd.",
    "sites,nature"
);

var plfalls3 = new Photo(
    "plfalls3.jpg", 
    "plfalls3.jpg.thmb.jpg", 
    "Taylor Creek, above Princess Louise Falls", 
    "The creek runs with water all year round.",
    "sites,nature"
);

var plfalls4 = new Photo(
    "plfalls4.jpg", 
    "plfalls4.jpg.thmb.jpg", 
    "Princess Louise Falls", 
    "Also known as Taylor Falls, after the name Taylor Creek.",
    "sites,nature"
);

var plfalls5 = new Photo(
    "plfalls5.jpg", 
    "plfalls5.jpg.thmb.jpg", 
    "Taylor Creek, above Princess Louise Falls", 
    "The story is that Princess Louise, the wife of the Governor General the Marquis of Lorne, came here by buggy to paint.",
    "sites,nature"
);

var plfalls6 = new Photo(
    "plfalls6.jpg", 
    "plfalls6.jpg.thmb.jpg", 
    "Taylor Creek, above Princess Louise Falls", 
    "This site can be visited either from the nature trail above the escarpment, or from St Joseph Blvd.  Taylor Creek flows into the Ottawa River near Petrie Island.",
    "sites,nature"
);

var despionniersschool = new Photo(
    "despionniersschool.jpg", 
    "despionniersschool.jpg.thmb.jpg", 
    "Ecole des Pionniers", 
    "A French separate school located on Merkley, des Pionniers was the first school built in Fallingbrook",
    "sites,schools"
);

var apollopark = new Photo(
    "apollopark.jpg", 
    "apollopark.jpg.thmb.jpg", 
    "Apollo Park / Apollo Crater", 
    "The Apollo Crater was the first open space in Fallingbrook.  It was the site of the first Crater Bash, which became Canada Day in Fallingbrook.",
    "sites,parks"
);

var arcencielschool = new Photo(
    "arcencielschool.jpg", 
    "arcencielschool.jpg.thmb.jpg", 
    "Ecole Arc en Ciel", 
    "Ecole Arc en ciel is a French public elementary school.",
    "sites,schools"
);

var cardinalcreek = new Photo(
    "cardinalcreek.jpg", 
    "cardinalcreek.jpg.thmb.jpg", 
    "Cardinal Creek", 
    "Cardinal Creek isnt really in Fallingbrook, it is east of Trim Road.  But it is beautiful.",
    "sites,nature"
);

var fallingbrookmall = new Photo(
    "fallingbrookmall.jpg", 
    "fallingbrookmall.jpg.thmb.jpg", 
    "Fallingbrook Center Shopping Mall", 
    "Fallingbrook Center was our first shopping mall, opening in 1988.",
    "sites"
);

var fallingbrookpark = new Photo(
    "fallingbrookpark.jpg", 
    "fallingbrookpark.jpg.thmb.jpg", 
    "Fallingbrook Park", 
    "Fallingbrook Park contains soccer and baseball fields, as well as lots of open space.",
    "sites,parks"
);

var fallingbrookschool = new Photo(
    "fallingbrookschool.jpg", 
    "fallingbrookschool.jpg.thmb.jpg", 
    "Fallingbrook Community Elementary School", 
    "Fallingbrook School was the first shared use school, with the community having access to it after school hours.",
    "sites,schools"
);

var rayfrielcenter = new Photo(
    "rayfrielcenter.jpg", 
    "rayfrielcenter.jpg.thmb.jpg", 
    "Ray Friel Center, Tenth Line Road", 
    "The Ray Friel Center is a major recreational facility, containing a wave pool, a hockey arena, and a fitness center.  A public library is also attached",
    "sites"
);

var firestation = new Photo(
    "firestation.jpg", 
    "firestation.jpg.thmb.jpg", 
    "Fire Station Number 1", 
    "This was the only urban Cumberland fire station when it replaced the old one in Queenswood Heights.",
    "sites"
);

var gardenwaypark = new Photo(
    "gardenwaypark.jpg", 
    "gardenwaypark.jpg.thmb.jpg", 
    "Gardenway Park", 
    "Located on Gardenway Drive, it contains a rink and a large crater with soccer fields.",
    "sites,parks"
);

var jeannesauveschool = new Photo(
    "jeannesauveschool.jpg", 
    "jeannesauveschool.jpg.thmb.jpg", 
    "Ecole Jeanne Sauve", 
    "Located on Gardenway Drive, this was the first French public school.  It also has a joint use agreement with the city.",
    "sites,schools"
);

var northlandspark = new Photo(
    "northlandspark.jpg", 
    "northlandspark.jpg.thmb.jpg", 
    "Northlands Park", 
    "This is a long park with some of the original 50 year old trees from the Fallingbrook Forest.",
    "sites,parks"
);

var sirwilfootball = new Photo(
    "sirwilfootball.jpg", 
    "sirwilfootball.jpg.thmb.jpg", 
    "Sir Wilfrid Laurier Football Field", 
    "Sir Wil has a full football field as well as a smaller practice field.",
    "sites,parks"
);

var sirwilfridlaurierschool = new Photo(
    "sirwilfridlaurierschool.jpg", 
    "sirwilfridlaurierschool.jpg.thmb.jpg", 
    "Sir Wilfrid Laurier Secondary School", 
    "Sir Wil is located on Tenth Line Road, and specializes in high tech and communications.",
    "sites,schools"
);

var stclareschool = new Photo(
    "stclareschool.jpg", 
    "stclareschool.jpg.thmb.jpg", 
    "St Clare Catholic School", 
    "A sister school to St Francis.",
    "sites,schools"
);

var stfrancisschool = new Photo(
    "stfrancisschool.jpg", 
    "stfrancisschool.jpg.thmb.jpg", 
    "St Francis of Assisi Catholic School", 
    "The first English Catholic school is located on Charlemagne Blvd and Watters Road.",
    "sites,schools"
);

var stpeterschool = new Photo(
    "stpeterschool.jpg", 
    "stpeterschool.jpg.thmb.jpg", 
    "St Peter Catholic High School", 
    "St Petes is considered to be the best looking school in the city.",
    "sites,schools"
);

var trilliumschool = new Photo(
    "trilliumschool.jpg", 
    "trilliumschool.jpg.thmb.jpg", 
    "Trillium Elementary School", 
    "Trillium is a public school that was built after Fallingbrook School.  It has a joint use agreement with the City.",
    "sites,schools"
);

var varennespark = new Photo(
    "varennespark.jpg", 
    "varennespark.jpg.thmb.jpg", 
    "Varennes Park", 
    "Located on Varennes Blvd, Varennes Park is next to Trillium School.",
    "sites,parks"
);

var watterspark = new Photo(
    "watterspark.jpg", 
    "watterspark.jpg.thmb.jpg", 
    "Watters Park", 
    "Located on Charlemagne Blvd near Watters Road, it is also a storm water management pond.",
    "sites,parks"
);


/* ********************************************************** */
/* set currPhotoObjectsArray = origPhotoObjectsArray. Don't   */
/* change this code (unless you really know what yer doin')!  */
/* ********************************************************** */

for (var i=0; i<origPhotoObjectsArray.length; i++) 
  currPhotoObjectsArray[i] = origPhotoObjectsArray[i];
currPhotoObjectsArrayLength = origPhotoObjectsArray.length  // set global!


