var leftLogoListScrollBoxHeight = 153;
var rightLogoListScrollBoxHeight = 153;
var scrollLeftDirection = null;
var scrollRightDirection = null;
var scrollStepTimeout = 70;
var scrollStepSize = 5;

function scrollLeftLogoListOneStepUp() {
	if (!(scrollLeftDirection == 'up')) {
		return;
	}
	
	var scrollBox = document.getElementById('leftLogoForm:leftLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop > 0)) {
		var newTop = scrollBox.scrollTop - scrollStepSize;
		if (newTop < 0) {
			newTop = 0;
		}
		
		scrollBox.scrollTop = newTop;
		if (newTop > 0) {
			if (!stopLeftLogoListScroll) {
				setTimeout("scrollLeftLogoListOneStepUp()", scrollStepTimeout);
			}
		} else {
			stopLeftLogoListScroll = true;
		}
	}
}

function scrollLeftLogoListOneStepDown() {
	if (!(scrollLeftDirection == 'down')) {
		return;
	}
	
	var scrollBox = document.getElementById('leftLogoForm:leftLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop + leftLogoListScrollBoxHeight < scrollBox.scrollHeight)) {
		var newTop = scrollBox.scrollTop + scrollStepSize;
		if (newTop >= scrollBox.scrollHeight - leftLogoListScrollBoxHeight) {
			newTop = scrollBox.scrollHeight - leftLogoListScrollBoxHeight - 1;
		}
		
		scrollBox.scrollTop = newTop;
		if (newTop + leftLogoListScrollBoxHeight < scrollBox.scrollHeight) {
			if (!stopLeftLogoListScroll) {
				setTimeout("scrollLeftLogoListOneStepDown()", scrollStepTimeout);
			}
		} else {
			stopLeftLogoListScroll = true;
		}
	}
}

function scrollRightLogoListOneStepUp() {
	if (!(scrollRightDirection == 'up')) {
		return;
	}
	
	var scrollBox = document.getElementById('rightLogoForm:rightLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop > 0)) {
		var newTop = scrollBox.scrollTop - scrollStepSize;
		if (newTop < 0) {
			newTop = 0;
		}
		
		scrollBox.scrollTop = newTop;
		if (newTop > 0) {
			if (!stopRightLogoListScroll) {
				setTimeout("scrollRightLogoListOneStepUp()", scrollStepTimeout);
			}
		} else {
			stopRightLogoListScroll = true;
		}
	}
}

function scrollRightLogoListOneStepDown() {
	if (!(scrollRightDirection == 'down')) {
		return;
	}
	
	var scrollBox = document.getElementById('rightLogoForm:rightLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop + rightLogoListScrollBoxHeight < scrollBox.scrollHeight)) {
		var newTop = scrollBox.scrollTop + scrollStepSize;
		if (newTop >= scrollBox.scrollHeight - rightLogoListScrollBoxHeight) {
			newTop = scrollBox.scrollHeight - rightLogoListScrollBoxHeight - 1;
		}
		
		scrollBox.scrollTop = newTop;
		if (newTop + rightLogoListScrollBoxHeight < scrollBox.scrollHeight) {
			if (!stopRightLogoListScroll) {
				setTimeout("scrollRightLogoListOneStepDown()", scrollStepTimeout);
			}
		} else {
			stopRightLogoListScroll = true;
		}
	}
}

function scrollLeftLogoListUp() {
	if (scrollLeftDirection == 'up') {
		return;
	}
	
	var scrollBox = document.getElementById('leftLogoForm:leftLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop > 0)) {
		if (!stopLeftLogoListScroll) {
			scrollLeftDirection = 'up';
			setTimeout("scrollLeftLogoListOneStepUp()", scrollStepTimeout);
		}
	}
}

function scrollLeftLogoListDown() {
	if (scrollLeftDirection == 'down') {
		return;
	}
	
	var scrollBox = document.getElementById('leftLogoForm:leftLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop + leftLogoListScrollBoxHeight < scrollBox.scrollHeight)) {
		if (!stopLeftLogoListScroll) {
			scrollLeftDirection = 'down';
			setTimeout("scrollLeftLogoListOneStepDown()", scrollStepTimeout);
		}
	}
}

function scrollRightLogoListUp() {
	if (scrollRightDirection == 'up') {
		return;
	}
	
	var scrollBox = document.getElementById('rightLogoForm:rightLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop > 0)) {
		if (!stopRightLogoListScroll) {
			scrollRightDirection = 'up';
			setTimeout("scrollRightLogoListOneStepUp()", scrollStepTimeout);
		}
	}
}

function scrollRightLogoListDown() {
	if (scrollRightDirection == 'down') {
		return;
	}
	
	var scrollBox = document.getElementById('rightLogoForm:rightLogoListScrollBox');
	if (scrollBox && (scrollBox.scrollTop + rightLogoListScrollBoxHeight < scrollBox.scrollHeight)) {
		if (!stopRightLogoListScroll) {
			scrollRightDirection = 'down';
			setTimeout("scrollRightLogoListOneStepDown()", scrollStepTimeout);
		}
	}
}

function toggleLogoHolderVisibility(logoHolderId) {
	var logoHolder = document.getElementById(logoHolderId);
	if (logoHolder) {
		if (logoHolder.style.visibility == 'hidden') {
			logoHolder.style.visibility = 'visible';
		} else {
			logoHolder.style.visibility = 'hidden';
		}
	}
}

function toggleLogoHolderDisplay(logoHolderId) {
	var logoHolder = document.getElementById(logoHolderId);
	if (logoHolder) {
		if (logoHolder.style.display == 'none') {
			logoHolder.style.display = 'inline';
		} else {
			logoHolder.style.display = 'none';
		}
	}
}
