/**
 * @author Carlos Acosta
 */

//grab all the id elements and place in our array in order to access later
function $(id) {
	return document.getElementById(id);
}

//toggle the contrast of all the elements within div#page-inner'
function contrast() {
	if ( $("page-inner").style.color == "grey") {
		$("page-inner").style.color = "black";
	} else {
		$("page-inner").style.color = "grey";
	}
}

//toggle the image that envokes the text contrast feature. we use this in order to give user feedback
function iconSwitch() {
	if ( $("icon").style.background == "transparent url(images/contrast_low.png) no-repeat") {
		$("icon").style.background = "transparent url(images/contrast_low.png) no-repeat";
	} else {
		$("icon").style.background = "transparent url(images/contrast_high.png) no-repeat";
	}
}

//switch case statement that control the text size in the document
//set my function to accept a parameter
function textSize(setSize) {
	switch (setSize) {
		//if the parameter passed from the HTML document is 'norm' do this
		case "norm":
			$("page-inner").style.fontSize = "0.9em";
			$("page-inner").style.lineHeight = "1.185em";
			break;
		//if the parameter passed from the HTML document is 'big' do this
		case "big":
			$("page-inner").style.fontSize = "1.25em";
			$("page-inner").style.lineHeight = "1.285em";
			break;
		//if the parameter passed from the HTML document is 'bigger' do this
		case "bigger":
			$("page-inner").style.fontSize = "1.5em";
			$("page-inner").style.lineHeight = "1.285em";
			break;
	}
}
