var toggleTable = [];
var previousDivID = "";
var showAll = false;
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
 //check if new toggle
 if(previousDivID != szDivID) {
  
  //if not the first toggle then hide the previous value
  if(previousDivID != "" && !showAll) {
   toggleBox(previousDivID, 0);
  }
  //set previous to current
  previousDivID = szDivID;
 }
 
 //check if toggle value was stored
 if(toggleTable[szDivID] != null) {
  //we clicked this before
  
  //in case you want to force the state  
  if(iState != null) 
   toggleTable[szDivID] = iState;
  else
   toggleTable[szDivID] = iState = toggleTable[szDivID] == 0 ? 1 : 0;
 }
 else 
 {
  //we have not clicked this before
  toggleTable[szDivID] = iState = 1;
 }
 
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.display = document.layers ? (iState ? "show" : "hide") :
   (iState ? "block" : "none");
}

function scoreQuestions() {

	var yes = 0;
	var no = 0;

	var numquestions = 21;
	var mainform = document.forms[0];
	
	for(i = 1; i < numquestions+1; i++) {
	
		if(mainform["q"+i]) {
			if(mainform["q"+i][0].checked)
				yes++;
			else
				no++;
		}
		else if(mainform["q0"+i]) {
			if(mainform["q0"+i][0].checked)
				yes++;
			else
				no++;
		}
	}
	
	changeTxt(yes,"yes");
	changeTxt(no,"no");
}
function changeTxt(t,p) {
   if (document.getElementById) {
     document.getElementById(p).innerHTML = t;
   }
}