function Conveyorbelt()
{
	var ie=document.all;
	var ns6=document.getElementById&&!document.all;

	this.leftrightslide = new Array();

	this.pics = new Array();
	this.picsName = new Array();
	this.picswidth = 0;

	this.sliderwidth="540px";
	this.sliderheight="120px";
	this.slidespeed=3;
	this.slidebgcolor="rgb(255,204,51)";

	this.finalslide='';

	this.copyspeed=this.slidespeed;
//	this.leftrightslide='<nobr>'+this.leftrightslide.join(this.imagegap)+'</nobr>';
	this.iedom=document.all||document.getElementById;

	this.actualwidth='';
	this.cross_slide=0;
	this.ns_slide=0;
	this.MaxImages=0;
	var lefttime=0;

	//Specify gap between each image (use HTML):
	this.imagegap=" ";

	//Specify pixels gap between each slideshow rotation (use integer):
	this.slideshowgap=5;

	this.Iteration=0;
	this.Iteration = SetConveryorObject(this);

	this.LoadImages = function ()
	{
		var iMax = arguments.length -1;
		var i=0;

		for(i=0;i<=iMax;i++)
		{
			this.picsName[i] = this.GetImageName(arguments[i]);
			this.leftrightslide[i] = "<a href='#'><img name='" + this.picsName[i] + "' src='images/petescars/" + arguments[i] + "' border='0'></a>";
			//this.leftrightslide[i] = "<a href='#'><img src='images/petescars/" + arguments[i] + "' border='0'></a>";
			this.pics[i] = new Image;
			this.pics[i].src = "images/petescars/" + arguments[i];

			this.picswidth += this.pics[i].width;
		}
		//this.leftrightslide='<nobr>'+this.leftrightslide.join(this.imagegap)+'</nobr>';
		this.leftrightslide="<b style='white-space: nowrap;'>"+this.leftrightslide.join(this.imagegap)+"</b>";

		this.MaxImages = iMax;
	}

	this.GetObject = function (sName)
	{

		var oDiv = ns6? document.getElementById(sName) : document.all(sName);
		return oDiv;
	}

	this.GetImageName = function (sImg)
	{
		sImg = sImg.replace(".jpg","");
		sImg = sImg.replace(".gif","");
		return sImg;
	}

	this.AssignImages = function ()
	{
		var i=0;

		for(i=0;i<=this.MaxImages;i++)
		{
			document.images[this.picsName[i]].src = this.pics[i].src;
		}
	}

////NO NEED TO EDIT BELOW THIS LINE////////////

/*
	this.slideleft = function()
	{

		if (this.iedom)
		{
			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.slideshowgap+"px";

			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.slideshowgap+"px";
		}
		else if (document.layers)
		{
			if (this.ns_slide.left>(this.actualwidth*(-1)+8))
				this.ns_slide.left-=this.copyspeed;
			else
				this.ns_slide.left=this.ns_slide2.left+this.actualwidth+this.slideshowgap;

			if (this.ns_slide2.left>(this.actualwidth*(-1)+8))
				this.ns_slide2.left-=this.copyspeed;
			else
				this.ns_slide2.left=ns_slide.left+this.actualwidth+this.slideshowgap;
		}
	}
*/
//	this.Test = function()
//	{
		//alert(212);
//		return 212;
//	}

	this.fillup = function(oThis)
	{
		var i=0;
		if (this.iedom)
		{
			this.cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
			this.cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;

			//cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
			//this.cross_slide2.innerHTML = this.leftrightslide;
			this.cross_slide.innerHTML=this.cross_slide2.innerHTML = this.leftrightslide;
			//alert(this.cross_slide.innerHTML);
			this.AssignImages(); //andre
			//alert(this.picswidth);

			this.actualwidth=document.all? this.cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
			this.cross_slide2.style.left=this.actualwidth+this.slideshowgap+"px";
			//alert(this.actualwidth);
		}
		else if (document.layers)
		{
			this.ns_slide=document.ns_slidemenu.document.ns_slidemenu2;
			this.ns_slide2=document.ns_slidemenu.document.ns_slidemenu3;
			this.ns_slide.document.write(this.leftrightslide);
			this.ns_slide.document.close();
			this.actualwidth=this.ns_slide.document.width;
			this.ns_slide2.left=this.actualwidth+this.slideshowgap;
			this.ns_slide2.document.write(this.leftrightslide);
			this.ns_slide2.document.close();
		}
		//lefttime=setInterval("this.slideleft",30);
		//Test(oThis);
		iCurrentConveyorObject99 = this.Iteration
		lefttime=setInterval("slideleft(iCurrentConveyorObject99)",30);
		//alert(33);

	}

//window.onload=fillup

	this.InitSlideShow = function(sDiv)
	{
		var sInnerHtml;
		var oDiv = this.GetObject(sDiv);

		if (this.iedom)
			sInnerHtml = '<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+this.leftrightslide+'</span>';

		if (this.iedom||document.layers)
		{
			with (document)
			{
				sInnerHtml += '<table border="0" cellspacing="0" cellpadding="0"><td>';
				if (this.iedom)
				{
					sInnerHtml += '<div style="border-style:solid; border-width:2px; border-color:rgb(43,92,171); position:relative;width:'+this.sliderwidth+';height:'+this.sliderheight+';overflow:hidden">';
					sInnerHtml += '<div style="position:absolute;width:'+this.sliderwidth+';height:'+this.sliderheight+';background-color:'+this.slidebgcolor+'" onMouseover="oConveyor.copyspeed=0" onMouseout="oConveyor.copyspeed=oConveyor.slidespeed">';
					sInnerHtml += '<div id="test2" style="position:absolute;left:0px;top:0px"></div>';
					sInnerHtml += '<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>';
					sInnerHtml += '</div></div>';
				}
				else if (document.layers)
				{
					sInnerHtml += '<ilayer width='+this.sliderwidth+' height='+this.sliderheight+' name="ns_slidemenu" bgColor='+this.slidebgcolor+'>';
					sInnerHtml += '<layer name="ns_slidemenu2" left=0 top=0 onMouseover="oConveyor.copyspeed=0" onMouseout="oConveyor.copyspeed=oConveyor.slidespeed"></layer>';
					sInnerHtml += '<layer name="ns_slidemenu3" left=0 top=0 onMouseover="oConveyor.copyspeed=0" onMouseout="oConveyor.copyspeed=oConveyor.slidespeed"></layer>';
					sInnerHtml += '</ilayer>';
				}
				sInnerHtml += '</td></table>';

				oDiv.innerHTML = sInnerHtml;
			}
		}
	}

}

