/* --------------------------------------------------------------------
 *	easyslideshow
 *	This script is part of Onlinetools 
 *  http://www.onlinetools.org/easyslideshow/
 *  for technical info contact Chris (info@_nospam_onlinetools.org)
 *	free of use with these lines included!  
 *
 *  Version 1.0 initial                                      
 * --------------------------------------------------------------------*/

/* --------------------------------------------------------------------
 *	Setting up the data.
 * --------------------------------------------------------------------*/
rotator=true; 	// needed for initialising the rotator
n=0;			// initialising the first image 
// The images, add and delete yours here...
//theImages="0.gif, 1.gif, 2.gif, 3.gif, 4.gif, 5.gif, 6.gif, 7.gif, 8.gif, 9.gif".split(", ");
theImages="rev1.jpg, rev2.jpg, rev3.jpg, rev4.jpg, rev5.jpg, rev6.jpg".split(", ");
allImages=theImages.length;
// Creating the needed image objects => preloading
imgObjects=new Array();
for (i in theImages){
	imgObjects[i]=new Image();
	imgObjects[i].src=theImages[i];
	}
/* --------------------------------------------------------------------
 *	function autoplay() 
 *  Allows to automatically change the images.
 *  Options:
 *    run - can be 1 or 0, 1 starts the play, 0 ends it 
 *    srcimage - defines the image that will be replaced by the others
 *    direction - 1 forward -1 backward
 *    speed - speed in milliseconds
 *  requires the function rotate()
 * --------------------------------------------------------------------*/
function autoplay(run,srcimage,direction,speed){
	// delete old settings
	clearInterval(rotator)
	if (run != 0){rotator=setInterval("rotate('"+srcimage+"',"+direction+")",speed)}
	else{clearInterval(rotator)}
	}

/* --------------------------------------------------------------------
 *	function rotate() 
 *  Allows to change the source image to the next or last in the list.
 *  Options:
 *    srcimage - defines the image that will be replaced by the others
 *    direction - 1 forward -1 backward
 * --------------------------------------------------------------------*/
function rotate(srcimage,direction){
n=n+direction;
if (n==allImages) n=0;
if (n==-1) n=allImages-1;
document.images[srcimage].src=imgObjects[n].src;
}
