<!--
/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	Written by Bugimus 
	Copyright © 1998-2001 Bugimus, all rights reserved.
	You may use this code for your own *personal* use provided you leave this comment block intact.  
	A link back to Bugimus' page would be much appreciated.  
	http://bugimus.com/

   version 2.1  10/9/99 Modified series, rise, fall, & showimage to work 
   						with multiple layers in Netscape.  IE didn't 
						require any changes.
   version 2.01	4/22/99	Modified showimage to be backward compatible with
						Netscape Navigator 3.
   version 2.0	4/07/99 Re-written using more object oriented design.
   version 1.2	4/01/99 Added enhanced javascript browser compatibility 
						and error message bulletproofing.
   version 1.1	2/22/99 Added imgidx tracking in showImage
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */

// Animation falls - The higher the image number, the lower the elevation.
// This script was designed with the convention of an object floating and
// sinking into the page.  That's how the names came about.  You could also
// substitute start and end imagery for the animations if that works better
// for you.
//
// image0  Highest (start)
// image1  .
// image2  .
// image3  .
// image4  Lowest (end)
//
// Each animation is called a 'series', series of images successively 
// switched to create an animation effect.
//
// 'placement' refers to the name of the img tag on the page.
//

function series( objectName, rate, divString ) {
	this.IE5=this.NN4=this.NN6=false
	if(document.all)this.IE5=true
	else if(document.layers)this.NN4=true
	else if(document.getElementById)this.NN6=true

	var netscapestring=""
	var tmp
	var bgn, end
	var i
	var divstring=divString

	i=0
	bgn=0
	end=0
	do { 
		i++
		tmp = ""
		netscapestring += "document."
		end = divstring.indexOf(",")
		if( end > -1 ){
			tmp = divstring.substring(bgn,end)
			divstring = divstring.substring(end+1,divstring.length)
		} else {
			end = divstring.length
			tmp = divstring.substring(bgn,end)
			divstring = null
		}
		netscapestring += tmp
		if(divstring)netscapestring += "."
	} while( divstring )

	if(this.NN4)this.obj=netscapestring

	this.objname  = objectName
	this.rate = rate
	this.divname = tmp
	this.imageindex = -1
	this.numimages = 0
	this.stopall = false
	this.goingup = false
	this.timer = null
	this.img = new Array()
	this.loadimage = loadImg
	this.showimage = showImg
	this.rise = Rise
	this.fall = Fall
	this.fallrise = fallRise
	this.stop = Stop
	this.incimage = incImg
	this.decimage = decImg
	this.loop = Loop
	this.bounce = Bounce
}

function Loop( placement, direction ) {
	if( direction=="UP" ) this.decimage(); else this.incimage();
	this.showimage( placement, this.imageindex );
	if( !this.stopall ) this.timer=setTimeout( this.objname+".loop('"+placement+"','"+direction+"')", this.rate );
	else this.stopall=false;
}

function Bounce( placement ) {
	if( this.goingup && this.imageindex >= this.numimages-1 ) this.goingup=false;
	else if( !this.goingup && this.imageindex <= 0 ) this.goingup=true;
	if( this.goingup ) this.incimage(); else this.decimage();
	this.showimage( placement, this.imageindex );
	if( !this.stopall ) this.timer=setTimeout( this.objname+".bounce('"+placement+"')", this.rate );
	else this.stopall=false;
}

function Stop() {
	this.stopall=true;
}

function incImg() {
  if( this.imageindex >= this.numimages-1 ) this.imageindex=0;
  else this.imageindex++;
}

function decImg() {
  if( this.imageindex <= 0 ) this.imageindex=this.numimages-1;
  else this.imageindex--;
}

function fallRise( placement, delay ) {
	this.rise( placement, this.fall( placement, delay ) );
	return delay;
}

function Fall( placement, delay ) {
	for( k=1; k<this.numimages; k++, delay++ ) {
		if( this.NN4 ) this.timer=setTimeout( this.obj+".document."+placement+".src='"+this.img[k].src+"'\;", delay*this.rate );
		else this.timer=setTimeout( "document."+placement+".src='"+this.img[k].src+"'\;", delay*this.rate );
		this.imageindex=k;
	}
	return delay;
}

function Rise( placement, delay ) {
	for( k=this.numimages-2; k>=0; k--, delay++ ) {
		if( this.NN4 ) this.timer=setTimeout( this.obj+".document."+placement+".src='"+this.img[k].src+"'\;", delay*this.rate );
		else this.timer=setTimeout( "document."+placement+".src='"+this.img[k].src+"'\;", delay*this.rate );
		this.imageindex=k;
	}
	return delay;
}

function showImg( placement, imagenum ) {
	if( imagenum<this.numimages )
		if( this.NN4 ) eval(this.obj+".document."+placement+".src = this.img[imagenum].src");
		else eval("document."+placement+".src = this.img[imagenum].src");
	this.imageindex=imagenum;
}

function loadImg( source ) {
	this.img[this.numimages] = new Image();
	this.img[this.numimages].src = source;
	this.numimages++;
}

//-->