var isIE, isNS, isNS6, isDOM, lR, sR, vis, invis, myTimeOut, goName;

if (document.all) {isIE= true;lR="document.all.";sR=".style";vis="visible";invis="hidden";}
if (document.layers){isNS = true;lR="document.layers.";sR="";vis="show";invis="hide";}
if (document.getElementById &&!isIE) {isDOM=true;lR = "document.getElementById('";sR = "').style";invis ="hidden";vis = "visible"}
if (isDOM == true && navigator.appName =="Netscape") isNS6 = true;
	
var oldwhich = 0;
var x = 0;
var layerTimer;

function postLoad(){
	textAnimate()
}

var goTimer = 0;
var goNum = 1;
var animLayerCount;
var pauseCount = 500;

function setUp(adet){
		animLayerCount = adet;
		for (i=1; i < animLayerCount; i++){
			layer = eval(lR + "z" + i + sR);
		if (isIE) layer.pixelLeft = -320;
		else layer.left = -320;
		layer.visibility = invis;
		}
	}
	
var timer;

function moveIt(whichLayer, toWhere, speed){
	layer = eval(lR + whichLayer + sR);	
	if (isIE)		
		theleft = parseInt(layer.pixelLeft)
	else 
		theleft = parseInt(layer.left)
	rDistance = toWhere - theleft;
	speed = rDistance * .02 + 1;
	toWhereBuffer = toWhere - 6;
	if ( theleft <= 152){
		if(isIE){
			layer.pixelLeft = parseInt(layer.pixelLeft) + speed
			if (layer.pixelLeft <= -50)
				layer.visibility = invis
			else
				layer.visibility = vis
		}
		else layer.left = parseInt(layer.left) + speed
	}
	else{
		return;
	}
	harold = "\"moveIt('" + whichLayer + "', 172, 2)\"";
	eval ("timer= setTimeout(" + harold + ", 1)")
}

function textAnimate(){
	if (goNum >= animLayerCount){
		clearTimeout (myTimeOut);		
		return;
	} 
	else{				
		goName = "z" + goNum;		
		moveIt(goName, 152, 0);
		pauseCount = pauseCount + 300;		
		if (goName == "z4") pauseCount = 300
			goNum ++;
	}
	myTimeOut = setTimeout("textAnimate()", pauseCount);
}
