<!--

function insertWorkoutIntoBTPActivity()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{ 
		appendToForm('btp_act_description',xmlhttp.responseText);
	}
}

function insertWorkoutIntoRTPActivity()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{ 
		appendToForm('rtp_act_description',xmlhttp.responseText);
	}
}

function updateTPOrderItemPrice()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{ 
		document.getElementById('tpoi_price').value=zeroPadNumber(xmlhttp.responseText,2);
	}
}

function updateTPPendingOrderItemPrice()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{ 
		document.getElementById('tppoi_price').value=zeroPadNumber(xmlhttp.responseText,2);
	}
}

function updateTTSLayouts()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{ 
		document.getElementById('tts_training_plan_week_layout').innerHTML=xmlhttp.responseText;
	}
}

function updateRTSLayouts()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{ 
		document.getElementById('rts_training_plan_week_layout').innerHTML=xmlhttp.responseText;
	}
}

function determineHeatIndex(type)
{
	var temp=document.getElementById(type + '_current_temperature').value;
	var hum=document.getElementById(type + '_current_humidity').value;
	
	if( temp.match("^[.0-9]+$") && hum.match("^[.0-9]+$") && temp>=65)
	{
		var hi = -42.379+2.04901523*temp+10.14333127*hum-0.22475541*temp*hum-6.83783*(Math.pow(10, -3))*(Math.pow(temp, 2))-5.481717*(Math.pow(10, -2))*(Math.pow(hum, 2))+1.22874*(Math.pow(10, -3))*(Math.pow(temp, 2))*hum+8.5282*(Math.pow(10, -4))*temp*(Math.pow(hum, 2))-1.99*(Math.pow(10, -6))*(Math.pow(temp, 2))*(Math.pow(hum,2));
		document.getElementById('heat_index').value=Math.round(hi);
	}
	else
		document.getElementById('heat_index').value=temp;
}

//-->
