function changeClass(id,style)
{
	document.getElementById(id).className = style;
}

function getRadioValue(form,radioName)
{
	var returnValue = false;

	for (var i=0; i < form[radioName].length; i++)
	{
		if (form[radioName][i].checked)
		{
			returnValue = form[radioName][i].value;
		}
	}

	return returnValue;
}

function processAssessment(form)
{
	changeClass('results','hide');

	document.getElementById('totalScore').innerHTML = 'N/A';

	changeClass('lowScore','hide');
	changeClass('medScore','hide');
	changeClass('highScore','hide');

	if (getRadioValue(form,'iQuestion1') === false || getRadioValue(form,'iQuestion2') === false || getRadioValue(form,'iQuestion3') === false || getRadioValue(form,'iQuestion4') === false || getRadioValue(form,'iQuestion5') === false || getRadioValue(form,'iQuestion6') === false || getRadioValue(form,'iQuestion7') === false || getRadioValue(form,'iQuestion8') === false || getRadioValue(form,'iQuestion9') === false || getRadioValue(form,'iQuestion10') === false || getRadioValue(form,'iQuestion11') === false || getRadioValue(form,'iQuestion12') === false || getRadioValue(form,'iQuestion13') === false || getRadioValue(form,'iQuestion14') === false || getRadioValue(form,'iQuestion15') === false)
	{
		alert('Please answer all questions.');
	}
	else
	{
		var score = 0;

		score += parseInt(getRadioValue(form,'iQuestion1'));
		score += parseInt(getRadioValue(form,'iQuestion2'));
		score += parseInt(getRadioValue(form,'iQuestion3'));
		score += parseInt(getRadioValue(form,'iQuestion4'));
		score += parseInt(getRadioValue(form,'iQuestion5'));
		score += parseInt(getRadioValue(form,'iQuestion6'));
		score += parseInt(getRadioValue(form,'iQuestion7'));
		score += parseInt(getRadioValue(form,'iQuestion8'));
		score += parseInt(getRadioValue(form,'iQuestion9'));
		score += parseInt(getRadioValue(form,'iQuestion10'));
		score += parseInt(getRadioValue(form,'iQuestion11'));
		score += parseInt(getRadioValue(form,'iQuestion12'));
		score += parseInt(getRadioValue(form,'iQuestion13'));
		score += parseInt(getRadioValue(form,'iQuestion14'));
		score += parseInt(getRadioValue(form,'iQuestion15'));

		changeClass('results','show');

		document.getElementById('totalScore').innerHTML = score;

		if (score < 37) changeClass('lowScore','show');
		else if (score < 90) changeClass('medScore','show');
		else changeClass('highScore','show');
	}
}
