/***********************************************
* Conveyor belt slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/




//Specify the slider's slide speed (larger is faster 1-10)

var slidespeed=2;
var rampupspeed=1;
var rampdownspeed=.25;

var maxspeed=8;
var speed=0.0;

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed;

var actualwidth='';
var cross_slide, ns_slide;

function fillup(){

cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
cross_slide.innerHTML=cross_slide2.innerHTML=document.getElementById("temp").innerHTML;
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
cross_slide2.style.left=actualwidth+slideshowgap+"px";

lefttime=setInterval("slideleft()",50);
}

window.onload=fillup;

function slideleft()
{
if (speed==-1 && copyspeed>maxspeed*-1)

{copyspeed=copyspeed-rampupspeed}
if (speed==1 && copyspeed<maxspeed)

{copyspeed=copyspeed+rampupspeed}

if (speed==0 && copyspeed>0)
{copyspeed=copyspeed-rampdownspeed}

if (speed==0 && copyspeed<0)
{copyspeed=copyspeed+rampdownspeed}

if (copyspeed>0)
{

    if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
    {
        cross_slide.style.left=parseInt(cross_slide.style.left)-Math.round(copyspeed)+"px";
    }   
    else
    {
        cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px";
    }

    if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
    {
    cross_slide2.style.left=parseInt(cross_slide2.style.left)-Math.round(copyspeed)+"px";
    }
    else
    {
        cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px";
    }

}
  if (copyspeed<0 && parseInt(cross_slide.style.left)<0)
{

    if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
    {
        cross_slide.style.left=parseInt(cross_slide.style.left)-Math.round(copyspeed)+"px";
    }   
    else
    {
        cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px";
    }

    if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
    {
    cross_slide2.style.left=parseInt(cross_slide2.style.left)-Math.round(copyspeed)+"px";
    }
    else
    {
        cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px";
    }

}  
}
