var msPower = document.all != null
var myValues = new Array();
var popUp = false;
var myAnswer = ""
var whichQ;
var filledUp;
var vAttempt = 0;

for(i=0;i<100;i++)
	myValues[i] = 0;

function SetIt(question,value,noAnswers){
   if(whichQ!=question.name){
	noChecked = 0;
	whichQ = question.name;
   }
   if(question.checked==true){
    if(noChecked!=noAnswers){
     noChecked = noChecked + 1
     if(value==false){
	myValues[question.name] = myValues[question.name] + 100;
     }else{
     	myValues[question.name] = myValues[question.name] + value;
     }
    }else{
      question.checked = false;
    }
   }else{
     noChecked = noChecked - 1;
     if(value==false){
	myValues[question.name] = myValues[question.name] - 100;
     }else{
     myValues[question.name] = myValues[question.name] - value;
     }
   }   
}

function checkMC(questionToCheck){
	if (popUp != true && vAttempt < 2){		
		if(myValues[questionToCheck] == 1){				
			changeProp('correct','','style.visibility','visible','LAYER');
			popUp = true;
			vAttempt = vAttempt + 1;
		}else{
			myValues[questionToCheck] = 0;
			changeProp('incorrect','','style.visibility','visible','LAYER');
			popUp = true;
			vAttempt = vAttempt + 1;
		}
	}else{
		if(popUp != true && vAttempt >=2){
			if(myValues[questionToCheck] == 1){				
			changeProp('correct','','style.visibility','visible','LAYER');
			popUp = true;
			vAttempt = vAttempt + 1;
			}else{
				myValues[questionToCheck] = 0;
				changeProp('incorrect2','','style.visibility','visible','LAYER');
				popUp = true;
				vAttempt = vAttempt + 1;
			}
		}
	}
}