function showactivity(ilevel)
{
	if (ilevel == 1)
	{
		document.getElementById("activityexplanation").innerHTML = '<p>Sedentary individuals consume energy through basal energy expenditure, the thermal effect of food, and conducting the tasks necessary for independent living (e.g. sitting, standing, cooking, cleaning). They do not perform any other physical activity, such as recreational walking.</p>';
		SetActivityBorder(1);
		
	}
	else if (ilevel == 2)
	{
		document.getElementById("activityexplanation").innerHTML = '<p>Individuals who are categorised as low activity consume energy through the same mechanisms as sedentary individuals. In addition, an average weight individual (i.e. a person weighing 70kg) will undertake physical activity which is equivalent to walking 3.5 kilometres each day at a rate of 4.8-6.4 kilometres per hour, or roughly 45 minutes of brisk walking. Brisk walking can be considered walking which increases the heart rate to such an extent that the individual becomes slightly out of breath, but can still talk as they perform the activity. Individuals who are much lighter need to undertake greater amounts of activity, while those who are much heavier do not need to undertake as much physical activity. For example an individual who weighed only 44kg, would need to walked for 4.7 kilometres at the same speed, while one who weighed 120kg would need walk for only 2.4 kilometres. For examples of other activities which would be equivalent to walking this distance see our <a href="calc.asp?calc=energy_expenditure&sid=42">energy expenditure tool</a>.</p>';
		SetActivityBorder(2);
	
	}
	else if (ilevel == 3)
	{
		document.getElementById("activityexplanation").innerHTML = '<p>As with sedentary individuals, active individuals expend energy through eating and performing the tasks of everyday living. In addition, individuals weighing 70kg undertake physical activity which is equivalent to walking 11.8 kilometres per day, at a rate of 4.8-6.4 miles per hour, or roughly two hours of brisk walking. The physical activity requirement for active individuals weighing only 44kg increases to 16.0 kilometres per day, while for those weighing 120kg, the requirement decreases to 8.6 kilometres per day. For examples of other activities which would be equivalent to walking this distance see our <a href="calc.asp?calc=energy_expenditure&sid=42">energy expenditure tool</a>.</p>';
		SetActivityBorder(3);
	}
	else
	{
		document.getElementById("activityexplanation").innerHTML = '<p>Highly active individuals expend energy through the thermal effect of food and conducting the tasks of day to day living. In addition individuals weighing 70kg undertake physical activity which is equivalent to 26.9 kilometres per day of walking at a speed of 4.8-6.4 miles per hour, or roughly six hours of brisk walking. Individuals who weigh only 44kg need to walk 36.2 kilometres per day to exert the same effect, while those weighing 120kg need walk only 19.8 kilometres per day to achieve a PAL equivalent to being highly active. For examples of other activities which would be equivalent to walking this distance see our <a href="calc.asp?calc=energy_expenditure&sid=42">energy expenditure tool</a>.</p>';
		SetActivityBorder(4);
	}
}

function SetActivityBorder(ilevel)
{
	if (ilevel == 1)
	{
		SetTDNone(); 
		document.getElementById("tdsed").style.borderLeft = "1px solid #FF0000";
		document.getElementById("tdsed").style.borderTop = "1px solid #FF0000";
		document.getElementById("tdsed").style.borderRight = "1px solid #FF0000";
		document.getElementById("tdsed").style.backgroundColor = "#FFCCCC";
		document.getElementById("activityexplanation").style.backgroundColor = "#FFCCCC";
		document.getElementById("activityexplanation").style.border = "1px solid #FF0000";
	}
	else if (ilevel == 2)
	{
		SetTDNone();
		document.getElementById("tdlow").style.borderLeft = "1px solid #FFCCCC";
		document.getElementById("tdlow").style.borderTop = "1px solid #FFCCCC";
		document.getElementById("tdlow").style.borderRight = "1px solid #FFCCCC";
		document.getElementById("tdlow").style.backgroundColor = "#FFF0F0";
		document.getElementById("activityexplanation").style.backgroundColor = "#FFF0F0";
		document.getElementById("activityexplanation").style.border = "1px solid #FFCCCC";
	}
	else if (ilevel == 3)
	{
		SetTDNone();
		document.getElementById("tdactive").style.borderLeft = "1px solid #CCFFCC";
		document.getElementById("tdactive").style.borderTop = "1px solid #CCFFCC";
		document.getElementById("tdactive").style.borderRight = "1px solid #CCFFCC";
		document.getElementById("tdactive").style.backgroundColor = "#F0FFF0";
		document.getElementById("activityexplanation").style.backgroundColor = "#F0FFF0";
		document.getElementById("activityexplanation").style.border = "1px solid #CCFFCC";
	}
	else
	{
		SetTDNone();
		document.getElementById("tdhigh").style.borderLeft = "1px solid #00FF00";
		document.getElementById("tdhigh").style.borderTop = "1px solid #00FF00";
		document.getElementById("tdhigh").style.borderRight = "1px solid #00FF00";
		document.getElementById("tdhigh").style.backgroundColor = "#CCFFCC";
		document.getElementById("activityexplanation").style.backgroundColor = "#CCFFCC";
		document.getElementById("activityexplanation").style.border = "1px solid #00FF00";
	}
	
}

function SetTDNone()
{
	document.getElementById("tdsed").style.borderStyle = "none";
	document.getElementById("tdsed").style.backgroundColor = "#FFFFFF";

	document.getElementById("tdlow").style.borderStyle = "none";
	document.getElementById("tdlow").style.backgroundColor = "#FFFFFF";

	document.getElementById("tdactive").style.borderStyle = "none";
	document.getElementById("tdactive").style.backgroundColor = "#FFFFFF";

	document.getElementById("tdhigh").style.borderStyle = "none";
	document.getElementById("tdhigh").style.backgroundColor = "#FFFFFF";
}

function boxcheck(thecheckbox)
{
//	alert(thecheckbox);
//	alert(document.getElementById('radgender').checked);
	
	var frmcc;
	frmcc = document.getElementById("frmcaloriecounter");

	if (thecheckbox == 'chkzero')
	{
		document.getElementById('chksix').checked = "";
		
		frmcc.radgender[1].checked = "checked";
		//document.getElementById('radgender').checked = "checked";				
	}
	
	if (thecheckbox == 'chksix')
	{
		document.getElementById('chkzero').checked = "";

		frmcc.radgender[1].checked = "checked";
		//document.getElementById('radgender').checked = "checked";
	}
	
	if (thecheckbox == 'chkfirst')
	{
		document.getElementById('chksecond').checked = "";
		document.getElementById('chkthird').checked = "";
		
		frmcc.radgender[1].checked = "checked";		
		//document.getElementById('radgender').checked = "checked";
	}
	
	if (thecheckbox == 'chksecond')
	{
		document.getElementById('chkfirst').checked = "";
		document.getElementById('chkthird').checked = "";

		frmcc.radgender[1].checked = "checked";
		//document.getElementById('radgender').checked = "checked";
	}
	
	if (thecheckbox == 'chkthird')
	{
		document.getElementById('chkfirst').checked = "";
		document.getElementById('chksecond').checked = "";

		frmcc.radgender[1].checked = "checked";
		//document.getElementById('radgender').checked = "checked";
	}
	
	if (thecheckbox == 'radgender2')
	{
		document.getElementById('chkfirst').checked = "";
		document.getElementById('chksecond').checked = "";
		document.getElementById('chkthird').checked = "";
		document.getElementById('chkzero').checked = "";
		document.getElementById('chksix').checked = "";
		
	}

}
	
