// slides.js 12/13/2001 //

// Methods for Images1 object.
function nextImg() {

	var iNext,the_image;

	iNext = this.ndx + 1;
	if (iNext == this.names.length) iNext = 0;
	the_image = this.names[iNext].src;
	document.Image1.src = the_image;
	this.ndx = iNext;
}

function prevImg() {

	var iNext,the_image;

	iNext = this.ndx - 1;
	if (iNext == -1) iNext = this.names.length - 1;
	the_image = this.names[iNext].src;
	document.Image1.src = the_image;
	this.ndx = iNext;
}

// Constructor function to define an object type,
// that specifies its name, properties, and methods.
function Images1(aNames, iNdx) {

	this.names = aNames || [];
	this.ndx = iNdx || 0;
	this.disp = nextImg;
	this.prev = prevImg;
}
//	this.imgLoad = preLoad || [];
// oImages.imgLoad; // Load images into memory.

function preLoad(aImgNames) {

var aImgSrc = new Array();
var k = aImgNames.length;

for ( var i = 0; i < k; i++ ) {
		aImgSrc[i] = new Image();
		aImgSrc[i].src = cPATH + aImgNames[i] + cEXT;
}

return aImgSrc;
}

//---End Images1 object.---//

// Slideshow() functions:

var the_timeout;
var the_secs = 1000; // 1 second delay between slides.
var iShow = 0;
// This function swaps in the next image in the array.
// When array end is reached the index is set back to zero.
// SetTimeout calls "function" in the_secs seconds.

function runShow() {

oImages.disp(); // Swap image at <img name=Image1 > to next.
the_timeout = setTimeout("runShow();",the_secs);
}

function slideShow() {

if (OKAY) {

if (iShow==0) {
	iShow = 1;
	runShow();
} else {
	iShow = 0;
	clearTimeout(the_timeout);
}//endif
}//endif OKAY

}

function chgTimeDelay() {

the_secs = parseInt(window.document.fSlide.Seconds.value)*1000;
window.document.fSlide.Seconds.blur();

}

function myOnErrorHandler(message, url, lineNumber) {

	var messageList = new Array();
	var urlList = new Array();
	var lineNumberList = new Array();

	messageList[messageList.length] = message;
	urlList[urlList.length] = url;
	lineNumberList[lineNumberList.length] = lineNumber;
	alert(" __myOnErrorHandler__\n"+messageList[0]+
	"\n in file name: "+urlList[0]+
	"\n on line number: "+lineNumberList[0]);
	return true;
}

function msgWin(sText){

var windowOptions = "width=400,height=300,resizeable";
var sMsg = "<html><head><title>Message</title></head><body>";
sMsg += "<h1>Please have patience.</h1>";
sMsg += "<h3>There are " + sText + " images to be downloaded!";
sMsg += " On a slow speed (26.4k) connection, these images";
sMsg += " could take a while to download.</h3>";
sMsg += '<h2 align="center"><a href="javascript:close()">';
sMsg += '<img src="images/BlCloseWin.gif" border="0" width="138"';
sMsg += 'height="30" alt="Close Window" /></a></h2></body></html>';
var msg_Window = window.open("","msgWindow",windowOptions);
msg_Window.document.writeln(sMsg);

return msg_Window;

}

// eof.
