//FAQ functions
function showAnswer(val)
{
	hideAnswers();
	document.getElementById(val + "Answer").style.display="block";			
}
function hideAnswers()
{
	for(x=1; x<=10; x++)
	{
		document.getElementById("Question" + x + "Answer").style.display="none";
	}
}
//Footer Positioning Functions
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}
/*window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}*/
function showWinner(place)
{
	//first hid all of the winners.
	hideAll();
	
	var thisWinner;
	var thisWinnerDetails;
	var xy;
	
	thisWinner = place + "a";
	thisWinnerDetails = place + "b";
	
	//then show the requested winners information.
	document.getElementById(thisWinner).style.display = "block";
	document.getElementById(thisWinnerDetails).style.display = "block";
	
	//unbold all places
	xy = "winnersSub8";
	document.getElementById(xy).style.fontWeight="normal";
	
	xy = "winnersSub9";
	document.getElementById(xy).style.fontWeight="normal";
	
	xy = "winnersSub10";
	document.getElementById(xy).style.fontWeight="normal";
	
	//bold correct place
	if(place == 1)
	{
		xy = "winnersSub8";
	}
	else if (place == 2)
	{
		xy = "winnersSub9";
	}
	else
	{
		xy = "winnersSub10";
	}
	document.getElementById(xy).style.fontWeight="bold";
}

//hide all of the winner divs.
function hideAll()
{
	document.getElementById("1a").style.display = "none"
	document.getElementById("1b").style.display = "none"
	
	document.getElementById("2a").style.display = "none"
	document.getElementById("2b").style.display = "none"
	
	document.getElementById("3a").style.display = "none"
	document.getElementById("3b").style.display = "none"
}