var lastClicked = "box1";

window.onload = init;
function init() {
	
	function handleOne() {
		ScrollSection('one-pane', 'scroller', 'one-pane'); 
		var myObj = document.getElementById("one-tab");
		handleClick(myObj);
		return false;
}//end handleOne()

	function handleTwo() {
		
		ScrollSection('two-pane', 'scroller', 'one-pane'); 
		var myObj = document.getElementById("two-tab");
		handleClick(myObj);
		return false;
		
	}//end handleTwo
	function handleThree() {
		
		ScrollSection('three-pane', 'scroller', 'one-pane'); 
		var myObj = document.getElementById("three-tab");
		handleClick(myObj);
		return false;
		
	}//end handleThree

	function handleFour() {
		ScrollSection('four-pane', 'scroller', 'one-pane'); 
		var myObj = document.getElementById("four-tab");
		handleClick(myObj);
		return false;
	}//end handleFour
	function handleFive() {
		ScrollSection('five-pane', 'scroller', 'one-pane'); 
		var myObj = document.getElementById("five-tab");
		handleClick(myObj);
		return false;
	}//end handleFive
	function handleSix() {
		ScrollSection('six-pane', 'scroller', 'one-pane'); 
		var myObj = document.getElementById("six-tab");
		handleClick(myObj);
		return false;
	}//end handleSix

	document.getElementById("one-tab").onclick   = handleOne;
	document.getElementById("two-tab").onclick   = handleTwo;
	document.getElementById("three-tab").onclick = handleThree;
	document.getElementById("four-tab").onclick  = handleFour;
	document.getElementById("five-tab").onclick  = handleFive;
	document.getElementById("six-tab").onclick   = handleSix; 
	
}//end init();
function handleClick(obj) {
//check to see if the currenty clicked box is the lastClicked box, if it is, return;
if (obj.parentNode.id == lastClicked) {
	return;
}//end if				
	obj.parentNode.style.backgroundColor='#d07628';
	document.getElementById(lastClicked).style.backgroundColor='#6d6e72';
	lastClicked = obj.parentNode.id;	
	
}// end handleClick(obj)
