// Global Javascript stuff
var waxOff = new Image();
waxOff.src = 'images/drill_closed.gif';

var waxOn = new Image();
waxOn.src = 'images/drill_open.gif';

// Function Definitions here
	function toggleAnswer(answerID, linkID)
	{
		var theAnswer = document.getElementById(answerID);
		var linkObj = document.getElementById(linkID)
		if (!theAnswer.displayOn)
		{
			linkObj.style.backgroundImage = "url(images/drill_open.gif)";
			theAnswer.style.display = 'block';
			theAnswer.displayOn = true;
			//drawOverlay();
		}
		else {
			linkObj.style.backgroundImage = "url(images/drill_closed.gif)";
			theAnswer.style.display = 'none';
			theAnswer.displayOn = false;
			//drawOverlay();
		}
	}

	function showAnswer (answerID, linkObj)
	{
		var theAnswer = document.getElementById(answerID);
		theAnswer.style.display = 'block';
		theAnswer.displayOn = true;
		linkObj.style.backgroundImage = "url(images/drill_open.gif)";
		//drawOverlay();
	}

	function hideAnswer (answerID, linkObj)
	{
		var theAnswer = document.getElementById(answerID);
		theAnswer.style.display = 'none';
		theAnswer.displayOn = false;
		linkObj.style.backgroundImage = "url(images/drill_closed.gif)";
		//drawOverlay();
	}
//
//function drawOverlay()
//{
//	var theHeight = document.getElementById("mainCol").offsetHeight - 10;
//	document.getElementById("botCurve").style.height = theHeight.toString() + "px";
//}

function expandAll()
{
	var questions;
	var questionCount;
	var theAnswer;
	var counter;
	
	questions = document.getElementsByTagName("dt");
	questionCount = questions.length;
	
	for (counter=0; counter<questionCount; counter++)
	{
		theAnswer = questions[counter].getAttribute('answer');
		showAnswer(theAnswer, document.getElementById(questions[counter].id));
	}
}

function collapseAll()
{
	var questions;
	var questionCount;
	var theAnswer;
	var counter;
	
	questions = document.getElementsByTagName("dt");
	questionCount = questions.length;
	
	for (counter=0; counter<questionCount; counter++)
	{
		theAnswer = questions[counter].getAttribute('answer');
		hideAnswer(theAnswer, document.getElementById(questions[counter].id));
	}
}