
/***********************************************
* 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
* Modified for multiple use in http://www.dynamicdrive.com/forums by:
* John Davenport Scheuer - username:jscheuer
***********************************************/


/* ********************************************
/* ********************************************
/*
/* P'S NOTES (May 2008):
/* Table has been given an id for access by stylesheet
/* In doc set out thus:
/*
/* <script type="text/javascript">
/* new cbelt(slider, 375, 264, 3, '#000000', '', -15);
/* </script>
/*
/*  Where:
/*  slider is arrayname (slider, slider2, etc, as below)
/*  375 is image/slider width
/*  264 is image/slider height
/*  3 is slider speed, 1-10, 10 is fastest
/*  #000000 is slider bgcolor
/*  '' is the gap between images (best left empty and close-up) 
/*  -15 is the gap between cycles.  -15 will close the gap
/*
/*  note that setting the td to text-align: center will cause 
/*  final slide to blank out suddenly at end of cycle
/* ********************************************
/* ******************************************** */


//Specify the slider images
var slider=new Array()
slider[0]='<a href="http://www.videotourmybusiness.com/contact.php"><img src="http://www.videotourmybusiness.com/images/roller1.gif"><\/a>'
slider[1]='<a href="http://www.videotourmybar.com/contact.php"><img src="http://www.videotourmybusiness.com/images/roller2.gif"><\/a>'
slider[2]='<a href="http://www.videotourmybar.com/contact.php"><img src="http://www.videotourmybusiness.com/images/roller3.gif"><\/a>'
slider[3]='<a href="http://www.videotourmybar.com/contact.php"><img src="http://www.videotourmybusiness.com/images/roller4bs.gif"><\/a>'
slider[4]='<a href="http://www.videotourmybar.com/contact.php"><img src="http://www.videotourmybusiness.com/images/roller5.gif"><\/a>'

//Specify a second slider images (use only for more than one show, use as many as needed)
var slider2=new Array()
// slider2[0]='<a href="http://"><img src="photo6.jpg" border=1></a>'
// slider2[1]='<a href="http://"><img src="photo7.jpg" border=1></a>'

////NO NEED TO EDIT BELOW THIS LINE////////////
function cbelt(slide, width, height, speed, bg, igap, sgap, altgap){
if(!document.getElementsByTagName||!document.createElement)
return;
if(!cbelt.ar)
cbelt.ar=[];
cbelt.ar[this.slid=cbelt.ar.length]=this;
this.slide='<nobr>'+slide.join(igap)+'<\/nobr>';
this.width=width;
this.height=height;
this.copyspeed=this.speed=speed;
this.sgap=sgap;
this.altgap=sgap-speed;
this.tspan=document.createElement('span');
this.tspan.id='temp'+this.slid;
this.tspan.style.visibility='hidden';
this.tspan.style.position='absolute';
this.tspan.style.top='-1000px';
this.tspan.style.left='-9000px';
this.tspan.innerHTML=this.slide;
with (document){
write('<table id="roller" border="0" cellspacing="0" cellpadding="0"><tr><td><div id="counter">Look >> <img id="numbers" src="http://www.website-hit-counters.com/cgi-bin/image.pl?URL=58712-4530" alt="hit counter" border="0" > visitors!</div>')

write('<div style="position:relative;width:'+this.width+'px;height:'+this.height+'px;overflow:hidden">')
write('<div style="position:absolute;width:'+this.width+'px;height:'+this.height+'px;background-color:'+bg+'" onmouseover="cbelt.ar['+this.slid+'].copyspeed=0" onmouseout="cbelt.ar['+this.slid+'].copyspeed=cbelt.ar['+this.slid+'].speed">')
write('<div id="test2'+this.slid+'" style="position:absolute;left:0px;top:0px"><\/div>')
write('<div id="test3'+this.slid+'" style="position:absolute;left:-1000px;top:0px"><\/div>')
write('<\/div><\/div>')

write('<\/td><\/tr><\/table>')
}
document.body.insertBefore(this.tspan, document.body.firstChild)
this.fillup();
}

cbelt.prototype.fillup=function(){
var cacheobj=this;
this.timgs=document.getElementById('temp'+this.slid).getElementsByTagName('img')
for (var i_tem = 0; i_tem < this.timgs.length; i_tem++)
if(typeof this.timgs[i_tem].complete=='boolean'&&!this.timgs[i_tem].complete){
setTimeout(function(){cacheobj.fillup();}, 300);
return;
}
this.cross_slide=document.getElementById("test2"+this.slid);
this.cross_slide2=document.getElementById("test3"+this.slid);
this.cross_slide.innerHTML=this.cross_slide2.innerHTML=this.slide;
this.actualwidth=document.getElementById("temp"+this.slid).offsetWidth;
this.cross_slide2.style.left=this.actualwidth+this.sgap+"px"

this.lefttime=setInterval(function(){cacheobj.slideleft();}, 30);
}


cbelt.prototype.slideleft=function(){
if (parseInt(this.cross_slide.style.left)>(this.actualwidth*(-1)+8))
this.cross_slide.style.left=parseInt(this.cross_slide.style.left)-this.copyspeed+"px"
else{
this.cross_slide.style.left=parseInt(this.cross_slide2.style.left)+this.actualwidth+(this.agap? this.sgap : this.altgap)+"px"
this.agap=!this.agap;
}
if (parseInt(this.cross_slide2.style.left)>(this.actualwidth*(-1)+8))
this.cross_slide2.style.left=parseInt(this.cross_slide2.style.left)-this.copyspeed+"px"
else{
this.cross_slide2.style.left=parseInt(this.cross_slide.style.left)+this.actualwidth+(this.agap? this.sgap : this.altgap)+"px"
this.agap=!this.agap;
}
}