//do not reference these variables outside of this object.
var oConveyorObjects99 = new Array();
var iConveryorObjectCount99 = 0;
var iCurrentConveyorObject99;

function SetConveryorObject(o)
{
	oConveyorObjects99[iConveryorObjectCount99] = o;
	iConveryorObjectCount99 ++;
	return iConveryorObjectCount99 -1;
}


function GetConveryorObject(i)
{
	return oConveyorObjects99[i];
}

function Test()
{
	//alert(123);
	var o = GetConveryorObject();
	alert(o.leftrightslide);
	//alert(123);
}


function slideleft(i)
	{
		var obj = GetConveryorObject(i);
		if (obj.iedom)
		{
			if (parseInt(obj.cross_slide.style.left)>(obj.actualwidth*(-1)+8))
				obj.cross_slide.style.left=parseInt(obj.cross_slide.style.left)-obj.copyspeed+"px";
			else
				obj.cross_slide.style.left=parseInt(obj.cross_slide2.style.left)+obj.actualwidth+obj.slideshowgap+"px";

			if (parseInt(obj.cross_slide2.style.left)>(obj.actualwidth*(-1)+8))
				obj.cross_slide2.style.left=parseInt(obj.cross_slide2.style.left)-obj.copyspeed+"px";
			else
				obj.cross_slide2.style.left=parseInt(obj.cross_slide.style.left)+obj.actualwidth+obj.slideshowgap+"px";
		}
		else if (document.layers)
		{
			if (obj.ns_slide.left>(obj.actualwidth*(-1)+8))
				obj.ns_slide.left-=obj.copyspeed;
			else
				obj.ns_slide.left=obj.ns_slide2.left+obj.actualwidth+obj.slideshowgap;

			if (obj.ns_slide2.left>(obj.actualwidth*(-1)+8))
				obj.ns_slide2.left-=obj.copyspeed;
			else
				obj.ns_slide2.left=ns_slide.left+obj.actualwidth+obj.slideshowgap;
		}
	}

