// JavaScript Document
function AddItAllUp()
{
    var elems = document.forms["smokequizform"].length;          	//could even look this up!
    var thisvalue;              				//used to find out if element is a checkbox
    var thistype;               				//number (index) of current checkbox
    var thischq;                				//true if checked
    var grandTotal = 0;							//score the user received
	var cutoff1 = 7;							//cut off for page 
    var radiocount = 0;							//radio count initialized
    var RadioCnt = 8;							//radio max count.
	
    while (elems > 0)
      { elems --;
		thistype = document.forms["smokequizform"].elements[elems].type;
        if (thistype == "radio")
           { 
		     thischq = document.forms["smokequizform"].elements[elems].checked;
             thisvalue = document.forms["smokequizform"].elements[elems].value;
             if (thischq)
               { 
					radiocount += 1;
					grandTotal += parseInt(thisvalue);
               };
           };
      };
	
    if (radiocount == RadioCnt)
    {	
	    if (grandTotal >=cutoff1)
	    { 
			location.href = "/surgeongeneral/0,1607,7-216-33084_33091_33294_33924-105643--,00.html";
	    }
 		else
	 	{
  			location.href = "/surgeongeneral/0,1607,7-216-33084_33091_33294_33924-105641--,00.html";
		}
	}
	else
	{
	
		var obj
		obj = document.getElementById("divError")
		obj.style.visibility = "visible";
		obj.innerHTML = "Please answer all questions."
		
		var obj2
		obj = document.getElementById("divError2")
		obj.style.visibility = "visible";
		obj.innerHTML = "Please answer all questions."
		
	}
}