/***********************************************
* 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
***********************************************/

// Put the Script tag right where the belt should go

//Specify the slider's width (in pixels)
var sliderwidth="752px"
//Specify the slider's height
var sliderheight="103px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=1
//configure background color:
slidebgcolor="#FFFFFF"

//Specify the slider's images in a seperate file, array of var leftrightslide=new Array()
var finalslide=''

//Specify gap between each image (use HTML):
var imagegap="<img src=\"assets/spacer.gif\" width=\"1px\"/>"

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=1


////NO NEED TO EDIT BELOW THIS LINE////////////
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide +'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
cross_slide.innerHTML= leftrightslide;
cross_slide2.innerHTML= leftrightslide;
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
cross_slide2.style.left=((actualwidth+slideshowgap)) +"px";

}
lefttime=setInterval("slideright()",55)
}

addLoadEvent(fillup);


function slideleft(){
	if (iedom){
		if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
		cross_slide.style.left=parseInt(cross_slide.style.left)-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)-copyspeed+"px"
		else
		cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

	}
}
function slideright(){
	if (iedom){
		//document.getElementById("stats").innerHTML="Before cross_slide.left=" + cross_slide.style.left;
		if (parseInt(cross_slide.style.left)<(actualwidth))
			cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px";
		else{
			//document.getElementById("stats").innerHTML+="<br>Next #1 - " + (parseInt(cross_slide2.style.left)-actualwidth+slideshowgap)+"px"
			cross_slide.style.left=(parseInt(cross_slide2.style.left)-(actualwidth)-slideshowgap)+"px";
		}
		//document.getElementById("stats").innerHTML+="<br>After cross_slide.left=" + cross_slide.style.left;
		
		//document.getElementById("stats").innerHTML+="<br>Before cross_slide2.left=" + cross_slide2.style.left;
		if (parseInt(cross_slide2.style.left)<(actualwidth))
			cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px";
		else{
			//document.getElementById("stats").innerHTML+="<br>Next #2 - " + (parseInt(cross_slide.style.left)-actualwidth+slideshowgap)+"px"
			cross_slide2.style.left=(parseInt(cross_slide.style.left)-(actualwidth)-slideshowgap)+"px";
		}
		//document.getElementById("stats").innerHTML+="<br>After cross_slide2.left=" + cross_slide2.style.left;

	}
}


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){

write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:1000px;top:0px"></div>')
write('</div></div>')
}
document.write('</td></table>')
}
}

