
//*******************************************************************
//Function to limit chars in a textarea
//*******************************************************************
  function textCounter(field, countfield, maxlimit)
  {
	if (field.value.length > maxlimit)
	{
		// if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	}
	else
	{
		// otherwise, update 'characters left' counter
		countfield.value = maxlimit - field.value.length;
	}
  }



//*******************************************************************
//Function to validate all 8 radio button questions (french rabbit)
//*******************************************************************
  function valbutton(thisform)
  {
	// place any other field validations that you require here
	// validate myradiobuttons
	ques1 = 0;
	ques2 = 0;
	ques3 = 0;
	ques4 = 0;
	ques5 = 0;
	ques6 = 0;
	ques7 = 0;
	ques8 = 0;
	for (i=thisform.q1.length-1; i > -1; i--)
	{
		if (thisform.q1[i].checked)
		{
			ques1 = 1;
		}
	}
	for (i=thisform.q2.length-1; i > -1; i--)
	{
		if (thisform.q2[i].checked)
		{
			ques2 = 1;
		}
	}
	for (i=thisform.q3.length-1; i > -1; i--)
	{
		if (thisform.q3[i].checked)
		{
			ques3 = 1;
		}
	}
	for (i=thisform.q4.length-1; i > -1; i--)
	{
		if (thisform.q4[i].checked)
		{
			ques4 = 1;
		}
	}
	for (i=thisform.q5.length-1; i > -1; i--)
	{
		if (thisform.q5[i].checked)
		{
			ques5 = 1;
		}
	}
	for (i=thisform.q6.length-1; i > -1; i--)
	{
		if (thisform.q6[i].checked)
		{
			ques6 = 1;
		}
	}
	for (i=thisform.q7.length-1; i > -1; i--)
	{
		if (thisform.q7[i].checked)
		{
			ques7 = 1;
		}
	}
	for (i=thisform.q8.length-1; i > -1; i--)
	{
		if (thisform.q8[i].checked)
		{
			ques8 = 1;
		}
	}
	

	if (!ques1 || !ques2 || !ques3 || !ques4 || !ques5 || !ques6 || !ques7 || !ques8)
	{
		alert("Oops! Please complete all 8 questions.");
		return false;
	}

	//if all radio buttons are completed then submit form
	thisform.submit();
  }
