/*
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]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=8"><img src="images2/logos_03.gif" border="0"></a>';
slideimages[1]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=6"><img src="images2/logos_05.gif" border="0"></a>';
slideimages[2]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=2"><img src="images2/logos_07.gif" border="0"></a>';
slideimages[3]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=5"><img src="images2/logos_09.gif" border="0"></a>';
slideimages[4]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=4"><img src="images2/logos_11.gif" border="0"></a>';
slideimages[5]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=3"><img src="images2/logos_13.gif" border="0"></a>';
slideimages[6]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=41"><img src="images2/logos_15.gif" border="0"></a>';
slideimages[7]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=7"><img src="images2/logos_17.gif" border="0"></a>';
slideimages[8]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=39"><img src="images2/logo_19.gif" border="0"></a>';
slideimages[9]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=81"><img src="images2/logo_21.gif" border="0"></a>';
slideimages[10]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=78"><img src="images2/logo_23.gif" border="0"></a>';
slideimages[11]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=135"><img src="images2/logo_25.gif" border="0"></a>';
slideimages[12]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=47"><img src="images2/logo_27.gif" border="0"></a>';
slideimages[13]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=56"><img src="images2/logo_29.gif" border="0"></a>';
slideimages[14]='<a href="http://www.petwebexpress.com/advanced_search_result.php?manufacturers_id=53"><img src="images2/logo_31.gif" border="0"></a>';

//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()

