var selLink = null;

	function showIcon(which) {
		document.getElementById('icon'+which).style.display = 'inline';
	}
	
	function hideIcon(chartlength) {
		for (var i = 1; i < chartlength; i++) {
			if (i != selLink) {
				document.getElementById('icon'+i).style.display = 'none';
			}
		}
	}
	function showpage(which, chartlength){
		updateLinkState(chartlength);
		var sectionTitle = document.getElementById('contentTitle'+which).innerHTML;
		var sectionLink = document.getElementById('contentLink'+which).innerHTML;
		document.getElementById('mainImage').src = document.getElementById('image'+which).src;
		document.getElementById('mainTitle').innerHTML = sectionTitle;
		document.getElementById('mainContent').innerHTML = document.getElementById('contentShort'+which).innerHTML;
		document.getElementById('imgLink').href = sectionLink;
		document.getElementById('mainLink').innerHTML = "<span style='color:#A22929;'>+</span>&nbsp;<a href='" + sectionLink + "' class='sectionLinks'>Learn More</a>";
		document.getElementById('link'+which).className = "homeLinksSelected";
		document.getElementById('icon'+which).style.display = 'inline';
		//document.getElementById('div'+which).style.background= '#F7F3F7';
		selLink = which;
		hideIcon(chartlength);
	}
	
	function updateLinkState(chartlength)
	{
		for (var x = 1; x < chartlength; x++){
//			document.getElementById('service'+x).style.display = "none";	
			document.getElementById('link'+x).className = "homeLinks";
		}
	}
