<%
calcurl="Fiber.html"
calctitle="Fiber Calculator"
calctease="What is your daily fiber intake requirement?"
calname="fiber"
%>

<HTML>
<HEAD>
<TITLE>Health Calc: Fiber Calculator </TITLE>

<!-- #include virtual="/SCRIPTS/pagesetup.html" -->

<meta name="viewport" content="width=device-width, initial-scale=1">
</HEAD>
<!-- BEGIN the real content of the Calculatoring experience -->
<center>

<!-- #include virtual="/SCRIPTS/calcimages.html" -->


<!-- New Header Stuff -->

<!-- End new header block -->
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="505">
   <TR VALIGN="TOP" ALIGN="LEFT">
      <TD BGCOLOR="#FFFFFF" WIDTH=237 align=left valign=top>
         <TABLE CELLPADDING=5 BORDER=0 CELLSPACING=0>
            <TR>
               <TD><P>
			   <FONT FACE="helvetica, arial, sans-serif" COLOR="#003366">

<!-- BEGIN Calculator headline and text -->
<!-- BEGIN actual question -->
<B><%=calctease%></B>
<!-- END Calculator headline and text -->

         </FONT></B></TD>
            </TR>
         </TABLE>              
      </TD>
		<!-- #include virtual="/SCRIPTS/1x1image.html" -->
		
      <TD BGCOLOR="#FFFFFF" WIDTH=267 align=left valign=top>
         <TABLE CELLPADDING=5 BORDER=0 CELLSPACING=0>
           <TR>
              <TD>
<P><B><FONT FACE="helvetica, arial, sans-serif" COLOR="#003366">

<% 
' Determine label/header (Begin here, Lifestyle, Your Results) that
dim strAg, strAct

function isStepTwo()
	strAg = request.form("Age")
	strAct = request.form("Activity")
	
	if(strAg <> "" and strAct = "") then
		isStepTwo = true
	end if
end function

function isFinal()
	if(strAct <> "") then
		isFinal = true
	end if
end function

%>
<!-- BEGIN results title -->
<% if(not isStepTwo() and not isFinal()) then %>
Begin here:
<!-- END results title -->
<% elseif(isStepTwo()) then %>

<% else %>
Your results:
<% End If 
' end label/header logic
%>

         </FONT></B></TD>
            </TR>
         </TABLE>         
      </TD>
   </TR>
   <TR VALIGN="TOP">
      <TD BGCOLOR="#FFFFFF" WIDTH=237>
         <TABLE CELLPADDING=5 CELLSPACING=0 BORDER=0>
            <TR>
               <TD>
<FONT FACE="helvetica, arial, sans-serif" SIZE="-1">

<!-- BEGIN Calculator headline and text -->
<%
strActivity=Request.form("Activity")
If strActivity>"" then
	If strActivity="" then
			Error = "Please select an activity level."
	End If
End If
If strActivity = "" Or Error > "" then%>
<P>A balanced diet needs to contain a proper mix of carbohydrates, fat, fiber and protein.</P>
<P>To get the fiber you need, choose several servings a day of foods made from whole grains, such as whole-wheat bread and whole-grain cereals. Find out how many calories from fiber you should be eating. </P>
<P><B>Caution: These estimates may not be appropriate for pregnant and nursing women.
</B><p>
This test should be used only as a guideline and is based on information available through the American Dietetics Association.<BR>&#160;<BR>
<%Else%>
<p>Thank you for using the Fiber Calculator.</P>
<P>This fiber intake estimation assumes that you are consuming an adequate number of calories per day, that you are within your normal weight range for your height, that you are moderately active and in good health.</P>
<P>Use this as a general guideline for menu planning.</P>
<P><B>Caution: These estimates may not be appropriate for pregnant and nursing women.
</B><BR>&#160;<BR>
<%End If%>
<!-- END Calculator headline and text -->

            </FONT></TD>
            </TR>
         </TABLE>
      </TD>      
      <!-- #include virtual="/SCRIPTS/1x1image.html" -->
      
      <TD BGCOLOR="#FFFFFF">
         <TABLE CELLPADDING=5 BORDER=0 CELLSPACING=0>
            <TR>
               	<TD VALIGN="TOP"><FONT FACE="helvetica, arial, sans-serif">
				<!-- BEGIN Calculator form -->
				<P><%
