/***********************************************
* 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
***********************************************/

function slide_right(slide, height, speed, igap, sgap, altgap){
if(!document.getElementsByTagName||!document.createElement)
return;
if(!slide_right.ar)
slide_right.ar=[];
slide_right.ar[this.slid=slide_right.ar.length]=this;
this.slide='<nobr>'+slide.join(igap)+'<\/nobr>';
this.height=height;
this.copyspeed=this.speed=speed;
this.sgap=sgap;
this.altgap=sgap-speed;
this.tspan=document.createElement('span');
this.tspan.id='temp2'+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('<div style="position:relative;width:100%;height:'+this.height+'px;overflow:hidden">')
write('<div style="position:absolute;width:100%;height:'+this.height+'px;" onmouseover="slide_right.ar['+this.slid+'].copyspeed=0" onmouseout="slide_right.ar['+this.slid+'].copyspeed=slide_right.ar['+this.slid+'].speed">')
write('<div id="test22'+this.slid+'" style="position:absolute;right:0px;top:0px"><\/div>')
write('<div id="test33'+this.slid+'" style="position:absolute;right:-1000px;top:0px"><\/div>')
write('<\/div><\/div>')

}
document.body.insertBefore(this.tspan, document.body.firstChild)
this.fillup();
}

slide_right.prototype.fillup=function(){
var cacheobj=this;
this.timgs=document.getElementById('temp2'+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("test22"+this.slid);
this.cross_slide2=document.getElementById("test33"+this.slid);
this.cross_slide.innerHTML=this.cross_slide2.innerHTML=this.slide;
this.actualwidth=document.getElementById("temp2"+this.slid).offsetWidth;
this.cross_slide2.style.right=this.actualwidth+this.sgap+"px"

this.righttime=setInterval(function(){cacheobj.slideright();}, 30);
}


slide_right.prototype.slideright=function(){
if (parseInt(this.cross_slide.style.right)>(this.actualwidth*(-1)+8))
this.cross_slide.style.right=parseInt(this.cross_slide.style.right)-this.copyspeed+"px"
else{
this.cross_slide.style.right=parseInt(this.cross_slide2.style.right)+this.actualwidth+(this.agap? this.sgap : this.altgap)+"px"
this.agap=!this.agap;
}
if (parseInt(this.cross_slide2.style.right)>(this.actualwidth*(-1)+8))
this.cross_slide2.style.right=parseInt(this.cross_slide2.style.right)-this.copyspeed+"px"
else{
this.cross_slide2.style.right=parseInt(this.cross_slide.style.right)+this.actualwidth+(this.agap? this.sgap : this.altgap)+"px"
this.agap=!this.agap;
}
}
