// JavaScript Document
currentPos = 0;
timer = "";
currentObj = "";
cycleTimer = "";
width = 462;
padding = 0;
elementsAtm = 4;
cycleSpeed = 7000;

function position(pos) {
clearTimeout(timer);
clearTimeout(cycleTimer);

if (currentObj != "") {
document.getElementById(currentObj).style.color = "#354e30";
}

currentObj = pos;
document.getElementById(pos).style.color = "#354e30";
width = width+(padding*2)
pos = pos - 1;
thestop = (pos*width);
thestop = thestop*-1;
currentCount = currentPos*-1;	
trans(pos, width, thestop, currentCount)
}


function trans(pos, width, thestop, current) {

speed = 50;
document.getElementById('counter').value = (current);

if ((current) > (thestop) & (current) != (thestop)) {
	
	if ((current) != (thestop)) {
	
		current -= speed;
		if (current - speed < thestop) {
			current = thestop
		}
		document.getElementById('images').style.left = current+"px";
		
		currentPos = current;
		if (currentPos < 0) {
			currentPos = currentPos*-1;
		}
		timer = setTimeout ("trans("+pos+", "+width+", "+thestop+", "+current+")", 20);
	}

}
else if ((current) < (thestop) & (current) != (thestop))  {

	if ((current) != (thestop)) {
	
		current += speed;
		if (current + speed > thestop) {
			current = thestop
		}
		document.getElementById('images').style.left = current+"px";
		
		
		currentPos = current;
		if (currentPos < 0) {
			currentPos = currentPos*-1;
		}
		
		timer = setTimeout ("trans("+pos+", "+width+", "+thestop+", "+current+")", 20);
	
	}
}
else {
	currentPos = current;
	if (currentPos < 0) {
		currentPos = currentPos*-1;
	}
	
	//cycleTimer = setTimeout ("cycle()", cycleSpeed);

}
}

function cycle() {
	temp = currentPos;

	if (temp < 0) {
		temp = currentPos*-1;
	}
	pos = (temp/width)+1;
	
	if (pos == elementsAtm) {
		pos = 0;
	}
	
	if (currentObj != "") {
	document.getElementById(currentObj).style.color = "#354e30";
	}
	currentObj = pos+1;
	document.getElementById(currentObj).style.color = "#354e30";
	
	thestop = pos;
	thestop = (pos*width);
	thestop = thestop*-1;
	currentCount = currentPos*-1;	
	trans(pos, width, thestop, currentCount);
}	


currentPubPos = 0;
timerPub = "";
currentObj = "";
cycleTimerPub = "";
widthPub = 462;
paddingPub = 0;
elementsAtmPub = 7;
cycleSpeedPub = 7000;

function positionPub(posPub) {
clearTimeout(timerPub);
clearTimeout(cycleTimerPub);

if (currentObj != "") {
//document.getElementById(currentObj).style.color = "#354e30";
}
currentObj = posPub;
//document.getElementById(posPub).style.color = "#354e30";
widthPub = widthPub+(paddingPub*2)
posPub = posPub - 1;
thestopPub = (posPub*widthPub);
thestopPub = thestopPub*-1;
currentCountPub = currentPubPos*-1;	
transPub(posPub, widthPub, thestopPub, currentCountPub)
}


