
function checkForm()
{
	var survey = document.surveyForm;
	var radioItem1 = survey.Q1;
	var radioItem2 = survey.Q3;
	var radioItem3 = survey.Q7;
	var radioItem4 = survey.Q8;
	var radioItem5 = survey.Q9;
	var radioItem6 = survey.Q10;
	var radioItem7 = survey.Q11;
	var radioItem8 = survey.Q12;
	var radioItem9 = survey.Q14;
	var user_input = "";
	errorMsg="";
	
/************************************************************************
*	QUESTION 1
*************************************************************************/	
	for (i=0;i<radioItem1.length;i++)
	{
		if (radioItem1[i].checked)
		{
			user_input = radioItem1[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 1");
	} 
	else if(user_input=="Other" && survey.Q1Other.value.trim()=="")
	{
		addError("Question 1: Other");
	}
	
/************************************************************************
*	QUESTION 2
*************************************************************************/		
	user_input="";
	if (survey.Q2A.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q2B.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q2C.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q2D.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q2E.checked)
	{
		user_input = "checked";
	}

	if (user_input=="")
	{
		addError("Question 2");
	} 
	else if(survey.Q2E.checked && survey.Q2Other.value.trim()=="")
	{
		addError("Question 2: Other");
	}

/************************************************************************
*	QUESTION 3
*************************************************************************/	
	user_input="";
	for (i=0;i<radioItem2.length;i++)
	{
		if (radioItem2[i].checked)
		{
			user_input = radioItem2[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 3");
	} 
	else if(user_input=="Yes, this was a valuable experience because" && survey.Q3Reason.value.trim()=="")
	{
		addError("Question 3: Yes, this was a valuable experience because");
	}
	
/************************************************************************
*	QUESTION 4
*************************************************************************/		
	user_input="";
	if (survey.Q4A.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q4B.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q4C.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q4D.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q4E.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q4F.checked)
	{
		user_input = "checked";
	}

	if (user_input=="")
	{
		addError("Question 4");
	} 

/************************************************************************
*	QUESTION 5
*************************************************************************/		
	user_input="";
	if (survey.Q5A.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q5B.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q5C.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q5D.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q5E.checked)
	{
		user_input = "checked";
	}
	else if (survey.Q5F.checked)
	{
		user_input = "checked";
	}
	if (user_input=="")
	{
		addError("Question 5");
	} 	
	
	
/************************************************************************
*	QUESTION 6
*************************************************************************/
	user_input = survey.Q6.value.trim();
	if (user_input=="")
	{
		addError("Question 6");
	} 		

/************************************************************************
*	QUESTION 7
*************************************************************************/	
	user_input="";
	radioItem = survey.Q7;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 7");
	} 

/************************************************************************
*	QUESTION 8
*************************************************************************/	
	user_input="";
	radioItem = survey.Q8;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 8");
	} 
	else if (user_input=="Yes, I plan to use the computer skills that I have learned at" && survey.Q8Reason.value.trim()=="")
	{
		addError("Question 8: Yes, I plan to use the computer skills that I have learned at");
	}
	
/************************************************************************
*	QUESTION 9
*************************************************************************/	
	user_input="";
	radioItem = survey.Q9;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 9");
	} 
	else if (user_input=="Yes. I wish I had learned to" && survey.Q9Reason.value.trim()=="")
	{
		addError("Question 9: Yes. I wish I had learned to ");
	}

/************************************************************************
*	QUESTION 10
*************************************************************************/	
	user_input="";
	radioItem = survey.Q10;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 10");
	} 
	else if (user_input=="Yes, I have learned" && survey.Q10Reason.value.trim()=="")
	{
		addError("Question 10: Yes, I have learned ");
	}
	
/************************************************************************
*	QUESTION 11
*************************************************************************/	
	user_input="";
	radioItem = survey.Q11;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 11");
	} 

/************************************************************************
*	QUESTION 12
*************************************************************************/	
	user_input="";
	radioItem = survey.Q12;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 12");
	} 

/************************************************************************
*	QUESTION 13
*************************************************************************/
	user_input = survey.Q13.value.trim();
	if (user_input=="")
	{
		addError("Question 13");
	} 	

/************************************************************************
*	QUESTION 14
*************************************************************************/	
	user_input="";
	radioItem = survey.Q14;
	for (i=0;i<radioItem.length;i++)
	{
		if (radioItem[i].checked)
		{
			user_input = radioItem[i].value;
		}
	}
	if (user_input=="")
	{
		addError("Question 14");
	} 
/************************************************************************
*	QUESTION 15
*************************************************************************/
	user_input = survey.Q13.value.trim();
	if (user_input=="")
	{
		addError("Question 15");
	} 	
/************************************************************************
*	QUESTION 16
*************************************************************************/
	user_input = survey.Q16Name.value.trim();
	if (user_input=="")
	{
		addError("Question 16: Please tell us your name");
	} 	
	
	user_input = survey.Q16School.value.trim();
	if (user_input=="")
	{
		addError("Question 16: Please tell us your name of the school");
	} 	
	
	user_input = survey.Q16City.value.trim();
	if (user_input=="")
	{
		addError("Question 16: City");
	} 	
	
	user_input = survey.Q16State.value.trim();
	if (user_input=="")
	{
		addError("Question 16: State");
	} 	
		
		
	if(errorMsg!="")
	{
		writeError(errorMsg,"ErrorMsg");
		document.location="#error";
	}
	else
	{
		survey.action="processSenior.asp";
		survey.submit();
	}	
	
}


function checkRadioOther(radioBut, butValue)
{
	for (i=0;i<radioBut.length;i++)
	{
		if (radioBut[i].value==butValue)
		{
			radioBut[i].checked = true;
		}
	}
}
function checkBoxOther(checkBox,tField)
{
	if(tField.value.trim()!="")
	{
		checkBox.checked = true;
	}
}
