{"id":14331,"date":"2025-11-27T14:23:09","date_gmt":"2025-11-27T14:23:09","guid":{"rendered":"https:\/\/www.esnadmedical.sa\/%d8%ad%d8%b3%d8%a7%d8%a8-%d8%a7%d9%84%d9%88%d8%b2%d9%86-%d8%a7%d9%84%d8%b7%d8%a8%d9%8a%d8%b9%d9%8a\/"},"modified":"2025-12-01T15:14:36","modified_gmt":"2025-12-01T15:14:36","slug":"healthy-weight-calculator","status":"publish","type":"page","link":"https:\/\/www.esnadmedical.sa\/en\/healthy-weight-calculator\/","title":{"rendered":"Healthy Weight Calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"14331\" class=\"elementor elementor-14331 elementor-14043\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4081fd4 e-con-full wd-section-stretch e-flex e-con e-parent\" data-id=\"4081fd4\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d27220a elementor-widget-divider--view-line_text elementor-widget-divider--element-align-center elementor-widget elementor-widget-divider\" data-id=\"d27220a\" data-element_type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t\t<h1 class=\"elementor-divider__text elementor-divider__element\">\n\t\t\t\tBMI Calculator\t\t\t\t<\/h1>\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"wd-negative-gap elementor-element elementor-element-df8cfd3 e-flex e-con-boxed e-con e-parent\" data-id=\"df8cfd3\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-f64f4ca elementor-widget elementor-widget-shortcode\" data-id=\"f64f4ca\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\">\t\t<style>\n          #calc_wrapper{\n          \t--family-calc-vis:jf-flat,sans-serif;\n            --title-color:#fff;\n            --values-color:#394f5c;\n            --text-color:#000;\n          }\n\n          .toggle-switch {\n  display: inline-block;\n  position: relative;\n  width: 30px;\n  height: 17px;\n  margin-left:15px;\n  margin-top: 4px;\n}\n\n.toggle-switch input {\n  display: none;\n}\n\n.toggle-switch-slider {\n  position: absolute;\n  cursor: pointer;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background-color: #ccc;\n  border-radius: 17px;\n  transition: 0.4s;\n}\n\n.toggle-switch-slider:before {\n  position: absolute;\n  content: \"\";\n  height: 13px;\n  width: 13px;\n  left: 2px;\n  bottom: 2px;\n  background-color: white;\n  border-radius: 50%;\n  transition: 0.4s;\n}\n\ninput:checked + .toggle-switch-slider {\n  background-color: #4f94d4;\n}\n\ninput:checked + .toggle-switch-slider:before {\n  transform: translateX(13px);\n}\n\n.imperial_inputs{\n    display:none;\n}\n    \t\t<\/style>\n\n\n        <div class=\"calc_wrapper\" id=\"calc_wrapper\">\n            <div class=\"calc_header\">\n                <div class=\"calc_header_left\">\n                                        <div class=\"calc_header_title\">\n                        BMI Calculator                    <\/div>\n                                                            <a href=\"https:\/\/www.calculator.io\/bmi-calculator\/\" target=\"_blank\" style=\"text-decoration: none;\" rel=\"noopener\">\n                                        <div class=\"calc_header_desc\">\n                        Use this calculator to check your body mass index (BMI).                    <\/div>\n                                        <\/a>\n                                    <\/div>\n                                <div class=\"calc_header_right\">\n                    <img decoding=\"async\" src=\"https:\/\/www.esnadmedical.sa\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/bmiberegner.png\" alt=\"BMI Calculator\">\n                <\/div>\n                            <\/div>\n            <div class=\"custom_flex_calc_wrapper\">\n\n\n                <div class=\"calc_data\">\n\n                                            <style>\n                            .button-group {\n                                display: flex;\n\t\t\t\t\t\t\t\twidth:100%\n                            }\n\n                            input[type=\"radio\"][name=\"units_checkbox\"] {\n                                display: none;\n                            }\n\n                            .radio-label {\n                                padding: 5px 10px;\n                                margin: 0;\n                                color: black;\n                                background-color: #cccccc;\n                                cursor: pointer;\n                                transition: all 0.3s ease;\n                            }\n\n                            input[type=\"radio\"]:checked + .radio-label {\n                                color: white;\n                                background-color: #4f94d4;\n                            }\n                            label[for=\"metric\"]{\n                                border-radius:5px 0 0  5px ;\n                            }\n                            label[for=\"imperial\"]{\n                                border-radius:0 5px 5px  0;\n                            }\n                        <\/style>\n                        <div class=\"button-group\" style=\"margin-bottom:16px;align-items: center;display: none;\">\n                            <span class=\"switcher_color\" style=\"width:100%\">\n                            Unit type                            <\/span>\n\n                            <input type=\"radio\" id=\"metric\" name=\"units_checkbox\" value=\"metric\" checked>\n                            <label for=\"metric\" class=\"radio-label\">Metric<\/label>\n\n                            <input type=\"radio\" id=\"imperial\" name=\"units_checkbox\" value=\"imperial\">\n                            <label for=\"imperial\" class=\"radio-label\">Imperial<\/label>\n                        <\/div>\n\n                        \n                        <div class=\"metric_inputs\">\n                            <div class=\"calc_data_height\">\n                                <span for=\"calc_height_input\">\n                                    Height                                <\/span>\n                                <input id=\"calc_height_input\" class=\"calc_input_custom\" type=\"text\" placeholder=\"Your height\">\n                                <div class=\"calc_placeholder\">\n                                    cm.                                <\/div>\n                            <\/div>\n                            <div for=\"calc_height_input\" class=\"alert-mess\">\n                                Please enter value between 125 and 225.                            <\/div>\n                            <div class=\"calc_data_weight\">\n                                <span for=\"calc_weight_input\">\n                                    Weight                                <\/span>\n                                <input id=\"calc_weight_input\"  class=\"calc_input_custom\" type=\"text\" placeholder=\"Your weight\">\n                                <div class=\"calc_placeholder\">\n                                    kg.                                <\/div>\n                            <\/div>\n                            <div for=\"calc_weight_input\" class=\"alert-mess\">\n                                Please enter value between 10.0 and 500.0 ( one decimal ).                            <\/div>\n\n                        <\/div>\n\n\n                        <div class=\"imperial_inputs\">\n                            <div class=\"calc_data_height\">\n                                <span for=\"calc_height_input\">\n                                    Height                                <\/span>\n                                <div class=\"custom_flex_wrapper\">\n                                    <input id=\"calc_height_input_ft\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <input id=\"calc_height_input_in\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <div class=\"calc_placeholder year\">\n                                        ft.                                    <\/div>\n                                    <div class=\"calc_placeholder\">\n                                        in.                                    <\/div>\n                                <\/div>\n                            <\/div>\n                            <div for=\"calc_height_input_ft\" class=\"alert-mess\">\n                                Please enter value between 4.2 and 7.3                            <\/div>\n                            <div class=\"calc_data_weight\">\n                                <span for=\"calc_weight_input\">\n                                    Weight                                <\/span>\n                                <div class=\"custom_flex_wrapper\">\n                                    <input id=\"calc_weight_input_lb\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <input id=\"calc_weight_input_st\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <div class=\"calc_placeholder year\">\n                                        lb.                                    <\/div>\n                                    <div class=\"calc_placeholder\">\n                                        st.                                    <\/div>\n                                <\/div>\n                            <\/div>\n                            <div for=\"calc_weight_input_lb\" class=\"alert-mess\">\n                                Please enter value between 22.0 and 1000.0 ( one decimal ).                            <\/div>\n                        <\/div>\n\n                        <div class=\"calc_input_button\" id=\"calc_input_button\">\n                            Calculate BMI  <img decoding=\"async\" style=\"width:9px;height:12px\" src=\"https:\/\/www.esnadmedical.sa\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Arrow.png\" >\n                        <\/div>\n\n\n\n                <\/div>\n\n\n\n\n                <div class=\"calc_info\">\n                    <div class=\"calc_info_placeholder e1764496670\">\n                        Use this calculator to check your body mass index (BMI), which can be a helpful tool in determining your weight category. Or, use it to calculate your child\u2019s BMI.                    <\/div>\n                    <div class=\"calc_info_data e1764496670\" style=\"display:none\">\n                        <div class=\"calc_info_data_title\">\n                            Your Body Mass Index (BMI) is                        <\/div>\n                        <div style=\"margin-bottom:50px\" class=\"calc_info_data_value\" id=\"calc_bmi\">\n                        <\/div>\n                        <div class=\"calc_info_data_title\">\n                            Based on your input, your BMI is in the category                        <\/div>\n                        <div class=\"calc_info_data_value\" id=\"calc_conclusion\">\n                        <\/div>\n                        <div class=\"calc_info_line\">\n                            <div class=\"calc_info_line_result_wrapper\">\n                                <div class=\"calc_info_line_result\">\n                                    You                                <\/div>\n                            <\/div>\n\n                            <div class=\"calc_info_line_underweight\">\n                                Underweight                            <\/div>\n                            <div class=\"calc_info_line_healthy\">\n                                Healthy                            <\/div>\n                            <div class=\"calc_info_line_overweight\">\n                                Overweight                            <\/div>\n                            <div class=\"calc_info_line_obese\">\n                                Obese                            <\/div>\n                        <\/div>\n\n\n                        <div class=\"calc_info_conclusion\" id=\"calc_info_conclusion\">\n                            For your height, a healthy weight would be between <span id=\"healthy_weight\" class=\"calc_info_data_value\"><\/span> kilograms                        <\/div>\n\n                        <div class=\"calc_info_conclusion\" id=\"calc_info_conclusionLb\" style=\"display:none\">\n                            For your height, a healthy weight would be between <span id=\"healthy_weightLb\" class=\"calc_info_data_value\"><\/span> lb.                        <\/div>\n\n\n\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n    <script>\n    document.addEventListener('DOMContentLoaded', function(){\n        (function( $ ) {\n\n\n            var units = 'metric';\n\n            $('input[name=\"units_checkbox\"]').on('change',function(){\n                if ($(this).val() == 'imperial')\n                {\n                    $('.imperial_inputs').css('display','block');\n                    $('.metric_inputs').css('display','none');\n\n\n                    units = 'imperial';\n                }else{\n                    $('.imperial_inputs').css('display','none');\n                    $('.metric_inputs').css('display','block');\n\n\n                    units = 'metric';\n                }\n            })\n\n\n            function moveRect(e){\n                switch(e.key){\n\n                    case \"Enter\":  \/\/ \u0435\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u0430 \u043a\u043b\u0430\u0432\u0438\u0448\u0430 \u0432\u043b\u0435\u0432\u043e\n                        var can = true;\n                        if(units == 'metric'){\n                            $('#calc_height_input').each(function(){\n                                if(parseInt($(this).val()) < 125 || parseInt($(this).val()) > 225 || !Number.isInteger(parseInt($(this).val())) || $(this).val()[0]=='0'){\n                                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                    $(this).addClass('alert');\n                                    can = false;\n                                }else{\n                                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                    $(this).removeClass('alert');\n                                    height = $(this).val()\n                                }\n\n\n                            })\n                            $('#calc_weight_input').each(function(){\n\n                                    if(parseFloat($(this).val()) < 10 || parseFloat($(this).val()) > 500 || fweight(parseFloat($(this).val())) > 1 || parseFloat($(this).val())!=$(this).val() || $(this).val()[0]=='0'){\n                                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                        $(this).addClass('alert');\n                                        can = false;\n                                    }else{\n                                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                        $(this).removeClass('alert');\n                                        weight = parseFloat($(this).val());\n                                    }\n\n                            })\n                            \/\/console.log(can);\n                            if(can){\n                                                                $('#calc_input_button').html('Recalculate BMI  <img decoding=\"async\" src=\"https:\/\/www.esnadmedical.sa\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Vector Smart Object.png\" >');\n                                $('#calc_input_button').addClass('re');\n\n                                var bmi = (parseFloat(weight)\/(parseInt(height)\/100*parseInt(height)\/100)).toFixed(2);\n                                console.log(bmi);\n                                if( bmi <=18.49 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Underweight');\n                                    var left = 0;\n                                    if(bmi > 12){\n\n                                        left = (bmi - 12)*($('.calc_info_line_underweight').width()\/6.5);\n                                        console.log(left);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',(left-30)+'px' );\n                                }\n                                if(bmi >= 18.5 && bmi <=24.99 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Healthy');\n\n                                    var left = 0;\n                                    if(bmi > 18.5){\n                                        left = (bmi - 18.5)*($('.calc_info_line_healthy').width()\/6.5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width())-30)+'px' );\n                                }\n                                if(bmi >= 25 && bmi <=29.99 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Overweight');\n                                    var left = 0;\n                                    if(bmi > 25){\n                                        left = (bmi - 25)*($('.calc_info_line_overweight').width()\/5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width())-30)+'px' );\n                                }\n                                if(bmi >= 30 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Obese');\n                                    var left = 0;\n                                    if(bmi > 30){\n                                        left = (bmi - 30)*($('.calc_info_line_obese').width()\/5);\n                                    }\n                                    if(bmi > 35){\n                                        left = $('.calc_info_line_obese').width();\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width() +$('.calc_info_line_overweight').width())-30)+'px' );\n                                }\n                                var healthy_min = Math.round(18.5 * (parseInt(height)\/100*parseInt(height)\/100));\n                                var healthy_max = Math.round(24.99 * (parseInt(height)\/100*parseInt(height)\/100));\n\n\n\n                                if(units == 'metric'){\n                                    $('#healthy_weight').html(healthy_min+' - '+healthy_max);\n                                    $('#calc_info_conclusionLb').css('display','none');\n                                    $('#calc_info_conclusion').css('display','block');\n                                }else{\n                                    $('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n                                    $('#calc_info_conclusionLb').css('display','block');\n                                    $('#calc_info_conclusion').css('display','none');\n                                }\n                                \/\/$('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n\n\n                                                            }\n                        }else{\n\n\n\n\n\n\n\n\n                            var feets = $('#calc_height_input_ft').val();\n                            var inches = $('#calc_height_input_in').val();\n                            if(isNaN(parseFloat(feets))){\n                                feets = 0;\n                            }\n                            if(isNaN(parseFloat(inches))){\n                                inches = 0;\n                            }\n                            var height_imp = ((parseFloat(feets) + parseFloat(inches) \/ 12) * 30.48).toFixed(0);\n\n                            if(height_imp < 125 || height_imp > 225 ){\n                                $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','1');\n                                $('#calc_height_input_ft').addClass('alert');\n                                $('#calc_height_input_in').addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','0');\n                                $('#calc_height_input_ft').removeClass('alert');\n                                $('#calc_height_input_in').removeClass('alert');\n                            }\n\n                            height = height_imp;\n\n\n                            var pounds = $('#calc_weight_input_lb').val();\n                            var stones = $('#calc_weight_input_st').val();\n                            if(isNaN(parseFloat(pounds))){\n                                pounds = 0;\n                            }\n                            if(isNaN(parseFloat(stones))){\n                                stones = 0;\n                                console.log('alo')\n                            }\n                            var weight_imp = ((parseFloat(pounds) + parseFloat(stones) \/ 14) \/ 2.20462 ).toFixed(0);\n\n                            if(weight_imp < 10 || weight_imp > 500){\n                                $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','1');\n                                $('#calc_weight_input_lb').addClass('alert');\n                                $('#calc_weight_input_st').addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','0');\n                                $('#calc_weight_input_lb').removeClass('alert');\n                                $('#calc_weight_input_st').removeClass('alert');\n                            }\n                            console.log(parseFloat(stones))\n                            weight = weight_imp;\n                            \/\/console.log(can);\n                            if(can){\n                                                                $('#calc_input_button').html('Recalculate BMI  <img decoding=\"async\" src=\"https:\/\/www.esnadmedical.sa\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Vector Smart Object.png\" >');\n                                $('#calc_input_button').addClass('re');\n\n                                var bmi = (parseFloat(weight)\/(parseInt(height)\/100*parseInt(height)\/100)).toFixed(2);\n                                console.log(bmi);\n                                if( bmi <=18.49 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Underweight');\n                                    var left = 0;\n                                    if(bmi > 12){\n\n                                        left = (bmi - 12)*($('.calc_info_line_underweight').width()\/6.5);\n                                        console.log(left);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',(left-30)+'px' );\n                                }\n                                if(bmi >= 18.5 && bmi <=24.99 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Healthy');\n\n                                    var left = 0;\n                                    if(bmi > 18.5){\n                                        left = (bmi - 18.5)*($('.calc_info_line_healthy').width()\/6.5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width())-30)+'px' );\n                                }\n                                if(bmi >= 25 && bmi <=29.99 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Overweight');\n                                    var left = 0;\n                                    if(bmi > 25){\n                                        left = (bmi - 25)*($('.calc_info_line_overweight').width()\/5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width())-30)+'px' );\n                                }\n                                if(bmi >= 30 ){\n                                    $('.calc_info_placeholder.e1764496670').css('display','none');\n                                    $('.calc_info_data.e1764496670').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Obese');\n                                    var left = 0;\n                                    if(bmi > 30){\n                                        left = (bmi - 30)*($('.calc_info_line_obese').width()\/5);\n                                    }\n                                    if(bmi > 35){\n                                        left = $('.calc_info_line_obese').width();\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width() +$('.calc_info_line_overweight').width())-30)+'px' );\n                                }\n                                var healthy_min = Math.round(18.5 * (parseInt(height)\/100*parseInt(height)\/100));\n                                var healthy_max = Math.round(24.99 * (parseInt(height)\/100*parseInt(height)\/100));\n\n                                if(units == 'metric'){\n                                    $('#healthy_weight').html(healthy_min+' - '+healthy_max);\n                                    $('#calc_info_conclusionLb').css('display','none');\n                                    $('#calc_info_conclusion').css('display','block');\n                                }else{\n                                    $('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n                                    $('#calc_info_conclusionLb').css('display','block');\n                                    $('#calc_info_conclusion').css('display','none');\n                                }\n\n\n\n\n                                \n                            }\n\n\n\n\n\n\n\n                        }\n                        break;\n                }\n            }\n            function check_imperial(can){\n                var feets = $('#calc_height_input_ft').val();\n                var inches = $('#calc_height_input_in').val();\n                if(isNaN(parseFloat(feets))){\n                    feets = 0;\n                }\n                if(isNaN(parseFloat(inches))){\n                    inches = 0;\n                }\n                var height_imp = ((parseFloat(feets) + parseFloat(inches) \/ 12) * 30.48).toFixed(0);\n\n                if(height_imp < 125 || height_imp > 225 ){\n                    $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','1');\n                    $('#calc_height_input_ft').addClass('alert');\n                    $('#calc_height_input_in').addClass('alert');\n                    can = false;\n                }else{\n                    $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','0');\n                    $('#calc_height_input_ft').removeClass('alert');\n                    $('#calc_height_input_in').removeClass('alert');\n                }\n\n                height = height_imp;\n\n\n                var pounds = $('#calc_weight_input_lb').val();\n                var stones = $('#calc_weight_input_st').val();\n                if(isNaN(parseFloat(pounds))){\n                    pounds = 0;\n                }\n                if(isNaN(parseFloat(stones))){\n                    stones = 0;\n                    console.log('alo')\n                }\n                var weight_imp = ((parseFloat(pounds) + parseFloat(stones) \/ 14) \/ 2.20462 ).toFixed(0);\n\n                if(weight_imp < 10 || weight_imp > 500){\n                    $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','1');\n                    $('#calc_weight_input_lb').addClass('alert');\n                    $('#calc_weight_input_st').addClass('alert');\n                    can = false;\n                }else{\n                    $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','0');\n                    $('#calc_weight_input_lb').removeClass('alert');\n                    $('#calc_weight_input_st').removeClass('alert');\n                }\n                console.log(parseFloat(stones))\n                weight = weight_imp;\n                return can;\n            }\n            addEventListener(\"keydown\", moveRect);\n            const fweight = x => ( (x.toString().includes('.')) ? (x.toString().split('.').pop().length) : (0) );\n            var height = '';\n            var weight = '';\n            var checkingRegExp = new RegExp(\/^(\\d)$\/g);\n            $('#calc_height_input').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())  && $(this).val().split(\".\").length < 3){\n                    height = $(this).val();\n                }else{\n                    $(this).val(height);\n                }\n\n                if(parseInt($(this).val()) < 125 || parseInt($(this).val()) > 225 || !Number.isInteger(parseInt($(this).val())) || $(this).val()[0]=='0'){\n                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                    $(this).addClass('alert');\n                }else{\n                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                    $(this).removeClass('alert');\n                }\n            })\n            $('#calc_weight_input').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val()) && $(this).val().split(\".\").length < 3 ){\n                    weight = $(this).val();\n                }else{\n                    $(this).val(weight);\n                }\n                    if(parseFloat($(this).val()) < 10 || parseFloat($(this).val()) > 500 || fweight(parseFloat($(this).val())) > 1 || parseFloat($(this).val())!=$(this).val() || $(this).val()[0]=='0'){\n                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                        $(this).addClass('alert');\n                        can = false;\n                    }else{\n                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                        $(this).removeClass('alert');\n                    }\n            })\n            var prev1 = 0;\n            var prev2 = 0;\n            var prev3 = 0;\n            var prev4 = 0;\n\n            $('#calc_height_input_ft').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev1 = $(this).val();\n                }else{\n                    $(this).val(prev1);\n                }\n                var can = check_imperial(true);\n            })\n            $('#calc_height_input_in').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev2 = $(this).val();\n                }else{\n                    $(this).val(prev2);\n                }\n                var can = check_imperial(true);\n            })\n            $('#calc_weight_input_lb').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev3 = $(this).val();\n                }else{\n                    $(this).val(prev3);\n                }\n                var can = check_imperial(true);\n            })\n            $('#calc_weight_input_st').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev4 = $(this).val();\n                }else{\n                    $(this).val(prev4);\n                }\n                var can = check_imperial(true);\n            })\n\n\n\n\n\n\n\n\n            $('#calc_input_button').on('click',function(){\n                var can = true;\n\n\n                if(units == 'metric'){\n\n\n                    $('#calc_height_input').each(function(){\n\n\n                            if(parseInt($(this).val()) < 125 || parseInt($(this).val()) > 225 || !Number.isInteger(parseInt($(this).val())) || $(this).val()[0]=='0'){\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                $(this).addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                $(this).removeClass('alert');\n                                height = $(this).val();\n                            }\n\n                    })\n                    $('#calc_weight_input').each(function(){\n\n\n                            if(parseFloat($(this).val()) < 10 || parseFloat($(this).val()) > 500 || fweight(parseFloat($(this).val())) > 1 || parseFloat($(this).val())!=$(this).val() || $(this).val()[0]=='0'){\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                $(this).addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                $(this).removeClass('alert');\n                                weight = $(this).val();\n                            }\n\n                    })\n                }else{\n\n                    if(can){\n                        can = check_imperial(true);\n                    }\n\n\n                }\n                \/\/console.log(can);\n                if(can){\n                    \n                    $('#calc_input_button').html('Recalculate BMI  <img decoding=\"async\" src=\"https:\/\/www.esnadmedical.sa\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Vector Smart Object.png\" >');\n                    $('#calc_input_button').addClass('re');\n                    console.log(weight)\n                    console.log(height)\n                    var bmi = (parseFloat(weight)\/(parseInt(height)\/100*parseInt(height)\/100)).toFixed(2);\n                    console.log(bmi);\n                    if( bmi <=18.49 ){\n                        $('.calc_info_placeholder.e1764496670').css('display','none');\n                        $('.calc_info_data.e1764496670').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Underweight');\n                        var left = 0;\n                        if(bmi > 12){\n\n                            left = (bmi - 12)*($('.calc_info_line_underweight').width()\/6.5);\n                            console.log(left);\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',(left-30)+'px' );\n                    }\n                    if(bmi >= 18.5 && bmi <=24.99 ){\n                        $('.calc_info_placeholder.e1764496670').css('display','none');\n                        $('.calc_info_data.e1764496670').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Healthy');\n\n                        var left = 0;\n                        if(bmi > 18.5){\n                            left = (bmi - 18.5)*($('.calc_info_line_healthy').width()\/6.5);\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width())-30)+'px' );\n                    }\n                    if(bmi >= 25 && bmi <=29.99 ){\n                        $('.calc_info_placeholder.e1764496670').css('display','none');\n                        $('.calc_info_data.e1764496670').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Overweight');\n                        var left = 0;\n                        if(bmi > 25){\n                            left = (bmi - 25)*($('.calc_info_line_overweight').width()\/5);\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width())-30)+'px' );\n                    }\n                    if(bmi >= 30 ){\n                        $('.calc_info_placeholder.e1764496670').css('display','none');\n                        $('.calc_info_data.e1764496670').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Obese');\n                        var left = 0;\n                        if(bmi > 30){\n                            left = (bmi - 30)*($('.calc_info_line_obese').width()\/5);\n                        }\n                        if(bmi > 35){\n                            left = $('.calc_info_line_obese').width();\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width() +$('.calc_info_line_overweight').width())-30)+'px' );\n                    }\n                    var healthy_min = Math.round(18.5 * (parseInt(height)\/100*parseInt(height)\/100));\n                    var healthy_max = Math.round(24.99 * (parseInt(height)\/100*parseInt(height)\/100));\n\n                    if(units == 'metric'){\n                        $('#healthy_weight').html(healthy_min+' - '+healthy_max);\n                        $('#calc_info_conclusionLb').css('display','none');\n                        $('#calc_info_conclusion').css('display','block');\n                    }else{\n                        $('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n                        $('#calc_info_conclusionLb').css('display','block');\n                        $('#calc_info_conclusion').css('display','none');\n                    }\n\n                                }\n            })\n        })( jQuery );\n})\n\n    <\/script>\n    <\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>BMI Calculator<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-14331","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/pages\/14331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/comments?post=14331"}],"version-history":[{"count":0,"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/pages\/14331\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esnadmedical.sa\/en\/wp-json\/wp\/v2\/media?parent=14331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}