<!--alert("finished loading");-->/* * * pSlideShow * by Nicholas Rezanof Rinard * contact: nicholas.r.rinard@dartmouth.edu *          http://www.dartmouth.edu/~nrrinard/ * * Written: May, 2000 * Last Updated: September, 2001 * * This software is released under the GPL, with the hope but not the * requirement that modified/improved code would actually be sent back to me * */////////////////////////////////////////////////////////////////////////////////// A note about implementation:                                               //// This JavaScript source file contains all the code necessary for any kind of//// pSlideShow.                                                                ////                                                                            //// If I have done my job right then an implementor should not need            //// to venture into this code file in order to implement pSS; editing the      //// config file ought to be enough.                                            ////                                                                            //// A separate file contains the variable declarations and other               //// needfully-edited things.                                                   ////                                                                            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////                                                                            //// FUNCTION DEFINITIONS:                                                      //// pSlideShow function: constructor for a pSlideShow object                   //function pSlideShow(	pImageNamesArray,						pCurrentImageNumber,						pImagePath,						pNumberOfPages,						pImageSlotName){	// Variables and Arrays	this.pImageNamesArray = pImageNamesArray;	this.pCurrentImageNumber = pCurrentImageNumber;	this.pImagePath = pImagePath;	this.pNumberOfPages = pNumberOfPages;	this.pImageSlotName = pImageSlotName;	this.pImageObjectsArray = new Array;		// Methods	this.initialize = initialize;	this.switchImages = switchImages;		// Initialization	for(pTemp = 0; pTemp < this.pImageNamesArray.length; pTemp++)		this.pImageObjectsArray[pTemp] = new Image();}// initialize(): pSlideShow method: install the first image when the page is  //// loaded. This is the same as "scrolling by zero".                           //function initialize(){	this.switchImages(0); }// switchImages(): pSlideShow method: first set pCurrentImageNumber, then, for//// each image slot in the slideshow, create a new image entry in pImageArray, //// if needed, then install the new image. Lastly, update the plugins.         //function switchImages(pScrollAmount){	// 1. wrap pCurrentImageNumber to a proper value.                         //	this.pCurrentImageNumber = mod( (this.pCurrentImageNumber + pScrollAmount), this.pImageNamesArray.length);		// 2. for each pPhotoSpot...   ("pin" == "p image number")                //	for (var pin = 0; pin < this.pNumberOfPages; pin++) {				// A. find the right number for the current installation              //		var bTempNumber = mod( (this.pCurrentImageNumber + pin), this.pImageNamesArray.length);				// B. if the image isn't loaded, load it                              //		if (!this.pImageObjectsArray[bTempNumber].src) {			this.pImageObjectsArray[bTempNumber].src = this.pImagePath + this.pImageNamesArray[bTempNumber];		}				// C. install the image                                               //		document[this.pImageSlotName + pin].src = this.pImageObjectsArray[bTempNumber].src;	}		// 3. call a function which executes implementation-specific code in the  //	// config file.                                                           //	updatePlugins(this);}// mod(): javascript's mod function "does the wrong thing" by the definition I//// was taught.                                                                //function mod(a, b){	while (a < 0)		a += b;	while (a >= b)		a -= b;	return a;<!--alert("finished loading");-->}//                                                                            //////////////////////////////////////////////////////////////////////////////////