function transPub(posPub, widthPub, thestopPub, currentPub) {

speedPub = 50;
document.getElementById('counterPub').value = (currentPub);

if ((currentPub) > (thestopPub) & (currentPub) != (thestopPub)) {
	
	if ((currentPub) != (thestopPub)) {
	
		currentPub -= speedPub;
		if (currentPub - speedPub < thestopPub) {
			currentPub = thestopPub
		}
		document.getElementById('imagesPub').style.left = currentPub+"px";
		
		currentPubPos = currentPub;
		if (currentPubPos < 0) {
			currentPubPos = currentPubPos*-1;
		}
		timerPub = setTimeout ("transPub("+posPub+", "+widthPub+", "+thestopPub+", "+currentPub+")", 20);
	}

}
else if ((currentPub) < (thestopPub) & (currentPub) != (thestopPub))  {

	if ((currentPub) != (thestopPub)) {
	
		currentPub += speedPub;
		if (currentPub + speedPub > thestopPub) {
			currentPub = thestopPub
		}
		document.getElementById('imagesPub').style.left = currentPub+"px";
		
		
		currentPubPos = currentPub;
		if (currentPubPos < 0) {
			currentPubPos = currentPubPos*-1;
		}
		
		timerPub = setTimeout ("transPub("+posPub+", "+widthPub+", "+thestopPub+", "+currentPub+")", 20);
	
	}
}
else {
	currentPubPos = currentPub;
	if (currentPubPos < 0) {
		currentPubPos = currentPubPos*-1;
	}
	
	//cycleTimerPub = setTimeout ("cyclePub()", cycleSpeedPub);

}
}

function cyclePub() {
	tempPub = currentPubPos;

	if (tempPub < 0) {
		tempPub = currentPubPos*-1;
	}
	posPub = (tempPub/widthPub)+1;
	
	if (posPub == elementsAtmPub) {
		posPub = 0;
	}
	
	if (currentObj != "") {
	document.getElementById(currentObj).style.color = "#354e30";
	}
	currentObj = posPub+1;
	document.getElementById(currentObj).style.color = "#354e30";
	
	thestopPub = posPub;
	thestopPub = (posPub*widthPub);
	thestopPub = thestopPub*-1;
	currentCountPub = currentPubPos*-1;	
	transPub(posPub, widthPub, thestopPub, currentCountPub);
}	


currentABPos = 0;
timerAB = "";
currentObj = "";
cycleTimerAB = "";
widthAB = 242;
paddingAB = 0;
elementsAtmAB = 6;
cycleSpeedAB = 7000;

function positionAB(posAB) {
clearTimeout(timerAB);
clearTimeout(cycleTimerAB);

if (currentObj != "") {
document.getElementById(currentObj).style.color = "#354e30";
}

currentObj = posAB;
document.getElementById(posAB).style.color = "#354e30";
widthAB = widthAB+(paddingAB*2)
posAB = posAB - 1;
thestopAB = (posAB*widthAB);
thestopAB = thestopAB*-1;
currentCountAB = currentABPos*-1;	
transAB(posAB, widthAB, thestopAB, currentCountAB)
}


function transAB(posAB, widthAB, thestopAB, currentAB) {

speedAB = 50;
document.getElementById('counterAB').value = (currentAB);

if ((currentAB) > (thestopAB) & (currentAB) != (thestopAB)) {
	
	if ((currentAB) != (thestopAB)) {
	
		currentAB -= speedAB;
		if (currentAB - speedAB < thestopAB) {
			currentAB = thestopAB
		}
		document.getElementById('imagesAB').style.left = currentAB+"px";
		
		currentABPos = currentAB;
		if (currentABPos < 0) {
			currentABPos = currentABPos*-1;
		}
		timerAB = setTimeout ("transAB("+posAB+", "+widthAB+", "+thestopAB+", "+currentAB+")", 20);
	}

}
else if ((currentAB) < (thestopAB) & (currentAB) != (thestopAB))  {

	if ((currentAB) != (thestopAB)) {
	
		currentAB += speedAB;
		if (currentAB + speedAB > thestopAB) {
			currentAB = thestopAB
		}
		document.getElementById('imagesAB').style.left = currentAB+"px";
		
		
		currentABPos = currentAB;
		if (currentABPos < 0) {
			currentABPos = currentABPos*-1;
		}
		
		timerAB = setTimeout ("transAB("+posAB+", "+widthAB+", "+thestopAB+", "+currentAB+")", 20);
	
	}
}
else {
	currentABPos = currentAB;
	if (currentABPos < 0) {
		currentABPos = currentABPos*-1;
	}
	
	//cycleTimerAB = setTimeout ("cycleAB()", cycleSpeedAB);

}
}

