//Array containing the IDs of the info boxes
var headingID = new Array();
headingID[0] = "infoOverview";
headingID[1] = "infoSpecs";
headingID[2] = "infoSensors";
headingID[3] = "infoDemo";

//Array containing the IDs of the menu links
var linkID = new Array();
linkID[0] = "infoOverviewLink";
linkID[1] = "infoSpecLink";
linkID[2] = "infoSensorLink";
linkID[3] = "infoDemoLink";

//Initialize the InfoArea
function initInfoArea() {
	var isOverview = true;
	for (infoID in headingID) {
		if (isOverview == true) {
			document.getElementById(headingID[infoID]).style.display = 'block';
			isOverview = false;
		}
		else {
			document.getElementById(headingID[infoID]).style.display = 'none';
		}				
	}
}

//Swap out which information is displayed		
function swapInfo(objectID, parentLink) {
	for (infoID in headingID) {
		if (headingID[infoID] == objectID) {
			document.getElementById(headingID[infoID]).style.display = 'block';	
		}
		else {
			document.getElementById(headingID[infoID]).style.display = 'none';
		}				
	}
	swapStyle(parentLink);
}

//Swap the style of the link if it is clicked
function swapStyle(objectID) {
	for (infoID in linkID) {
		if (linkID[infoID] == objectID) {
			document.getElementById(linkID[infoID]).className = 'piLinkOn';	
		}
		else {
			document.getElementById(linkID[infoID]).className = 'piLink';
		}				
	}
}