function validate(url)
{
		
	var objSubmit;
	objSubmit = true;
	// Check if Question 1 is answered
	
	if ( valRadiobutton(document.form_symptom_check.radio_suffer_abdompain) == false )
	{
		//alert('You have not answered Question 1. Please choose an option.');
		document.getElementById('err_suffer_abdompain').style.display = '';
		objSubmit = false;
	}
	else if(getRadiobuttonVal(document.form_symptom_check.radio_suffer_abdompain) == "Yes")
	{
	// Check if Question 2 is answered
		document.getElementById('err_suffer_abdompain').style.display = 'none';
		if ( valRadiobutton(document.form_symptom_check.radio_often_abdompain) == false )
		{
			//alert('You have not answered Question 2. Please choose an option.');
			document.getElementById('err_often_abdompain').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_abdompain').style.display = 'none';}

	// Check if Question 3 is answered
		if ( valRadiobutton(document.form_symptom_check.radio_howlong_abdompain) == false )
		{
			//alert('You have not answered Question 3. Please choose an option.');
			document.getElementById('err_howlong_abdompain').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_howlong_abdompain').style.display = 'none';}
	}
	else{document.getElementById('err_suffer_abdompain').style.display = 'none';}
	
	// Check if Question 7 is answered
	if ( valRadiobutton(document.form_symptom_check.radio_suffer_bloating) == false )
	{
		//alert('You have not answered Question 7. Please choose an option.');
		document.getElementById('err_suffer_bloating').style.display = '';
		objSubmit = false;
	}
	else if(getRadiobuttonVal(document.form_symptom_check.radio_suffer_bloating) == "Yes")
	{
		document.getElementById('err_suffer_bloating').style.display = 'none';
	// Check if Question 8 is answered
		if ( valRadiobutton(document.form_symptom_check.radio_often_bloating) == false )
		{
			//alert('You have not answered Question 8. Please choose an option.');
			document.getElementById('err_often_bloating').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_bloating').style.display = 'none';}
	
		// Check if Question 9 is answered
		if ( valRadiobutton(document.form_symptom_check.radio_howlong_bloating) == false )
		{
			//alert('You have not answered Question 9. Please choose an option.');
			document.getElementById('err_howlong_bloating').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_howlong_bloating').style.display = 'none';}
	}
	else{document.getElementById('err_suffer_bloating').style.display = 'none';}
	// Check if Question 10 is answered
	if ( valRadiobutton(document.form_symptom_check.radio_suffer_constipation) == false )
	{
		//alert('You have not answered Question 10. Please choose an option.');
		document.getElementById('err_suffer_constipation').style.display = '';
		objSubmit = false;
	}
	else if(getRadiobuttonVal(document.form_symptom_check.radio_suffer_constipation) == "Yes")
	{
		document.getElementById('err_suffer_constipation').style.display = 'none';
		if ( valRadiobutton(document.form_symptom_check.radio_often_constipation) == false )
		{
			//alert('You have not answered Question 11. Please choose an option.');
			document.getElementById('err_often_constipation').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_constipation').style.display = 'none';}
	
		if ( valRadiobutton(document.form_symptom_check.radio_howlong_constipation) == false )
		{
			//alert('You have not answered Question 12. Please choose an option.');
			document.getElementById('err_howlong_constipation').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_howlong_constipation').style.display = 'none';}
	}
	else{document.getElementById('err_suffer_constipation').style.display = 'none';}
	
	if ( valRadiobutton(document.form_symptom_check.radio_suffer_depression) == false )
	{
		//alert('You have not answered Question 16. Please choose an option.');
		document.getElementById('err_suffer_depression').style.display = '';
		objSubmit = false;
	}
	else if(getRadiobuttonVal(document.form_symptom_check.radio_suffer_depression) == "Yes")
	{
		document.getElementById('err_suffer_depression').style.display = 'none';
		if ( valRadiobutton(document.form_symptom_check.radio_often_depression) == false )
		{
			//alert('You have not answered Question 17. Please choose an option.');
			document.getElementById('err_often_depression').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_depression').style.display = 'none';}
		if ( valRadiobutton(document.form_symptom_check.radio_howlong_depression) == false )
		{
			//alert('You have not answered Question 18. Please choose an option.');
			document.getElementById('err_howlong_depression').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_howlong_depression').style.display = 'none';}
	}
	else{document.getElementById('err_suffer_depression').style.display = 'none';}
	if (valRadiobutton(document.form_symptom_check.radio_suffer_diarrhoea) == false )
	{
		//alert('You have not answered Question 19. Please choose an option.');
		document.getElementById('err_suffer_diarrhoea').style.display = '';
		objSubmit = false;
	}
	else if(getRadiobuttonVal(document.form_symptom_check.radio_suffer_diarrhoea) == "Yes")
	{
		document.getElementById('err_suffer_diarrhoea').style.display = 'none';
		if ( valRadiobutton(document.form_symptom_check.radio_often_diarrhoea) == false )
		{
			//alert('You have not answered Question 20. Please choose an option.');
			document.getElementById('err_often_diarrhoea').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_diarrhoea').style.display = 'none';}
		if ( valRadiobutton(document.form_symptom_check.radio_howlong_diarrhoea) == false )
		{
			//alert('You have not answered Question 21. Please choose an option.');
			document.getElementById('err_howlong_diarrhoea').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_howlong_diarrhoea').style.display = 'none';}
	}
	else{document.getElementById('err_suffer_diarrhoea').style.display = 'none';}
	if ( valRadiobutton(document.form_symptom_check.radio_noticed_mucus) == false )
	{
		//alert('You have not answered Question 22. Please choose an option.');
		document.getElementById('err_noticed_mucus').style.display = '';
		objSubmit = false;
	}
	/*else if(getRadiobuttonVal(document.form_symptom_check.radio_noticed_mucus) == "Yes")
	{
		document.getElementById('err_noticed_mucus').style.display = 'none';
		if ( valRadiobutton(document.form_symptom_check.radio_often_mucus) == false )
		{
			//alert('You have not answered Question 23. Please choose an option.');
			document.getElementById('err_often_mucus').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_mucus').style.display = 'none';}
	}*/
	else{document.getElementById('err_noticed_mucus').style.display = 'none';}
	if ( valRadiobutton(document.form_symptom_check.radio_noticed_blood) == false )
	{
		//alert('You have not answered Question 24. Please choose an option.');
		document.getElementById('err_noticed_blood').style.display = '';
		objSubmit = false;
	}
	/*else if(getRadiobuttonVal(document.form_symptom_check.radio_noticed_blood) == "Yes")
	{
		document.getElementById('err_noticed_blood').style.display = 'none';
		if ( valRadiobutton(document.form_symptom_check.radio_often_blood) == false )
		{
			//alert('You have not answered Question 24. Please choose an option.');
			document.getElementById('err_often_blood').style.display = '';
			objSubmit = false;
		}
		else{document.getElementById('err_often_blood').style.display = 'none';}
	}*/
	else{document.getElementById('err_noticed_blood').style.display = 'none';}
	if (document.form_symptom_check.txtOtherSymptoms.value !="")
	{
		if (valRadiobutton(document.form_symptom_check.radio_often_othersymptoms) == false )
		{
		//alert('You have not answered Question 26. Please choose an option.');
		document.getElementById('err_often_othersymptoms').style.display = '';
		objSubmit = false;
		}
		else{document.getElementById('err_often_othersymptoms').style.display = 'none';}
		if ( valRadiobutton(document.form_symptom_check.radio_howlong_othersymptoms) == false )
		{
		//alert('You have not answered Question 27. Please choose an option.');
		document.getElementById('err_howlong_othersymptoms').style.display = '';
		objSubmit = false;
		}
		else{document.getElementById('err_howlong_othersymptoms').style.display = 'none';}
	}
	
	if(objSubmit == false)
	{
		
		alert("Please answer all the questions to ensure a complete result, \nthe incomplete questions are highlighted on the page in red.");
		return false;
	}
	else
	{	
		objForm = window.document.form_symptom_check;
		objForm.method = "POST";	
		//objForm.refererUrl.value = url;
		objForm.submit();
		return true;
	}
}

function valRadiobutton(radiobutton)
{
	myOption = -1;
	for (i=0; i< radiobutton.length; i++)
	{
		if (radiobutton[i].checked)
				myOption = i;
	}
	if (myOption == -1)
		return false;
	else
		return true;
} 

function getRadiobuttonVal(radiobutton)
{
	retval = "";
	for (i=0; i< radiobutton.length; i++)
	{
		if (radiobutton[i].checked)
				retval = radiobutton[i].value;
	}
	if (retval != "")
		return retval;
	
} 