//function podAdvancer() {
//	
//	var newsBkgndImage = new Image();
//	newsBkgndImage.src = "/assets/home/images/pods/mopPod_new.gif";
//
//	var newsBkgndImage = new Image();
//	newsBkgndImage.src = "/assets/home/images/pods/virtualtourPod.gif";
//
//	var newsBkgndImage = new Image();
//	newsBkgndImage.src = "/assets/home/images/pods/libraryPod.gif";
//
//	var podContainer = document.getElementById('podContainer');
//	var podChildren = new Array();
//	for (var i = 0; i < podContainer.childNodes.length; i++) {
//		if (podContainer.childNodes[i].nodeName != '#text') {
//			podChildren[podChildren.length] = podContainer.childNodes[i];
//		}
//	}
//	var index = 0;
//	var noToShow = 3;
//
//	if (noToShow > podChildren.length) noToShow = podChildren.length;
//		//	if (index > podChildren.length - noToShow) index = podChildren.length - noToShow;
//	for (var i = index; i < index + noToShow; i++) {
//		podChildren[i].style.display = 'block';
//	}
//
//	function advancePodsLeft() {
//		if (index + noToShow >= podChildren.length) return;
//		podChildren[index].style.display = 'none';
//		podChildren[index + noToShow].style.display = 'block';
//		index = index + 1;
//		if (index + noToShow >= podChildren.length) {
//			/*var disabledRightButton = document.getElementById('spotlightButtonRight');
//				disabledRightButton.src = "/assets/home/images/spotlight-button-r-disabled.gif";*/
//		}
//	}
//	
//	var advancePodsLeftLink = document.getElementById("advance-left-a");
//		advancePodsLeftLink.onclick = advancePodsLeft;
//
//	function advancePodsRight() {
//		if (index <= 0) return;
//		index = index - 1;
//		podChildren[index + noToShow].style.display = 'none';
//		podChildren[index].style.display = 'block';
//		if (index <= 0) {
//			/*var disableLeftButton = document.getElementById('spotlight-left-button');
//				disableLeftButton.src = "/assets/home/images/spotlight-button-l-disabled.gif";*/
//		}
//	}
//	
//	var advancePodsRightLink = document.getElementById("advance-right-a");
//		advancePodsRightLink.onclick = advancePodsRight;
//}

function podAdvancer() {
	
	document.getElementById("advance-left-a").onclick = advancePodsUp;	
    document.getElementById("advance-right-a").onclick = advancePodsDown;	
	
	var disabledUpButton = document.getElementById('podsImageUp');
	var disabledDownButton = document.getElementById('podsImageDown');	
	
	var podContainer = document.getElementById('podContainer');
	var podChildren = [];
	
	var index = 0;
	var noToShow = 3;
	
	for (var i = 0; i < podContainer.childNodes.length; i++) {
		if (podContainer.childNodes[i].nodeName == 'LI') {
			podChildren[podChildren.length] = podContainer.childNodes[i];
		}
	}	
	var podChildren_length = podChildren.length;
	function advancePodsDown() {
		for(var i = 0; i < 3; i++){			
			if (index + noToShow >= podChildren_length) break;
			podChildren[index].style.display = 'none';
			podChildren[index + noToShow].style.display = 'block';
			index++;			
		}
		if (index + noToShow >= podChildren_length) {							
		  disabledDownButton.src = "/assets/templates/toptier/images/arrow-down-end.gif";	
		}
		disabledUpButton.src = "/assets/templates/toptier/images/arrow-up.gif";
	}	

	function advancePodsUp() {
		for(var i = 0; i < 3; i++){
			if (index <= 0) break;
			index--;
			podChildren[index + noToShow].style.display = 'none';
			podChildren[index].style.display = 'block';
		}
		if (index <= 0) {			
		  disabledUpButton.src = "/assets/templates/toptier/images/arrow-up-end.gif";		
		}
		disabledDownButton.src = "/assets/templates/toptier/images/arrow-down.gif";			
	}

} //end of podAdvancer

window.onload = function() {
	podAdvancer();
	clearDefault();
}
