/*****************************
*  Toggle font size functions 
*/

//Returns an array of child nodes from the passed in element that all have the passed in class name's (specific areas on page to affect only)
function getElementsByClass(theNode, toolClass, contentClass, navClass) {

	var cArray = [];
	var cArrayLoc = 0;
		
	function doTree(theNode) {
		if (theNode.className == toolClass || theNode.className == contentClass || theNode.className == navClass) {
			  cArray[cArrayLoc] = theNode;
			  cArrayLoc++;
		}
		for (var i=0, len=theNode.childNodes.length; i<len; i++) {
			  doTree(theNode.childNodes[i]);
		}
	}
		
	doTree(theNode);
	return cArray;
}

//assume user is not already on large text
var smallFont = true;

//Uses array to update all child nodes of element
function toggleFontSizes() {

	var fontSizeToggle = new Array(document.getElementById('body'), document.getElementById('footer'));
	
	if (!fontSizeToggle) {
		return;
	}
	
	if(smallFont) {
		for (var i = 0; i < fontSizeToggle.length; i++) {
			fontSizeToggle[i].style.fontSize = "1.2em";
			smallFont = false;
		}
	}
	else {
		for (var i = 0; i < fontSizeToggle.length; i++) {
			fontSizeToggle[i].style.fontSize = "1em";
			smallFont = true;
		}
	}
}

