// JavaScript Document

function slide1sl()
{
	fademi=1;
	
	imgarr=new Array();imgstr=new Array();linkstr=new Array();clslinkstr=new Array();
	
	
	// ADJUST Add in your new images within the array, making sure the first array set is 0. Keep adding images by copying and pasting the rows below.
	imgarr[0]=new Image();imgarr[0].src='3truck_banner.jpg';imgstr[0]='3truck_banner.jpg';linkstr[0]='';clslinkstr[0]='';
	imgarr[1]=new Image();imgarr[1].src='2truck_banner.jpg';imgstr[1]='2truck_banner.jpg';linkstr[1]='';clslinkstr[1]='';
	imgarr[2]=new Image();imgarr[2].src='1truck_banner.jpg';imgstr[2]='1truck_banner.jpg';linkstr[2]='';clslinkstr[2]='';
	imgarr[3]=new Image();imgarr[3].src='4truck_banner.jpg';imgstr[3]='4truck_banner.jpg';linkstr[3]='';clslinkstr[3]='';
	imgarr[4]=new Image();imgarr[4].src='5truck_banner.jpg';imgstr[4]='5truck_banner.jpg';linkstr[4]='';clslinkstr[4]='';
	imgarr[5]=new Image();imgarr[5].src='6truck_banner.jpg';imgstr[5]='6truck_banner.jpg';linkstr[5]='';clslinkstr[5]='';	
	imgarr[6]=new Image();imgarr[6].src='truck_fleet_7.gif';imgstr[6]='truck_fleet_7.gif';linkstr[6]='';clslinkstr[6]='';	


	vcurr=0;vnext=0;vssdiv=null;
	
	// ADJUST The transition time between slides is changed below in miliseconds. 2000 = 2 secs of fading.
	stepc=20*(2000/1000);
	
	dif=0.00;op=1.00;dif=(1.00/stepc);
	uagent = window.navigator.userAgent.toLowerCase();IEB=(uagent.indexOf('msie') != -1)?true:false;
	
	var scompat = document.compatMode;
	if(scompat != "BackCompat"){}
	dstr1='<div id="';
	dstr2='" style="position:absolute;text-align:'+"center"+';width:'+500+'px;height:'+180+'px;visibility:hidden;bottom:5; left:3px;top:5px;padding:0px;margin:0px;overflow:hidden;">';
	dstr3='<img id="slide1img';
	dstr4='" src="TruckAdsScript/images/';
	dstr5='" style="padding:0px;margin:0px;border:0px;" alt="" border="0"></img>';
	dstr6='</div>';
	
	this.slide1dotrans=slide1dotrans;
	this.slide1initte=slide1initte;
	this.slide1initte2=slide1initte2;
	this.slide1beftrans=slide1beftrans;
	this.slide1dotransff=slide1dotransff;
	}
	
	function slide1dotrans()
	{
		if(IEB==true)
		{
			vssdiv.filters[0].apply();
		}
		objc=document.getElementById('slide1d'+vcurr);
		objn=document.getElementById('slide1d'+vnext);
		objc.style.visibility="hidden";
		objn.style.visibility="visible";
		if
		(IEB==true)
		{
			vssdiv.filters[0].play();
		}
		vcurr=vnext;
		vnext=vnext+1;
		
		// ADJUST If you are planning on using more than 6 total images, you need to set the number below to the highest number of images so that it will reset to the first image after it plays through.
		
		if(vnext>=7)	
		
		{
			vnext=0;
		}
		setTimeout('slide1dotrans()',(2000+1000));
		}
		
	function slide1dotransff()
	{
		op=op-dif;
		objc=document.getElementById('slide1d'+vcurr);
		objn=document.getElementById('slide1d'+vnext);		
	
	if(op<(0.00)){op=0.00;}	
	objc.style.opacity = op;	
	objn.style.opacity = 1.00;	
	if(op>(0.00))	
	{		
	setTimeout('slide1dotransff()',50);
	}
		else	
		{
			objc.style.zIndex=2;
			objn.style.zIndex=3;
			
			// ADJUST This is the time (in miliseconds) that each slide will display before transitioning. 4000 = 4 seconds.
			
			setTimeout('slide1beftrans()',1000);
		}
	}
	function slide1beftrans()
	{	
	vcurr=vnext;
	vnext=vnext+1;
	
	
	// ADJUST If you are planning on using more than 6 total images, you need to set the number below to the highest number of images so that it will reset to the first image after it plays through.
	
	
	if(vnext>=7)
	
	{		
	vnext=0;
	}
	op=1.00;
	objc=document.getElementById('slide1d'+vcurr);
	objn=document.getElementById('slide1d'+vnext);
	objc.style.visibility="visible";
	objn.style.visibility="visible";
	objc.style.zIndex=3;
	objn.style.zIndex=2;
	objc.style.opacity = 1.00;
	objn.style.opacity = 1.00;
	slide1dotransff();
	}
	
	function slide1initte2()
	{
		
		// ADJUST If you are planning on using more than 6 total images, you need to set the number below to the highest number of images so that it will reset to the first image after it plays through.
		
		vssdiv=document.getElementById("slide1dv");	if(7>0)	
	{
		objc=document.getElementById('slide1d'+0);
		objc.style.visibility="visible";
	}
	if(5>1)	
	{
		if((IEB==true)||(fademi==0))
	{	
		vcurr=0;
		vnext=1;
		
		
		// ADJUST This is the time (in miliseconds) that the transition between slides takes. 2000 = 2 seconds.
		
		setTimeout('slide1dotrans()',1000);
	}
		else
		{
			vcurr=0;
			vnext=0;
			
			
			// ADJUST This is the time (in miliseconds) that each slide will display before transitioning. 4000 = 4 seconds.
			
			setTimeout('slide1beftrans()',2000);
		}
	}
}
	
function slide1initte()
{
		i=0;
		innertxt="";
		
		// ADJUST If you are planning on using more than 6 total images, you need to set the number below to the highest number of images so that it will reset to the first image after it plays through.
		
		
		for(i=0;i<7;i++)	
		{
			innertxt=innertxt+dstr1+"slide1d"+i+dstr2+linkstr[i]+dstr3+i+dstr4+imgstr[i]+dstr5+clslinkstr[i]+dstr6;
		}
		spage=document.getElementById('slide1dv');
		spage.innerHTML=""+innertxt;
		setTimeout('slide1initte2()',200);
}
s=new slide1sl();s.slide1initte();