top of page

Caloric Calculator

 

I'm a paragraph. Click here to add your own text and edit me. It’s easy. Just click “Edit Text” or double click me to add your own content and make changes to the font. Feel free to drag and drop me anywhere you like on your page. I’m a great place for you to tell a story and let your users know a little more about you.

This is a great space to write long text about your company and your services. You can use this space to go into a little more detail about your company. Talk about your team and what services you provide. Tell your visitors the story of how you came up with the idea for your business and what makes you different from your competitors. Make your company stand out and show your visitors who you are.

 

 

Here's the script for the caloric calculator. Copy and paste. Where does it go?

 

<head><title>Calorie Allowance</title><script type="text/javascript">function cc(){ var cneed; var fneed; var crneed; var pneed; var aneed; var fd; var age=parseInt(document.getElementById("age").value); var foot=parseInt(document.getElementById("foot").value); var inch=parseInt(document.getElementById("inch").value); var cm1=(inch*2.54); var cm2=(foot*30.48); var cm=cm1+cm2; var weight=parseInt(document.getElementById("weight").value); var loa=document.getElementById("loa").value; if(document.getElementById("gen").checked) { fd=66+(13.7*(weight/2.2))+(5*cm)-(6.8*age); } else { fd=655+(9.6*(weight/2.2))+(1.8*cm)-(4.7*age); } switch(loa) { case "1": cneed=fd*1.2; break; case "2": cneed=fd*1.375 break; case "3": cneed=fd*1.53; break; case "4": cneed=fd*1.725; break; case "5": cneed=fd*1.9; break; } cneed=Math.floor(cneed); fneed=Math.floor((cneed*0.25)/9); pneed=Math.floor((cneed*0.25)/4); crneed=Math.floor((cneed*0.25)/4); aneed=Math.floor((cneed*0.25)/7); document.getElementById("rc").innerHTML=" "+cneed+" per day"; document.getElementById("rf").innerHTML=" "+fneed+" grams per day"; document.getElementById("rp").innerHTML=" "+pneed+" grams per day"; document.getElementById("rh").innerHTML=" "+crneed+" grams per day"; document.getElementById("ra").innerHTML=" "+aneed+" grams per day";}function con(num){var hc=parseInt(num.value);var hi=hc/2.54;var hf=Math.floor(hi/12);var ri=Math.round(hi%12); if(hc>40 && hc<=210) { document.getElementById("foot").value=hf; }document.getElementById("inch").value=ri;}function hcon(){ var hf=parseInt(document.getElementById("foot").value); var hi=parseInt(document.getElementById("inch").value); var hc; hc=Math.round((hf*30.48)+(hi*2.54)); document.getElementById("cen").value=hc;}function cknum(event,num){var kc;if(window.event){ kc=event.keyCode;}else{ kc=event.which;}var a=num.value;if(kc==48){ if(a=="") { return false; } else { return true; }} if (kc!=8 && kc!=0){ if (kc<49||kc>57) { return false; }} } </script><!-- Script by hscripts.com --></head>

bottom of page