$j = jQuery.noConflict(); $j(document).ready(function () { var calc_app = { init: function () { calc_app.bmi_calc(); }, el:{ bmi_tool : $j("#bodyMassIndex"), // Body Mass Index Calc }, bmi_values:{ //bmi calc values englishInputs : '
Weight
Height
', metricInputs : '
Weight
Height
', msgAUnderweight : 'Being underweight may weaken your immune system and put you at risk of osteoporosis. Ask your doctor what you can do to achieve a healthier weight or to address unexpected weight loss. For better health:

', msgANormal : 'Congratulations! Your healthy weight is well worth the effort. It reduces your risk of serious health conditions such as high blood pressure, heart disease, stroke and diabetes. To maintain a healthy weight:

', msgAOverweight : 'Consider the benefits of a healthy weight \u2014 a reduced risk of heart disease, stroke and diabetes, increased energy and improved self-esteem, for example. Then talk to your doctor about the best weight-loss approach for you. To start:

', msgAObese : 'Consider the benefits of a healthy weight \u2014 a reduced risk of heart disease, stroke and diabetes, increased energy and improved self-esteem, for example. Then talk to your doctor about the best weight-loss approach for you. To start:

', msgCUnderweight : 'Children in this group weigh less in relation to height than do 95 percent of their peers. BMI, however, is just one factor in assessing growth. Your child\'s patterns of growth and family traits are also important. If both parents are slender, for example, your child\'s low BMI is likely genetic. Talk to your child\'s doctor if you\'re concerned.

To help your child\'s BMI fall in the normal range as he or she matures:

', msgCNormal : 'Most children \u2014 more than 8 in 10 \u2014 have normal BMIs, even if they appear at times to add pounds faster than inches. For growing children, a healthy BMI is a moving target. Kids get taller and heavier as they grow, but the relationship between weight and height varies depending on age and sex.

To help your child\'s BMI stay in the normal range as he or she matures:

', msgCOverweight : 'Some, but not all, children who are overweight \"grow into\" their weight. Children with weight-related health conditions, however, may need to lose weight under medical supervision. For growing children, a healthy BMI is a moving target. The relationship between weight and height varies depending on age and sex, but an above normal weight may signal a need to change eating and exercise habits.

To help your child\'s BMI fall in the normal range as he or she matures:

', msgCObese : 'Some, but not all, children who are overweight \"grow into\" their weight. Children with weight-related health conditions, however, may need to lose weight under medical supervision. For growing children, a healthy BMI is a moving target. The relationship between weight and height varies depending on age and sex, but an above normal weight may signal a need to change eating and exercise habits.

To help your child\'s BMI fall in the normal range as he or she matures:

', msgBMIExplained : 'Body mass index (BMI) is a formula that uses weight and height to estimate body fat. Excess body fat is related to serious health conditions. For most people, BMI provides a reasonable estimate of body fat. The BMI\'s biggest weakness is that it doesn\'t consider individual factors such as bone or muscle mass. BMI may:


In addition, people of Asian descent may have an increased risk of health problems at a lower BMI threshold than the general population. Asians with a BMI of 23 or higher may be at risk.

Talk with your doctor if you have questions about your BMI.', m20 : [14.7,18.2,19.3], m25 : [14.5,17.7,18.7], m30 : [14.3,17.3,18.2], m35 : [14.2,17.1,18.0], m40 : [14.0,16.9,17.8], m45 : [13.9,16.8,17.8], m50 : [13.8,16.8,17.9], m55 : [13.8,16.9,18.1], m60 : [13.7,17.0,18.4], m65 : [13.7,17.2,18.8], m70 : [13.7,17.4,19.2], m75 : [13.7,17.7,19.6], m80 : [13.8,18.0,20.1], m85 : [13.9,18.3,20.6], m90 : [14.0,18.6,21.1], m95 : [14.1,19.0,21.6], m100 : [14.2,19.4,22.2], m105 : [14.4,19.8,22.7], m110 : [14.6,20.2,23.2], m115 : [14.8,20.6,23.7], m120 : [15.0,21.0,24.2], m125 : [15.2,21.4,24.7], m130 : [15.5,21.9,25.2], m135 : [15.7,22.3,25.6], m140 : [16.0,22.7,26.0], m145 : [16.3,23.1,26.5], m150 : [16.6,23.5,26.8], m155 : [16.8,23.8,27.2], m160 : [17.1,24.2,27.6], m165 : [17.4,24.6,27.9], m170 : [17.7,24.9,28.3], m175 : [18.0,25.3,28.6], m180 : [18.2,25.7,29.0], f20 : [14.4,18.0,19.1], f25 : [14.2,17.5,18.6], f30 : [14.0,17.2,18.3], f35 : [13.8,16.9,18.1], f40 : [13.7,16.8,18.0], f45 : [13.6,16.8,18.1], f50 : [13.5,16.8,18.3], f55 : [13.5,16.9,18.5], f60 : [13.4,17.1,18.8], f65 : [13.4,17.3,19.2], f70 : [13.4,17.6,19.7], f75 : [13.5,18.0,20.2], f80 : [13.5,18.3,20.7], f85 : [13.6,18.7,21.2], f90 : [13.7,19.1,21.8], f95 : [13.9,19.5,22.4], f100 : [14.0,20.0,23.0], f105 : [14.2,20.4,23.6], f110 : [14.4,20.9,24.1], f115 : [14.6,21.3,24.7], f120 : [14.8,21.7,25.3], f125 : [15.1,22.2,25.8], f130 : [15.3,22.6,26.3], f135 : [15.6,23.0,26.8], f140 : [15.8,23.3,27.3], f145 : [16.1,23.7,27.7], f150 : [16.3,24.0,28.1], f155 : [16.6,24.4,28.5], f160 : [16.8,24.7,28.9], f165 : [17.0,24.9,29.3], f170 : [17.2,25.2,29.6], f175 : [17.4,25.4,30.0], f180 : [17.6,25.7,30.3], }, tests:{ exists : function (element) { // function to test if element exists if(element.length > 0){ return true; } else { return false; } } }, //calc functions bmi_calc : function () { var thisTool = calc_app.el.bmi_tool; if( calc_app.tests.exists(thisTool) ){ var questionset0 = thisTool.find('.questionset0'); var resultContainer = thisTool.find('.mc-results'); var resultContainerReset = thisTool.find('.mc-results').clone(true, true); var inputs = thisTool.find('.inputs'); var units = thisTool.find('#units'); var submit=thisTool.find('.submit'); var today = new Date(); var thisYear = today.getFullYear(); var month = questionset0.find('#month'); var day = questionset0.find('#day'); var year = questionset0.find('#year'); // after load, empty the results container so screen readers don't jump to the results content before a date is calculated. thisTool.find('.mc-results').remove(); //populate days of the month when month is selected month.change(function () { day.empty(); var days = new Date(thisYear, month.val(), 0).getDate(); for(var i = 0; i <= (days-1); i++){ var dayOption = days - i; $j('