/* *************************************************************
** 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 = false;  // 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(
   "Den Oever",
   "harbour",
   "chapel",
   "Stroe"
   );


/* ********************************************************** */
/* 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:                      */
/*                                                            */
/*   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       */
/*                                                            */
/* ********************************************************** */

var wrdo00 = new Photo(
    "fotos/wr-do00.jpg", 
    "duim/wr-do00.jpg", 
    "A muddy Hofstraat", 
    "A photo of Den Oever from the early 20th century, when metalled roads clearly hadn't reached our parts of the world.",
    "Den Oever"
);

var kapel2 = new Photo(
    "fotos/kapel2.jpg", 
    "duim/kapel2.jpg", 
    "The chapel in Den Oever", 
    "This photo was taken in the Spuitsteeg in Den Oever, looking to the chapel. The old Den Oever was not much more than a couple of alleys and streets around the harbour.",
    "Den Oever, chapel"
);

var kapel = new Photo(
    "fotos/kapel.jpg", 
    "duim/kapel.jpg", 
    "The chapel in Den Oever", 
    "The chapel in Den Oever has also been used as VOC warehouse, community centre and barn. In the 1960s it was derelict and was demolished but later rebuilt in the Zuiderzeemuseum of Enkhuizen.",
    "Den Oever, chapel"
);

var wierdo = new Photo(
    "fotos/wier-do-1925.jpg", 
    "duim/wier-do-1925.jpg", 
    "Unloading the seaweedharvest", 
    "A photo from 1925. In the harbour a ship that has just returned from the seaweed fields is unloaded. The seaweed will now be taken to the ditches in order to rinse out the salt..",
    "Den Oever, harbour"
);

var flora = new Photo(
    "fotos/wr-flora.jpg", 
    "duim/wr-flora.jpg", 
    "the Flora in Den Oever", 
    "One of the first Florafestivities, early 20th century.",
    "Den Oever"
);

var wrdo01 = new Photo(
    "fotos/wr-do01.jpg", 
    "duim/wr-do01.jpg", 
    "The Hofstraat in Den Oever", 
    "Another picture of the Hofstraat, taken from almost the same point but slightly later. Almost the whole of  Den Oever can be seen on this picture. To the left the Noorderweg, on the right the chapel. On the foreground very clearly the 'tuunwoalle'. These little grass-sod walls were used as fences and used to be all over the island. Now you can only see them around the museumfarm on Stroe.",
    "Den Oever"
);

var wrhaven = new Photo(
    "fotos/wr-haven.jpg", 
    "duim/wr-haven.jpg", 
    "The harbour of Den Oever", 
    "A picture from the old days, when the dike along the harbourstreet wasn't half as high as it is today.",
    "Den Oever, harbour"
);

var wroev = new Photo(
    "fotos/wr-oev.jpg", 
    "duim/wr-oev.jpg", 
    "Den Oever in bird's view", 
    "A nice overview of the old Den Oever. Note the emptiness in the back. Now most of this is built-up area as well.",
    "Den Oever"
);

var wroeverh = new Photo(
    "fotos/wr-oeverh.jpg", 
    "duim/wr-oeverh.jpg", 
    "The harbour of Den Oever", 
    "The old fishing harbour of Den Oever, with on the background the Havenstraat (harbourstreet). Further back you can see the chapel, now rebuilt in the Zuiderzeemuseum, Enkhuizen.",
    "Den Oever, chapel, harbour"
);

var wrostg = new Photo(
    "fotos/wr-o-stg.jpg", 
    "duim/wr-o-stg.jpg", 
    "Den Oever", 
    "The Spuitsteeg in Den Oever, looking to the chapel. The old Den Oever was not much more than a couple of alleys and streets around the harbour.",
    "Den Oever, chapel"
);

var stroe = new Photo(
    "fotos/stroe-1.jpg", 
    "duim/stroe-1.jpg", 
    "Stroe", 
    "The Mennonite vermaning (secret church). Only the very attentive viewers will notice this building used to be a church. It lay more or less hidden behind a farm and burned down in the 1930s.",
    "Stroe"
);

/* ********************************************************** */
/* 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!



