

function Calculate() {

	var gender = document.getElementById("gender").value;
	var weight = document.getElementById("weight").value;
	var height = document.getElementById("height").value;
	var age = document.getElementById("age").value;
	var exercise = document.getElementById("exercise").value;
	
	if(gender=="male") 
		{
			val1 = 6.23 * weight;
			val2 = 12.7 * height;
			val3 = 6.8 * age;
			
			result = 66 + val1 + val2 - val3;
			
			cals = result * exercise;
			
		}
	else if (gender=="female")
		{
			val1 = 4.35 * weight;
			val2 = 4.7 * height;
			val3 = 4.7 * age;
			
			result = 655 + val1 + val2 - val3;
			
			cals = result * exercise;
			
		}
	
	document.write ('<font style="font-family:arial, helvetica; font-size:12px; color:#0000ff;">The BMR formula uses the variables of height, weight, age and gender to calculate the Basal Metabolic Rate (BMR). This is more accurate than calculating calorie needs based on body weight alone. The only factor it omits is lean body mass and thus the ratio of muscle-to-fat a body has. Remember, leaner bodies need more calories than less leaner ones. Therefore, this equation will be very accurate in all but the very muscular (will underestimate calorie needs) and the very fat (will over-estimate calorie needs)</font><br><br>');
	document.write ('<font style="font-family:arial, helvetica; font-size:12px; color:#0000ff;">This is the amount of calories you would burn (per day) if you did nothing at all:</font><b>   ' + result.toFixed(2) + '</b><br><br>');
	document.write ('<font style="font-family:arial, helvetica; font-size:12px; color:#0000ff;">This is the amount of calories you need to maintain your weight (per day) based on Age, Weight, Height and the Activity Level you chose, in other words, your <u>maintainence</u> calories:</font><b>   ' + cals.toFixed(2) + '</b><br><br>');
	document.write ('<font style="font-family:arial, helvetica; font-size:12px; color:#0000ff;">If your maintainence calorie level is 2200 for example and you eat 1200 calories per day, your daily deficit would be 1000 calories per day or 7000 calories per week.  One pound weight loss is 3500 calories so in this example you would lose 2lbs per week.  To change your weight loss you need to lower calorie intake or better, increase your activity level.</font><br><br>');
	document.write ('<font style="font-family:arial, helvetica; font-size:12px; color:#0000ff;"><a href="http://clickheretoreview.com/afford/easy-weight-loss/" target="_blank">Go Back</a> or <a href="javascript:window.close()">Close Window</a></font><br>');

}

function check(x)
  {
  document.getElementById("exercise").value=x;
  }
 
