/*
Left-Right image slideshow Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, terms of use, and 100's more scripts, visit http://dynamicdrive.com

modified for multiple slides by ricocheting.com
*/

///////configure the below four variables to change the style of the slider///////
//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth='120';
var scrollerheight='50';

var speed=30; // speed to every increment (40 = 0.4 sec)
var increment=1; // pixels to move every <speed>

//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]='<img src="images/logo3.gif">';
slideimages[1]='<img src="images/logo8.gif">';
slideimages[2]='<img src="images/logo9.gif">';
slideimages[3]='<img src="images/logo10.gif">';
slideimages[4]='<img src="images/logo13.gif">';
slideimages[5]='<img src="images/logo14.gif">';
slideimages[6]='<img src="images/logo15.gif">';
slideimages[7]='<img src="images/logo16.gif">';
slideimages[8]='<img src="images/logo19.gif">';
slideimages[9]='<img src="images/logo22.gif">';
slideimages[10]='<img src="images/logo23.gif">';
slideimages[11]='<img src="images/logo24.gif">';
slideimages[12]='<img src="images/logo25.gif">';

//extend this list

///////Do not edit pass this line///////////////////////
     
i=(slideimages.length*10)-2;
var timer = "";

function startscroll(sign){
	tdiv=document.getElementById("first")

	//if halfway and scrolling left
	if (parseInt(tdiv.style.left) < (scrollerwidth*-1) && parseInt(tdiv.style.left) > (scrollerwidth*-2)+3){
		tdiv.style.left=(parseInt(tdiv.style.left)-increment) +"px"
		timer = setTimeout("startscroll(-1)",speed)
	}	
	//if at the end of it's movement
	else{
		x=slideimages.length;

		// if it moved
		if(parseInt(tdiv.style.left) == (scrollerwidth*-1)){return;}
		
		i = i + (-1*sign);

		tdiv.innerHTML=''
		tdiv.style.left=(scrollerwidth*-1) +"px"
		tdiv.innerHTML=slideimages[(i+1)%x]+slideimages[(i+2)%x]+slideimages[(i+3)%x]+slideimages[(i+4)%x]+slideimages[(i+5)%x]+slideimages[(i+6)%x]

		// keep auto scrolling
		tdiv.style.left=(parseInt(tdiv.style.left)-increment) +"px"
		timer = setTimeout("startscroll(-1)",speed)
	}
}

// start auto play/scrolling on window load
window.onload=function(){
	document.getElementById('first').style.left = (parseInt(document.getElementById('first').style.left)-increment) +"px";
	startscroll(-1);
}


