<!--


function checkNum(thisChar) {

	if((thisChar != '0') &&
		(thisChar != '1') &&
		(thisChar != '2') &&
		(thisChar != '3') &&
		(thisChar != '4') &&
		(thisChar != '5') &&
		(thisChar != '6') &&
		(thisChar != '7') &&
		(thisChar != '8') &&
		(thisChar != '9')) {
		
		return false;
		
	} else {
	
		return true;
		
	}
}
		

function checkValue(thisString) {

	var isNum = true;
	var stringLen = thisString.length;
	
	if(stringLen == 0) {
	
		isNum = false;
		
	} else {
	
		for(count = 0; count < stringLen; count++) {
	
			if(!(checkNum(thisString.charAt(count)))) {
		
				isNum = false;
				break;
		
			}	
		}
	}
	
	return isNum;
	
}




function calculate(){

	form = document.thisForm;
	age = form.Age.value;
	
	if(!(checkValue(age))) {
	
		alert('Please enter a number for your age.');
		
	} else {
	
	intensityIndex = form.Intensity.selectedIndex;
	intensity = form.Intensity.options[intensityIndex].value;
	percentIntensity = (intensity / 100)
	
	lowRate = parseInt((220 - age) * .55);
	highRate = parseInt((220 - age) * .85);

	targetRate = 220;
	targetRate -= age;
	targetRate *= percentIntensity;
	targetRate = parseInt(targetRate);
	
	document.thisForm.LowRate.value = lowRate;
	document.thisForm.HighRate.value = highRate;
	document.thisForm.TargetRate.value = targetRate;
	
	}
}


//-->
