/*--------------------------------------------------------------#
#	Slide Show Presentation					#
#	slide.js	  					#
#	by Greg Amer gregamer@gascripts.com			#
#	http://www.gascripts.com				#
#______________________________________________________________*/

/*--------------------------------------------------------------#
#	Slide Show Presentation -component list			#
#								#
#	1. slide.js - Class - slide				#
#		* navigation and slide link functions		#
#	2. slideconfig.js - configuration file			#
#		* user slide declarations			#
#		* user defined variables 			#
#	3. slidedummies.js - TOB dummy functions		#
#	*  additional components				#
#		* slide.htm - html demo				#
#		* demo images					#
#		* navigation images				#
#								#
#______________________________________________________________*/


/*------Initialize Global Varibles------------------------------#
#								#
#	Slide Tracker/Counter i.				#
#	Each slide will package itself in the position Array.	#
#	Boolean's are reserved variables for use with the	#
#	configuration file.					#
#______________________________________________________________*/

i = 0;
x = 0;
position = new Array(x);
filename = false;
sldcount = false;
sldname  = false;
sldlink  = false;


/*------Class slide Constructor---------------------------------#
#								#
#	Each slide is an image, with standard image properties	#
#	Width, Height, src, & Name. Additionally, each slide 	#
#	can have the properties Link & Title. note: Title is	#
#	designed to take advantage of IE4's title property.	#
#______________________________________________________________*/


function slide(Width,Height,src,Name,Link,Title) {

this.Width = Width;
this.Height = Height;
this.src = src;
this.Name = Name;
this.Link = Link;
this.Title = Title;

/*------slide/position packager---------------------------------#
#______________________________________________________________*/

	{
	position[x] =	this;
			x++;
	}
}


/*------slide Navigation Functions------------------------------#
#								#
#	The slide navigation functions do just what their	#
#	names imply. slideUpdate(i) tracks the last slide 	#
#	displayed. slideFirst() brings the show to the first	#
#	slide, slideLast the last slide etc.			#
#______________________________________________________________*/


function slideUpdate(i) {
return i;}					
						
function slideFirst() {
	slideUpdate(i = 0);
		showslide(i);
}
function slideNext() {						/* How Do These Work ?__________*/
	slideUpdate(i++);
		if ( i > x-1 ) { i = 0; }			/* Each slide reports it's	*/
		showslide(i);					/* destination to slideUpdate	*/
}								/* slideUpdate simply stores	*/
function slidePrev() {						/* the destination and returns	*/
	slideUpdate(i--);					/* a real reference to the 	*/
								/* slide displayed.		*/
		if ( i < 0 ) { i = x-1; }			/*______________________________*/
		showslide(i);
}
function slideLast() {
	slideUpdate(i = x-1);
		showslide(i);
}


/*------slide Link Functions------------------------------------#
#								#
#	The slide Link Functions utilize the slide Link		#
#	property to provide a link additional, slide specific	#
#	information.						#
#______________________________________________________________*/


function slideLink() {						/* Using the slide Link_________*/
	slideUpdate(i);
	window.open(position[i].Link);				/* To use the slide Link, 	*/
}								/* set an html link with the	*/
function slideLinkover() {					/* href attribute set to 	*/
	slideUpdate(i);						/* href='javascript:slideLink()'*/
	window.status = position[i].Link;			/* Then declare the variable	*/
return true;							/* sldlink with the value of	*/
}								/* the link position in the	*/
function slideLinkout() {					/* document.			*/
	window.status = "";					/*______________________________*/
return true;
}


/*------slide Display Function----------------------------------#
#								#
#	The showslide function displays the slide, optional	#
#	form elements & optional sldlink.			#
#______________________________________________________________*/


function showslide(i) {


document.images[show].src = position[i].src;			/* What is show ?_______________*/
document.images[show].title = position[i].Title;
document.images[show].onclick = slideLink;			/* Declare show in the config.	*/
								/* file. This is the name of 	*/
								/* image space for the slides.	*/
	if (sldcount) {						/*______________________________*/

		document.forms[formname].elements[sldcount].value = i + 1;
	}
	if (sldname) {

		document.forms[formname].elements[sldname].value = position[i].Name;
	}

	if (sldlink) {

		document.links[sldlink].onmouseover = slideLinkover;
		document.links[sldlink].onmouseout = slideLinkout;
	}
}

/*------Start the Show------------------------------------------#
#______________________________________________________________*/

window.onload = slideFirst

/*--------------------------------------------------------------#
#	Slide Show Presentation					#
#	slide.js	  					#
#	by Greg Amer gregamer@gascripts.com			#
#	http://www.gascripts.com				#
#______________________________________________________________*/