Dim strHeight, strHeight_m, strFinalHeight, strErrHeight, strErrHeight_m, strGender, strFrame, strAge, Message, Error, BMR, strFiber, Age1, Age2, Age3, Weigth1, Weight2, Weight3, IdealWeight, IdealWeightSmall, IdealWeightMedium, IdealWeightLarge, strActivity, DecadeAge, Calories, WhatToSubtract
Error = ""
BMR = "2,000"
strErrHeight = "We're sorry; this tool is only capable of calculating heights in certain ranges. Women need to enter heights between 4 feet 10 inches and 6 feet tall (1.50 to 1.85 metres), and men need to enter heights between 5 feet 2 inches and 6 feet 4 inches tall (1.60 to 1.95 metres). Please select a height within the range of this tool that is closest to your actual height."
If Request.ServerVariables("REQUEST_METHOD")="POST" then
	strHeight_m = Request.form("HeightM")
	strHeight = Request.form("Height")
	strGender=Request.form("Gender")
	strFrame=Request.form("Frame")
	strAge=Request.form("Age")
	strActivity=Request.form("Activity")
	IdealWeight=Request.form("IdealWeight")
	
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'''''''''''''''''''''''''''''''' Error Checking Functions '''''''''''''''''''''''''''''''''
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	
	function isMultipleUnits() ' checks for two height values
		if strHeight <> "" and strHeight_m <> "" then
			isMultipleUnits = true
		end if
	end function
	
	function isNullHeight() ' checks for empty height values
		if strHeight = "" and strHeight_m = "" then
			isNullHeight = true
		end if
	end function
	
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	'''''''''''''''''''''''''''''''' End Error Checking Functions '''''''''''''''''''''''''''''
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	
	if(isNullHeight()) then
		Error = "Please select your height in meters or feet."
		strHeight = ""
		strHeight_m = ""
	end if
	
	if(isMultipleUnits()) then
		Error = "Please select your height in either meters or feet only, not both."
		strHeight = ""
		strHeight_m = ""
	end if
	
	if Request.Form("strFinalHeight") <> "" then
	  strFinalHeight = Request.Form("strFinalHeight")
	end if
	
	''' if they selected metres '''
	if Request.Form("HeightM") <> "" then
		strHeight_m = Request.form("HeightM")
		strFinalHeight=strHeight_m
	end if
	''' if they selected feet '''
	if Request.Form("Height") <> "" then
		strHeight  = Request.form("Height")
		strFinalHeight=strHeight
	end if
	
	If not IdealWeight>"" then
		If strAge = "" or 0 then
			Error = "Please enter your age."
		End If
		If not IsNumeric(strAge) then
			Error = "Please enter a correct age."
		End If
		Age1 = Left(strAge, 1)
		Age2 = Mid(strAge, 2, 1)
		Age3 = Mid(strAGe, 3, 2)
		If Age1 > "" then
			If not IsNumeric(Age1) then
				Error = "Please use only numbers when entering your age."
			End If
		End If		
		If Age2 > "" then
			If not IsNumeric(Age2) then
				Error = "Please use only numbers when entering your age."
			End If
		End If
		If Age3 > "" then
			If not IsNumeric(Age3) then
				Error = "Please use only numbers when entering your age."
			End If
		End If
		If Error="" then
			'Limit age to less than 150
			If strAge>150 then
				Error = "This tool requires an age of 150 or less. Please re-enter your age."
			End If
		End If
		
		If strGender = "" then
			Error = "Please select a gender."
		End If
		If strFrame = "" then
			Error = "Please select your frame size."
		End If
	Else
		If strActivity="" then
			Error = "Please select an activity level."
		End If
	End If
	
	If Error = "" then
	If strGender = "Female" then
		Select Case strFinalHeight
		Case "1.50":
			IdealWeightSmall = "111"
			IdealWeightMedium = "121"
			IdealWeightLarge = "131"			
		Case "1.52":
			IdealWeightSmall = "113"
			IdealWeightMedium = "123"
			IdealWeightLarge = "134"								
		Case "1.55":
			IdealWeightSmall = "115"
			IdealWeightMedium = "126"
			IdealWeightLarge = "137"								
		Case "1.57":
			IdealWeightSmall = "118"
			IdealWeightMedium = "129"
			IdealWeightLarge = "140"				
		Case "1.60":
			IdealWeightSmall = "121"
			IdealWeightMedium = "132"
			IdealWeightLarge = "143"		
		Case "1.62":
			IdealWeightSmall = "124"
			IdealWeightMedium  = "135"
			IdealWeightLarge = "147"				
		Case "1.65":
			IdealWeightSmall = "127"
			IdealWeightMedium = "138"
			IdealWeightLarge = "151"				
		Case "1.67":
			IdealWeightSmall = "120"
			IdealWeightMedium = "141"
			IdealWeightLarge = "155"						
		Case "1.70":
			IdealWeightSmall = "133"
			IdealWeightMedium = "144"
			IdealWeightLarge = "159"	
		Case "1.73":
			IdealWeightSmall = "136"
			IdealWeightMedium = "147"
			IdealWeightLarge = "163"						
		Case "1.75":
			IdealWeightSmall = "139"
			IdealWeightMedium = "150"
			IdealWeightLarge = "167"			
		Case "1.78":
			IdealWeightSmall = "142"
			IdealWeightMedium = "153"
			IdealWeightLarge = "170"				
		Case "1.80":
			IdealWeightSmall = "145"
			IdealWeightMedium = "156"
			IdealWeightLarge = "173"				
		Case "1.83":
			IdealWeightSmall = "148"
			IdealWeightMedium = "159"
			IdealWeightLarge = "176"				
		Case "1.85":
			IdealWeightSmall = "151"
			IdealWeightMedium = "162"
			IdealWeightLarge = "179"
		Case Else:
			Error = strErrHeight
		End Select		 
		ElseIf strGender = "Male" then
		Select Case strFinalHeight			
		Case "1.60":
			IdealWeightSmall = "134"
			IdealWeightMedium = "141"
			IdealWeightLarge = "150"
		Case "1.62":
			IdealWeightSmall = "136"
			IdealWeightMedium = "143"
			IdealWeightLarge = "153"	
		Case "1.65":
			IdealWeightSmall = "138"
			IdealWeightMedium = "145"
			IdealWeightLarge = "156"
		Case "1.67":
			IdealWeightSmall = "140"
			IdealWeightMedium = "148"
			IdealWeightLarge = "160"
		Case "1.70":
			IdealWeightSmall = "142"
			IdealWeightMedium = "151"
			IdealWeightLarge = "164"
		Case "1.73":
			IdealWeightSmall = "145"
			IdealWeightMedium = "154"
			IdealWeightLarge = "168"
		Case "1.75":
			IdealWeightSmall = "148"
			IdealWeightMedium = "157"
			IdealWeightLarge = "172"
		Case "1.78":
			IdealWeightSmall = "151"
			IdealWeightMedium = "160"
			IdealWeightLarge = "176"
		Case "1.80":
			IdealWeightSmall = "154"
			IdealWeightMedium = "163"
			IdealWeightLarge = "180"
		Case "1.83":
			IdealWeightSmall = "157"
			IdealWeightMedium = "166"
			IdealWeightLarge = "184"
		Case "1.85":
			IdealWeightSmall = "160"
			IdealWeightMedium = "170"
			IdealWeightLarge = "188"
		Case "1.88":
			IdealWeightSmall = "164"
			IdealWeightMedium = "174"
			IdealWeightLarge = "192"
		Case "1.90":
			IdealWeightSmall = "168"
			IdealWeightMedium = "178"
			IdealWeightLarge = "197"
		Case "1.93":
			IdealWeightSmall = "172"
			IdealWeightMedium = "182"
			IdealWeightLarge = "202"
		Case "1.95":
			IdealWeightSmall = "176"
			IdealWeightMedium = "187"
			IdealWeightLarge = "207"
		Case Else:
			Error= strErrHeight
		End Select			
		End If
		If strFrame = "Small" then				
			IdealWeight = IdealWeightSmall
		ElseIf strFrame = "Medium" then
			IdealWeight = IdealWeightMedium
		ElseIf strFrame = "Large" then
			IdealWeight = IdealWeightLarge
		End If	
		If strFrame = "Small" then				
			IdealWeight = IdealWeightSmall
		ElseIf strFrame = "Medium" then
			IdealWeight = IdealWeightMedium
		ElseIf strFrame = "Large" then
			IdealWeight = IdealWeightLarge
		End If	
		
		If strActivity>"" then
			If strActivity="Sedentary" then
				strActivity=1.2
			ElseIf strActivity="Light" then
				strActivity=1.3
			ElseIf strActivity="Moderate" then
				strActivity=1.4
			ElseIf strActivity="Active" then
				strActivity=1.5
			End If
			
			strAge=CInt(strAge)
			If Right(strAge,1)>=5 then
				strAge=(strAge+10)
			End If
			If strAge>20 then
				DecadeAge=Left(strAge, 1)
				WhatToSubtract=((DecadeAge-2)*2)
			Else
				WhatToSubtract=0
			End If	
			If strGender="Female" then
				Calories=IdealWeight*10
			ElseIf strGender="Male" then
				Calories=IdealWeight*11
			End If
			WhatToSubtract=((WhatToSubtract*Calories)/100)
			Calories=Calories-WhatToSubtract
			strFiber=CInt((((Calories*strActivity)*1.1)*11.5)/1000)
		End If
	End If	
