
var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;

function addResults()
{
	
	
	display("score1",addScore("section1",6));
	display("score2",addScore("section2",5));
	display("score3",addScore("section3",3));

}

function addScore(formID,totalQs)
{
	var theForm=document.forms[formID];
	var totalScore=0;
	for (i=1; i <= totalQs; i++){
		var menuName = "A"+i;
		var whichSelect = theForm[menuName].selectedIndex;
		totalScore += parseInt(theForm[menuName].options[theForm[menuName].selectedIndex].value);
	}

	
	return totalScore;
}

function display(id, str) {
  if (NS4) {
    with (document[id].document) {
      open();
      write(str);
      close();
    }
  } else {
    document.all[id].innerHTML = str;
  }
}