function cycleAB() {
	tempAB = currentABPos;

	if (tempAB < 0) {
		tempAB = currentABPos*-1;
	}
	posAB = (tempAB/widthAB)+1;
	
	if (posAB == elementsAtmAB) {
		posAB = 0;
	}
	
	if (currentObj != "") {
	document.getElementById(currentObj).style.color = "#354e30";
	}
	currentObj = posAB+1;
	document.getElementById(currentObj).style.color = "#354e30";
	
	thestopAB = posAB;
	thestopAB = (posAB*widthAB);
	thestopAB = thestopAB*-1;
	currentCountAB = currentABPos*-1;	
	transAB(posAB, widthAB, thestopAB, currentCountAB);
}	



currentHNPos = 0;
timerHN = "";
currentObj = "";
cycleTimerHN = "";
widthHN = 220;
paddingHN = 0;
elementsAtmHN = 6;
cycleSpeedHN = 7000;

function positionHN(posHN) {
clearTimeout(timerHN);
clearTimeout(cycleTimerHN);

if (currentObj != "") {
document.getElementById(currentObj).style.color = "#354e30";
}

currentObj = posHN;
document.getElementById(posHN).style.color = "#354e30";
widthHN = widthHN+(paddingHN*2)
posHN = posHN - 1;
thestopHN = (posHN*widthHN);
thestopHN = thestopHN*-1;
currentCountHN = currentHNPos*-1;	
transHN(posHN, widthHN, thestopHN, currentCountHN)
}


function transHN(posHN, widthHN, thestopHN, currentHN) {

speedHN = 50;
document.getElementById('counterHN').value = (currentHN);

if ((currentHN) > (thestopHN) & (currentHN) != (thestopHN)) {
	
	if ((currentHN) != (thestopHN)) {
	
		currentHN -= speedHN;
		if (currentHN - speedHN < thestopHN) {
			currentHN = thestopHN
		}
		document.getElementById('imagesHN').style.left = currentHN+"px";
		
		currentHNPos = currentHN;
		if (currentHNPos < 0) {
			currentHNPos = currentHNPos*-1;
		}
		timerHN = setTimeout ("transHN("+posHN+", "+widthHN+", "+thestopHN+", "+currentHN+")", 20);
	}

}
else if ((currentHN) < (thestopHN) & (currentHN) != (thestopHN))  {

	if ((currentHN) != (thestopHN)) {
	
		currentHN += speedHN;
		if (currentHN + speedHN > thestopHN) {
			currentHN = thestopHN
		}
		document.getElementById('imagesHN').style.left = currentHN+"px";
		
		
		currentHNPos = currentHN;
		if (currentHNPos < 0) {
			currentHNPos = currentHNPos*-1;
		}
		
		timerHN = setTimeout ("transHN("+posHN+", "+widthHN+", "+thestopHN+", "+currentHN+")", 20);
	
	}
}
else {
	currentHNPos = currentHN;
	if (currentHNPos < 0) {
		currentHNPos = currentHNPos*-1;
	}
	
	//cycleTimerHN = setTimeout ("cycleHN()", cycleSpeedHN);

}
}

function cycleHN() {
	tempHN = currentHNPos;

	if (tempHN < 0) {
		tempHN = currentHNPos*-1;
	}
	posHN = (tempHN/widthHN)+1;
	
	if (posHN == elementsAtmHN) {
		posHN = 0;
	}
	
	if (currentObj != "") {
	document.getElementById(currentObj).style.color = "#354e30";
	}
	currentObj = posHN+1;
	document.getElementById(currentObj).style.color = "#354e30";
	
	thestopHN = posHN;
	thestopHN = (posHN*widthHN);
	thestopHN = thestopHN*-1;
	currentCountHN = currentHNPos*-1;	
	transHN(posHN, widthHN, thestopHN, currentCountHN);
}	