End If

If strFiber = "" or Error > ""then%>
		<%If Error > "" then%>
		<FONT size=2 color="#ff0000"><I><% = Error%></I></FONT><BR><BR>
		<%End If%>
		<form method="post" action="<% = Request.ServerVariables("SCRIPT_NAME")%>"><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
		<%If not IdealWeight>"" then%>
			<TR>
				<TD ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>Proper nutrition is critical for overall health and exercise performance. Enter your information below and get practical estimates for your daily dietary fiber intake.<BR><BR></FONT></TD>
			</TR>	
			<TR>
				<TD height=35 ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>Enter your age: <input type="text" name="Age" value="<%=strAge%>" size=5 maxlength=3> years<BR><BR></FONT></TD>
			</TR>		
			<TR>
				<TD height=35 ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>Height: <SELECT NAME="HeightM">
				<OPTION VALUE="">Meters&nbsp;&nbsp;&nbsp;
				<OPTION <%If strHeightMeter = "4f 10i" then%>SELECTED<%End If%> VALUE="1.50">1.50 m
				<OPTION <%If strHeightMeter = "4f 11i" then%>SELECTED<%End If%> VALUE="1.52">1.52 m
				<OPTION <%If strHeightMeter = "5f 0i" then%>SELECTED<%End If%> VALUE="1.55">1.55 m
				<OPTION <%If strHeightMeter = "5f 1i" then%>SELECTED<%End If%> VALUE="1.57">1.57 m
				<OPTION <%If strHeightMeter = "5f 2i" then%>SELECTED<%End If%> VALUE="1.60">1.60 m
				<OPTION <%If strHeightMeter = "5f 3i" then%>SELECTED<%End If%> VALUE="1.62">1.62 m
				<OPTION <%If strHeightMeter = "5f 4i" then%>SELECTED<%End If%> VALUE="1.65">1.65 m
				<OPTION <%If strHeightMeter = "5f 5i" then%>SELECTED<%End If%> VALUE="1.67">1.67 m
				<OPTION <%If strHeightMeter = "5f 6i" then%>SELECTED<%End If%> VALUE="1.70">1.70 m
				<OPTION <%If strHeightMeter = "5f 7i" then%>SELECTED<%End If%> VALUE="1.73">1.73 m
				<OPTION <%If strHeightMeter = "5f 8i" then%>SELECTED<%End If%> VALUE="1.75">1.75 m
				<OPTION <%If strHeightMeter = "5f 9i" then%>SELECTED<%End If%> VALUE="1.78">1.78 m
				<OPTION <%If strHeightMeter = "5f 10i" then%>SELECTED<%End If%> VALUE="1.80">1.80 m
				<OPTION <%If strHeightMeter = "5f 11i" then%>SELECTED<%End If%> VALUE="1.83">1.83 m
				<OPTION <%If strHeightMeter = "6f 0i" then%>SELECTED<%End If%> VALUE="1.85">1.85 m
				<OPTION <%If strHeightMeter = "6f 1i" then%>SELECTED<%End If%> VALUE="1.88">1.88 m
				<OPTION <%If strHeightMeter = "6f 2i" then%>SELECTED<%End If%> VALUE="1.90">1.90 m
				<OPTION <%If strHeightMeter = "6f 3i" then%>SELECTED<%End If%> VALUE="1.93">1.93 m
				<OPTION <%If strHeightMeter = "6f 4i" then%>SELECTED<%End If%> VALUE="1.95">1.95 m
				</SELECT>
				<br>
				<b>or</b>
				<BR>
				Height: <SELECT NAME="Height">
				<OPTION VALUE="">Feet
				<OPTION <%If strHeight = "4f 10i" then%>SELECTED<%End If%> VALUE="1.50">4 ft. 10 in.
				<OPTION <%If strHeight = "4f 11i" then%> SELECTED<%End If%> VALUE="1.52">4 ft. 11 in.
				<OPTION <%If strHeight = "5f 0i" then%>SELECTED<%End If%> VALUE="1.55">5 ft. 0 in.
				<OPTION <%If strHeight = "5f 1i" then%>SELECTED<%End If%> VALUE="1.57">5 ft. 1 in.
				<OPTION <%If strHeight = "5f 2i" then%>SELECTED<%End If%> VALUE="1.60">5 ft. 2 in.
				<OPTION <%If strHeight = "5f 3i" then%>SELECTED<%End If%> VALUE="1.62">5 ft. 3 in.
				<OPTION <%If strHeight = "5f 4i" then%>SELECTED<%End If%> VALUE="1.65">5 ft. 4 in.
				<OPTION <%If strHeight = "5f 5i" then%>SELECTED<%End If%> VALUE="1.67">5 ft. 5 in.
				<OPTION <%If strHeight = "5f 6i" then%>SELECTED<%End If%> VALUE="1.70">5 ft. 6 in.
				<OPTION <%If strHeight = "5f 7i" then%>SELECTED<%End If%> VALUE="1.73">5 ft. 7 in.
				<OPTION <%If strHeight = "5f 8i" then%>SELECTED<%End If%> VALUE="1.75">5 ft. 8 in.
				<OPTION <%If strHeight = "5f 9i" then%>SELECTED<%End If%> VALUE="1.78">5 ft. 9 in.
				<OPTION <%If strHeight = "5f 10i" then%>SELECTED<%End If%> VALUE="1.80">5 ft. 10 in.
				<OPTION <%If strHeight = "5f 11i" then%>SELECTED<%End If%> VALUE="1.83">5 ft. 11 in.
				<OPTION <%If strHeight = "6f 0i" then%>SELECTED<%End If%> VALUE="1.85">6 ft. 0 in.
				<OPTION <%If strHeight = "6f 1i" then%>SELECTED<%End If%> VALUE="1.88">6 ft. 1 in.
				<OPTION <%If strHeight = "6f 2i" then%>SELECTED<%End If%> VALUE="1.90">6 ft. 2 in.
				<OPTION <%If strHeight = "6f 3i" then%>SELECTED<%End If%> VALUE="1.93">6 ft. 3 in.
				<OPTION <%If strHeight = "6f 4i" then%>SELECTED<%End If%> VALUE="1.95">6 ft. 4 in.
				</SELECT><BR><BR></FONT></TD>
			</TR>
			<TR>
				<TD height=35 ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>Gender: <input type="radio" name="Gender" value="Male"<%If strGender = "Male" then%> CHECKED<%End If%>>Male <input type="radio" name="Gender" value="Female"<%If strGender = "Female" then%> CHECKED<%End If%>>Female<BR><BR></FONT></TD>
			</TR>
			<TR>
				<TD ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>Frame Size: 
				<SELECT NAME="Frame">
					<OPTION
					<%If strFrame = "Small" then%>
					SELECTED
					<%End If%> VALUE="Small">Small
					<OPTION
					<%If strFrame = "Medium" then%>
					SELECTED
					<%End If%> VALUE="Medium">Medium
					<OPTION
					<%If strFrame = "Large" then%>
					SELECTED
					<%End If%> VALUE="Large">Large
				</SELECT><BR></FONT></TD>
			</TR>												
			<%Else%>
			<TR>
				<TD ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>What is your physical activity level?</FONT></TD>
			</TR>
			<TR>
				<TD ALIGN="LEFT" VALIGN="MIDDLE"><FONT FACE="arial, helvetica, sans-serif" SIZE=2>
				<INPUT TYPE="RADIO" NAME="Activity" VALUE="Sedentary">Sedentary (sitting, driving a car, lying down, reading, typing, low intensity activities)<BR>
				<INPUT TYPE="RADIO" NAME="Activity" VALUE="Light">Light (light exercise, such as walking, for no more than 2 hours daily)<BR>
				<INPUT TYPE="RADIO" NAME="Activity" VALUE="Moderate">Moderate (dancing, heavy housework, very little sitting)<BR>
				<INPUT TYPE="RADIO" NAME="Activity" VALUE="Active">Very Active (sports or labor intensive work)
				<INPUT TYPE="hidden" NAME="IdealWeight" VALUE="<%=IdealWeight%>">
				<INPUT TYPE="hidden" NAME="Height" VALUE="<%=strFinalHeight%>">
				<INPUT TYPE="hidden" NAME="Gender" VALUE="<%=strGender%>">
				<INPUT TYPE="hidden" NAME="Frame" VALUE="<%=strFrame%>">
				<INPUT TYPE="hidden" NAME="Age" VALUE="<%=strAge%>"></FONT></TD>
			</TR>
			<%End If%>
			<TR>
				<TD ALIGN="LEFT" VALIGN="MIDDLE"><BR>
				<INPUT TYPE="Submit" VALUE="Submit" NAME="Submit"></TD>
			</TR>	
		</TABLE>
<%Else%>
	<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
		<TR>
			<TD ALIGN=LEFT VALIGN=MIDDLE><FONT FACE="arial, helvetica, sans-serif" SIZE=2><B>Your daily Fiber requirement is <% = strFiber%> grams</B><BR><BR>This figure is based on a diet of <B><% = Calories%> calories per day</B>--the appropriate amount of calories per day based on your age and weight.</FONT></TD>
		</TR>
		
		<!-- #include virtual="/SCRIPTS/close_button.html" -->
		
	</TABLE>
	<br>
	
	<!-- #include virtual="/SCRIPTS/copyrightinfo.html" -->
	
<%End If%>

	<!-- #include virtual="/SCRIPTS/disclaimer.html" -->


				<!-- END Calculator form -->
     
<!-- END the real content of the Calculatoring experience -->

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-47063811-22"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-47063811-22');
</script>
</body>
</HTML>
























