/*
Description: Left to right autoplaying image slideshow
Author: ricocheting.com
Copyright 2007-2009 webdesignersnyc.com
Last Update: 5/4/2009
Version: v2.3-autoslide
*/


//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow
var scrollerwidth='158';
var scrollerheight='69';

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

var scrollerwindow=5; // number of images to show at once


//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="images2/logos_03.gif">';
slideimages[1]='<img src="images2/logos_05.gif">';
slideimages[2]='<img src="images2/logos_07.gif">';
slideimages[3]='<img src="images2/logos_09.gif">';
slideimages[4]='<img src="images2/logos_11.gif">';
slideimages[5]='<img src="images2/logos_13.gif">';
slideimages[6]='<img src="images2/logos_15.gif">';
slideimages[7]='<img src="images2/logos_17.gif">';
slideimages[8]='<img src="images2/logo_19.gif">';
slideimages[9]='<img src="images2/logo_21.gif">';
slideimages[10]='<img src="images2/logo_23.gif">';
slideimages[11]='<img src="images2/logo_25.gif">';
slideimages[12]='<img src="images2/logo_27.gif">';
slideimages[13]='<img src="images2/logo_29.gif">';
slideimages[14]='<img src="images2/logo_31.gif">';

//extend this list



//###################################
//### Do not edit below this line ###

i=0;
x=slideimages.length;
var timer = "";

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

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

		// if first block needs moved to the right
		if(parseInt(tdiv.style.left) < parseInt(udiv.style.left)){
			tdiv.innerHTML=''
			tdiv.style.left=(scrollerwidth*(scrollerwindow+1)) +"px"
			for(y=0; y<=scrollerwindow; y++){
				tdiv.innerHTML+=code((i++)%x);
			}
		}
		// if second block needs moved to the right
		else{
			udiv.innerHTML=''
			udiv.style.left=(scrollerwidth*(scrollerwindow+1)) +"px"
			for(y=0; y<=scrollerwindow; y++){
				udiv.innerHTML+=code((i++)%x);
			}
		}

		// keep auto scrolling
		tdiv.style.left=(parseInt(tdiv.style.left)-increment) +"px"
		udiv.style.left=(parseInt(udiv.style.left)-increment) +"px"

		timer = setTimeout("startscroll(-1)",speed)
	}
}//#-#startscroll()


// code used surround each slide/image (to keep width mainly)
function code(idx,i,y,x){
	return '<div style="width:'+scrollerwidth+'px;float:left;text-align:center;">'+slideimages[idx]+'</div>';
}//#-#code()
