
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Created by: Bob Mason :: http://www.omega-cottage.co.uk/WLS -->
<!-- Begin



function  calculateBMI() {
  var weight = eval(document.form.weight.value);
  var height = eval(document.form.height.value);
  	
  var height2 = height / 100;
  var BMI = weight  / (height2 * height2);

  var txt = "We calculated your BMI as <h1>\n"
  var txt3 = "</h1>"



  document.form.BodyMassIndex.value=custRound(BMI,2);

	

	
  
  //check for BMI lower than 90 then prints text
  if (custRound(BMI,2)<90){
	
	changeText(weight, height, custRound(BMI,2));			

  }
  //else
  //{
  //}	
}

function custRound(x,places) {
  return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places);
}

function changeText(weight1, height1, BMI1) {
 		var x = document.getElementById("gender").selectedIndex;
 		var y = document.getElementsByTagName("option");
 		var gender = "";
 		var age = eval(document.form.age.value);
 		    		var txt2 = "We have calculated your BMI based on your weight of ";
 					var text2beEntered = document.getElementById("output");
 					var bmiCategory = "";
					var riskFactor = "";
					var bmiCategoryPromoText = ""; 

					//assigns category according to the users BMI
					if (BMI1 < 16.5){
						bmiCategory = "Severely underweight";
						riskFactor = "Low";
						bmiCategoryPromoText = "<p>You are in the " + bmiCategory + " BMI range so losing lots of weight should not be your focus. What should be your focus however is staying fit, and toning your body. Many people are not overweight, but their bodies have a tendency to get soft as they age. This does not have to be the case. You can build muscle definition <b>very quickly</b> just by taking herbal supplements before you perform strenuous activities. (sports, working out, etc)</p>" +
"<p>One of the most popular herbal supplements for enhancing muscle definition is called Force Max. It is an all natural supplement that contains an advanced L-Arginine blend of amino acids that cause an increase in the levels of nitric oxide (NO2) in the body that helps to move oxygen into your muscles where they need it the most.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/forcemax.php'>Free sample bottle</a> of Force Max supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample, as it not only helps to tighten your body, but also to clean out toxins that are a breeding ground for disease.</p>" 
+
"<p><a href='scripts/forcemax.php'>Claim my free Force Max sample pack.</a></p>"
;
					
					}else if (BMI1 < 18.4 && BMI1 > 16.5){
						bmiCategory = "Underweight";
						riskFactor = "Low";
						bmiCategoryPromoText = "<p>You are in the " + bmiCategory + " BMI range so losing lots of weight should not be your focus. What should be your focus however is staying fit, and toning your body. Many people are not overweight, but their bodies have a tendency to get soft as they age. This does not have to be the case. You can build muscle definition <b>very quickly</b> just by taking herbal supplements before you perform strenuous activities. (sports, working out, etc)</p>" +
"<p>One of the most popular herbal supplements for enhancing muscle definition is called Force Max. It is an all natural supplement that contains an advanced L-Arginine blend of amino acids that cause an increase in the levels of nitric oxide (NO2) in the body that helps to move oxygen into your muscles where they need it the most.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/forcemax.php'>Free sample bottle</a> of Force Max supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample, as it not only helps to tighten your body, but also to clean out toxins that are a breeding ground for disease.</p>" 
+
"<p><a href='scripts/forcemax.php'>Claim my free Force Max sample pack.</a></p>"
;		
					}else if (BMI1 < 24.9 && BMI1 > 18.4){
						bmiCategory = "Normal";
						riskFactor = "Very Low";
						bmiCategoryPromoText = "<p>You are in the " + bmiCategory + " BMI range so losing lots of weight should not be your focus. What should be your focus however is staying fit, and toning your body. Many people are not overweight, but their bodies have a tendency to get soft as they age. This does not have to be the case. You can build muscle definition <b>very quickly</b> just by taking herbal supplements before you perform strenuous activities. (sports, working out, etc)</p>" +
"<p>One of the most popular herbal supplements for enhancing muscle definition is called Force Max. It is an all natural supplement that contains an advanced L-Arginine blend of amino acids that cause an increase in the levels of nitric oxide (NO2) in the body that helps to move oxygen into your muscles where they need it the most.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/forcemax.php'>Free sample bottle</a> of Force Max supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample, as it not only helps to tighten your body, but also to clean out toxins that are a breeding ground for disease.</p>" 
+
"<p><a href='scripts/forcemax.php'>Claim my free Force Max sample pack.</a></p>"
;		
					}else if (BMI1 < 30 && BMI1 > 24.9){
						bmiCategory = "Overweight";
						riskFactor = "Moderate";
						bmiCategoryPromoText = "<p>One of the best things you can do to quickly boost your metabolism and start losing weight, is to take a weight loss and body cleansing supplement. Taking the right cleansing supplement helps you safely and naturally lose weight by removing toxic buildup from the digestive tract. Initial weight loss for many people can <b>exceed 10 pounds.</b></p>" +
"<p>One of the most highly touted weight loss and cleansing supplements on the market today is called Acai Slim Detox. This is the same weight loss product that featured on <b>Dr. OZ</b>, <b>Oprah</b> and <b>Rachael Ray</b>. Dr. OZ explained on the Oprah show how these Acai berries help you lose weight by suppressing hunger and boosting energy. It contains high levels of anti-oxidants that help to rid your body of unnecessary waste and build-up, which can significantly lower your BMI. When your body is clean on the inside, your organ tissues absorb nutrients better, and your body will more effectively manage your weight and hunger as a side-effect.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/acaislimdetox.php'>Free sample bottle</a> of Acai Slim Detox supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample. Weight Loss and Body cleansing is a means to better health for the millions that benefit from it already. Prevention of obesity related disease and health problems is the best cure.</p>" 
+
"<p><a href='scripts/acaislimdetox.php'>Claim my free Acai Slim Detox sample pack.</a></p>"
;		
					}else if (BMI1 < 34.9 && BMI1 > 30){
						bmiCategory = "Obese Class I";
						riskFactor = "High";
						bmiCategoryPromoText = "<p>One of the best things you can do to quickly boost your metabolism and start losing weight, is to take a weight loss and body cleansing supplement. Taking the right cleansing supplement helps you safely and naturally lose weight by removing toxic buildup from the digestive tract. Initial weight loss for many people can <b>exceed 10 pounds.</b></p>" +
"<p>One of the most highly touted weight loss and cleansing supplements on the market today is called Acai Slim Detox. This is the same weight loss product that featured on <b>Dr. OZ</b>, <b>Oprah</b> and <b>Rachael Ray</b>. Dr. OZ explained on the Oprah show how these Acai berries help you lose weight by suppressing hunger and boosting energy. It contains high levels of anti-oxidants that help to rid your body of unnecessary waste and build-up, which can significantly lower your BMI. When your body is clean on the inside, your organ tissues absorb nutrients better, and your body will more effectively manage your weight and hunger as a side-effect.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/acaislimdetox.php'>Free sample bottle</a> of Acai Slim Detox supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample. Weight Loss and Body cleansing is a means to better health for the millions that benefit from it already. Prevention of obesity related disease and health problems is the best cure.</p>" 
+
"<p><a href='scripts/acaislimdetox.php'>Claim my free Acai Slim Detox sample pack.</a></p>"
;			
					}
					else if (BMI1 < 40 && BMI1 > 34.9){
						bmiCategory = "Obese Class II";
						riskFactor = "Very High";
						bmiCategoryPromoText = "<p>One of the best things you can do to quickly boost your metabolism and start losing weight, is to take a weight loss and body cleansing supplement. Taking the right cleansing supplement helps you safely and naturally lose weight by removing toxic buildup from the digestive tract. Initial weight loss for many people can <b>exceed 10 pounds.</b></p>" +
"<p>One of the most highly touted weight loss and cleansing supplements on the market today is called Acai Slim Detox. This is the same weight loss product that featured on <b>Dr. OZ</b>, <b>Oprah</b> and <b>Rachael Ray</b>. Dr. OZ explained on the Oprah show how these Acai berries help you lose weight by suppressing hunger and boosting energy. It contains high levels of anti-oxidants that help to rid your body of unnecessary waste and build-up, which can significantly lower your BMI. When your body is clean on the inside, your organ tissues absorb nutrients better, and your body will more effectively manage your weight and hunger as a side-effect.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/acaislimdetox.php'>Free sample bottle</a> of Acai Slim Detox supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample. Weight Loss and Body cleansing is a means to better health for the millions that benefit from it already. Prevention of obesity related disease and health problems is the best cure.</p>" 
+
"<p><a href='scripts/acaislimdetox.php'>Claim my free Acai Slim Detox sample pack.</a></p>"
;			
					}else if (BMI1 > 40){
						bmiCategory = "Obese Class III";
						riskFactor = "Urgent & Severe";
						bmiCategoryPromoText = "<p>One of the best things you can do to quickly boost your metabolism and start losing weight, is to take a weight loss and body cleansing supplement. Taking the right cleansing supplement helps you safely and naturally lose weight by removing toxic buildup from the digestive tract. Initial weight loss for many people can <b>exceed 10 pounds.</b></p>" +
"<p>One of the most highly touted weight loss and cleansing supplements on the market today is called Acai Slim Detox. This is the same weight loss product that featured on <b>Dr. OZ</b>, <b>Oprah</b> and <b>Rachael Ray</b>. Dr. OZ explained on the Oprah show how these Acai berries help you lose weight by suppressing hunger and boosting energy. It contains high levels of anti-oxidants that help to rid your body of unnecessary waste and build-up, which can significantly lower your BMI. When your body is clean on the inside, your organ tissues absorb nutrients better, and your body will more effectively manage your weight and hunger as a side-effect.</p>" +
"<p>Your BMI of " 
+ BMI1 +
" qualifies you to receive a <a href='scripts/acaislimdetox.php'>free sample bottle</a> of Acai Slim Detox supplements. In an attempt to raise awareness and improve physical health in the United States and worldwide, we have teamed up with the manufacturer to provide these samples to you. We encourage you to try the free sample. Weight Loss and Body cleansing is a means to better health for the millions that benefit from it already. Prevention of obesity related disease and health problems is the best cure.</p>" 
+
"<p><a href='scripts/acaislimdetox.php'>Claim my free Acai Slim Detox sample pack.</a></p>"
;			
					}
					
					 
 		//checks for selection box if the "Male" selected then variable "gender" is given name "Men" 
 		//if the "Female" option selected then variable "gender" is given name "Women"  
 		if (y[x].index == 0){
 			gender = "men";
 		}
 		else if (y[x].index == 1){
 			gender = "women";
 		}
		var text2beEntered = document.getElementById("output");

		text2beEntered.innerHTML = "<h1><img src='images/reportButton1.png'/> Personal BMI Report:</h1>" + txt2 + "<b>" + weight1 + " kg </b> and height of <b> " + height1 + 


					" cm.</b> In the report below you will see personalized information on where your BMI stands compared to others, as well as an explanation of what your BMI number means. In addition we will show you common health problems that "					
					+
					 "most <strong>" + gender + " " + age + 
					"</strong> and older experience with similar BMI levels to yours."	
					+
					"<hr>"
					+					
					"<h2><img src='images/reportButton3.png'/> Your Body Mass Index Number:</h2>"
					+
					"You have a BMI of <b style='color:red;'>" + BMI1 + ".</b>"
					+
					" This BMI puts you under the body classification of <b>" 
					+
					bmiCategory
					+
					"</b>"
					+
					" according to the CDC (US Center for Disease Control & Prevention)."
					+
					"<p>Your risk for the following health conditions is: <b style='color:red;'> "
					+
					riskFactor
					+
					" </b></p>"
					+
					"<li />Hypertension " +
					"<li />Dyslipidemia"  +
					"<li />Type 2 diabetes" +
					"<li />Coronary heart disease" +
					"<li />Stroke" +
					"<li />Gallbladder disease" +
					"<li />Osteoarthritis" +
					"<li />Sleep apnea" +
					"<li />Endometrial, breast, and colon cancer" 
					+		 
					"<hr>"

					+
					"<h2><img src='images/reportButton2.png'/> What You Can Do</h2>"	

+ bmiCategoryPromoText;	
	
		alert("Your BMI is " + BMI1 + " Make sure to read your report below");

}

// End -->
