var scrollerwidth=136
var scrollerheight=60
var pausebetweenimages=3000
var animType = 0

var HSlideImages=new Array()

for (var tmpIndex=0; tmpIndex < 30; tmpIndex++)
    HSlideImages[tmpIndex]='<a href="customers.html?a=customersDot"><img src="../images/customers_logo/customer_logos_anim' + (tmpIndex+1) + '.gif" border=0"></a>';

var animIndex;
if (HSlideImages.length > 1)
 animIndex=2
else
 animIndex=0

function locateObject(n, d) { //v3.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
    }
  if(!(x=d[n])&&d.all) x=d.all[n];
  
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document);
  return x;
}

function moveFirstImage(whichdiv)
{
if (document.all)
{
	tdiv=eval(whichdiv)
	if (tdiv.style.pixelLeft>0&&tdiv.style.pixelLeft<=5)
	{
		tdiv.style.pixelLeft=0
		setTimeout("moveFirstImage(tdiv)",pausebetweenimages)
		setTimeout("moveSecondImage('custLogoDiv_second')",pausebetweenimages)
		return
	}
	if (tdiv.style.pixelLeft>=tdiv.offsetWidth*-1)
	{
		tdiv.style.pixelLeft-=5
		setTimeout("moveFirstImage(tdiv)",10)
	}
	else{
		tdiv.style.pixelLeft=scrollerwidth+5
		tdiv.innerHTML=HSlideImages[animIndex]
		
	getNextIndex()
}
}
else
{
tlayer=eval(whichdiv)
if (tlayer.left>0&&tlayer.left<=5)
{
tlayer.left=0
setTimeout("moveFirstImage(tlayer)",pausebetweenimages)
setTimeout("moveSecondImage(locateObject('custLogoDiv_second'))",pausebetweenimages)
return
}
if (tlayer.left>=tlayer.document.width*-1)
{
tlayer.left-=5
setTimeout("moveFirstImage(tlayer)",10)
}
else
{
tlayer.left=scrollerwidth+5
tlayer.document.write(HSlideImages[animIndex])
tlayer.document.close()

	getNextIndex()
}
}
}

function moveSecondImage(whichdiv)
{
if (document.all)
{
tdiv2=eval(whichdiv)

if (tdiv2.style.pixelLeft>0&&tdiv2.style.pixelLeft<=5)
{
	tdiv2.style.pixelLeft=0
	setTimeout("moveSecondImage(tdiv2)",pausebetweenimages)
	setTimeout("moveFirstImage('custLogoDiv_first')",pausebetweenimages)
	return
}
if (tdiv2.style.pixelLeft>=tdiv2.offsetWidth*-1){
	tdiv2.style.pixelLeft-=5
	setTimeout("moveSecondImage('custLogoDiv_second')",10)
}
else
{
	tdiv2.style.pixelLeft=scrollerwidth+5
	tdiv2.innerHTML=HSlideImages[animIndex]
	
	getNextIndex()
}
}
else if (document.layers)
{
tlayer2=eval(whichdiv)

if (tlayer2.left>0&&tlayer2.left<=5)
{
tlayer2.left=0
setTimeout("moveSecondImage(tlayer2)",pausebetweenimages)
setTimeout("moveFirstImage(locateObject('custLogoDiv_main').document.layers['custLogoDiv_first'])",pausebetweenimages)
return
}
if (tlayer2.left>=tlayer2.document.width*-1)
{
tlayer2.left-=5
setTimeout("moveSecondImage(tlayer2)",10)
}
else
{
tlayer2.left=scrollerwidth+5
tlayer2.document.write(HSlideImages[animIndex])
tlayer2.document.close()

getNextIndex()

}
}
}

function getNextIndex()
{
	if (animType = 0) {
	if (animIndex==HSlideImages.length-1)
		animIndex=0
	else
		animIndex++
	}
	else {
		animIndex =  Math.ceil(Math.random() * HSlideImages.length);
		if (animIndex > HSlideImages.length - 1)
			animIndex = HSlideImages.length - 1;
		else	
		if (animIndex < 0)
			animIndex = 0;
	}
	
}

function startScroll(){
	
	// DISABLE FOR NOW
	return;

	if (document.all)
	{
		
		locateObject('custLogoDiv_second').style.left=scrollerwidth+5
		locateObject('custLogoDiv_second').visibility='visible'
		moveFirstImage(locateObject("custLogoDiv_first"))
	}
	else if (document.layers)
	{
		locateObject('custLogoDiv_main').visibility='show'
		locateObject('custLogoDiv_first').visibility='show'
		locateObject('custLogoDiv_second').left=scrollerwidth+5
		locateObject('custLogoDiv_second').visibility='show'
		moveFirstImage(locateObject('custLogoDiv_main').document.layers['custLogoDiv_first'])
	}
}