currentFAQPos = 0;
timerFAQ = "";
currentObj = "";
cycleTimerFAQ = "";
widthFAQ = 230;
paddingFAQ = 0;
elementsAtmFAQ = 6;
cycleSpeedFAQ = 7000;

function positionFAQ(posFAQ) {
clearTimeout(timerFAQ);
clearTimeout(cycleTimerFAQ);

if (currentObj != "") {
document.getElementById(currentObj).style.color = "#354e30";
}

currentObj = posFAQ;
document.getElementById(posFAQ).style.color = "#354e30";
widthFAQ = widthFAQ+(paddingFAQ*2)
posFAQ = posFAQ - 1;
thestopFAQ = (posFAQ*widthFAQ);
thestopFAQ = thestopFAQ*-1;
currentCountFAQ = currentFAQPos*-1;	
transFAQ(posFAQ, widthFAQ, thestopFAQ, currentCountFAQ)
}


function transFAQ(posFAQ, widthFAQ, thestopFAQ, currentFAQ) {

speedFAQ = 50;
document.getElementById('counterFAQ').value = (currentFAQ);

if ((currentFAQ) > (thestopFAQ) & (currentFAQ) != (thestopFAQ)) {
	
	if ((currentFAQ) != (thestopFAQ)) {
	
		currentFAQ -= speedFAQ;
		if (currentFAQ - speedFAQ < thestopFAQ) {
			currentFAQ = thestopFAQ
		}
		document.getElementById('imagesFAQ').style.left = currentFAQ+"px";
		
		currentFAQPos = currentFAQ;
		if (currentFAQPos < 0) {
			currentFAQPos = currentFAQPos*-1;
		}
		timerFAQ = setTimeout ("transFAQ("+posFAQ+", "+widthFAQ+", "+thestopFAQ+", "+currentFAQ+")", 20);
	}

}
else if ((currentFAQ) < (thestopFAQ) & (currentFAQ) != (thestopFAQ))  {

	if ((currentFAQ) != (thestopFAQ)) {
	
		currentFAQ += speedFAQ;
		if (currentFAQ + speedFAQ > thestopFAQ) {
			currentFAQ = thestopFAQ
		}
		document.getElementById('imagesFAQ').style.left = currentFAQ+"px";
		
		
		currentFAQPos = currentFAQ;
		if (currentFAQPos < 0) {
			currentFAQPos = currentFAQPos*-1;
		}
		
		timerFAQ = setTimeout ("transFAQ("+posFAQ+", "+widthFAQ+", "+thestopFAQ+", "+currentFAQ+")", 20);
	
	}
}
else {
	currentFAQPos = currentFAQ;
	if (currentFAQPos < 0) {
		currentFAQPos = currentFAQPos*-1;
	}
	
	//cycleTimerFAQ = setTimeout ("cycleFAQ()", cycleSpeedFAQ);

}
}

function cycleFAQ() {
	tempFAQ = currentFAQPos;

	if (tempFAQ < 0) {
		tempFAQ = currentFAQPos*-1;
	}
	posFAQ = (tempFAQ/widthFAQ)+1;
	
	if (posFAQ == elementsAtmFAQ) {
		posFAQ = 0;
	}
	
	if (currentObj != "") {
	document.getElementById(currentObj).style.color = "#354e30";
	}
	currentObj = posFAQ+1;
	document.getElementById(currentObj).style.color = "#354e30";
	
	thestopFAQ = posFAQ;
	thestopFAQ = (posFAQ*widthFAQ);
	thestopFAQ = thestopFAQ*-1;
	currentCountFAQ = currentFAQPos*-1;	
	transFAQ(posFAQ, widthFAQ, thestopFAQ, currentCountFAQ);
}	
