
<!--
 function checkEnter(e){
	var characterCode
    	if(window.event)
          characterCode = window.event.keyCode;     //IE
    	 else
          characterCode = e.which;     //firefox
    	 if(e && e.which){
    	 e = e
     	characterCode = e.which
    	 }
     	else{
    	 e = event
     	characterCode = e.keyCode
     	}     
     	if(characterCode == 13){
     	 BMI(document.standard_bmi.feet.value, document.standard_bmi.inches.value, document.standard_bmi.weight.value);
       	return false
     	}
	return true
   	}
   

 
function BMI(feet, inches, weight){
 
 		var feet = document.standard_bmi.feet.value;
 		var inches = document.standard_bmi.inches.value;
 		var weight = document.standard_bmi.weight.value;
 		var age = document.standard_bmi.age.value;

		
 		//calculates BMI
                index = (Math.round(feet*12) + Math.round(inches))*.0254 //height in meters
                index = index * index;
                index = (Math.round(weight)/2.2)/index; 
                index = (Math.round(index*100)/100)
                if (!index) index = " ";
                document.standard_bmi.results.value = index;
		
		//rounds up the result
                var bmirnd = index - 0.5;
                bmirnd = Math.round(bmirnd);
                
                
        //checks for empty fields
				if (index < 90 && feet != 0 && weight != 0 && age != 0){
		
					//alert("I am inside the if " + index);
					//changeText(weight, feet, inches, index, age);
			
 					var x = document.getElementById("gender").selectedIndex;
 					var y = document.getElementsByTagName("option");
 					var gender = "";
 		    		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 (index < 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 " 
+ index +
" 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 (index < 18.4 && index > 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 " 
+ index +
" 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 (index < 24.9 && index > 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 " 
+ index +
" 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 (index < 30 && index > 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 " 
+ index +
" 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 (index < 34.9 && index > 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 " 
+ index +
" 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 (index < 40 && index > 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 " 
+ index +
" 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 (index > 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 " 
+ index +
" 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>"
;		
					}
					
	
					
					//alert("after vars");

 		//checks for selection box if selected then variable "gender" is given name "Men" or "Women" 		
 					if (y[x].index == 0){
 						gender = "men";
 					}
 					else if (y[x].index == 1){
 						gender = "women";
 					}
					
					//alert("After men and women validation " + gender);

					text2beEntered.innerHTML = 
					"<h1><img src='images/reportButton1.png'/> Personal BMI Report:</h1>" + txt2 + "<b>" + weight + " pounds</b> and height of <b>" + feet + " feet " + inches + " inches.</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;'>" + index + ".</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 " + index + " Make sure to read your report below");
				
			
				
				
				}
  				else
  				{
  					if (!(feet > 0)) alert ("Please enter your hight");
                	if (!(weight > 0)) alert ("Please enter your weight");  
                	if (!(age > 0)) alert ("Please enter your age"); 
  				}	             
        
       	     
     
}




//-->

