// common_calc.js 070926

var KJ=4.184;
var kg2lb=2.2046226;
var lb2kg=.4535924;
var s3="&nbsp; &nbsp;"
var s7="&nbsp; &nbsp; &nbsp; &nbsp;"
var o="<option value=";

// Write calcCookie if null else read it
if (getCookie("calcCookie")==null){mC="ca"; mW="lb"; Lb=0; Kg=0; St=0;
saveCalcCookie()}
else {data=getCookie("calcCookie");
curPos=0; num=""; while (data.charAt(curPos)!=","){num+=data.charAt(curPos); curPos++} mC=num;
curPos++; num=""; while (data.charAt(curPos)!=","){num+=data.charAt(curPos); curPos++} mW=num;
curPos++; num=""; while (data.charAt(curPos)!=","){num+=data.charAt(curPos); curPos++} Lb=num*1;
curPos++; num=""; while (data.charAt(curPos)!=","){num+=data.charAt(curPos); curPos++} Kg=num*1;
curPos++; num=""; while (data.charAt(curPos)!=","){num+=data.charAt(curPos); curPos++} St=num*1}

// Save calcCookie
function saveCalcCookie(){
data=mC+","+mW+","+Lb+","+Kg+","+St+",";
saveCookie1y("calcCookie",data,X1y)}

// Function for kj alert
function alertKJ(){
msg="If you would like to work in Kilojoules (kJ) instead of Calories (kcal), click on OK.\n\nOtherwise, click on Cancel.";
if (confirm(msg)){setCalorie(1)}}

// Function for ca alert
function alertCA(){
msg="If you would like to work in Calories (kcal) instead of Kilojoules (kJ), click on OK.\n\nOtherwise, click on Cancel.";
if (confirm(msg)){setCalorie(0)}}

// Function to change ca/kj
function setCalorie(n){
saveCookie1s("FCNCprevTotsCookie",0,X1s);
saveCookie1s("CBprevTotsCookie",0,X1s);
if (n==1){mC="kj"}
else {mC="ca"}
saveCalcCookie();
top.location.href='index_'+page+'.html'}

// onChange functions for numeric data
function setLb(n){Lb=n.value; if (Lb==""){Lb=0} checkNum(Lb);
if (chkNum==0){badLb=0; saveCalcCookie()} else {badLb=1}}
function setKg(n){Kg=n.value; if (Kg==""){Kg=0} checkNum(Kg);
if (chkNum==0){badKg=0; saveCalcCookie()} else {badKg=1}}
function setSt(n){St=n.value; if (St==""){St=0} checkNum(St);
if (chkNum==0){badSt=0; saveCalcCookie()} else {badSt=1}}

// Set calories vs. kilojoules in text
if (mC=="kj"){calories=" kilojoules "} else {calories=" calories "}

// Calorie Balance feature
// Get total calories for FCNC if in CBC
if (page=="burn"){
if (getCookie("FCNCprevTotsCookie")==0 | getCookie("FCNCprevTotsCookie")==null){
totFood=0; commaTotFood=0}
else {prevTots=getCookie("FCNCprevTotsCookie");
curPos=0; num=""; while (prevTots.charAt(curPos)!=","){num+=prevTots.charAt(curPos); curPos++}
totFood=num*1; totFood=Math.round(totFood); commaTotFood=setComma(totFood)}}
// Get total calories for CBC if in FCNC
else {
if (getCookie("CBprevTotsCookie")==0 | getCookie("CBprevTotsCookie")==null){
totBurned=0; commaTotBurned=0}
else {prevTots=getCookie("CBprevTotsCookie");
curPos=0; num=""; while (prevTots.charAt(curPos)!=","){num+=prevTots.charAt(curPos); curPos++}
totBurned=num*1; commaTotBurned=setComma(totBurned)}}
// Function to create Calorie Balance line in results display
function makeCB(){
if (page=="burn"){commaTotBurned=setComma(totBurned)}
else {totFood=Math.round(totCalNum); commaTotFood=setComma(totFood)}
balance=totFood-totBurned; balance=""+balance;
if (balance.charAt(0)=="-"){balance=balance.substring(1,balance.length); balance=setComma(balance); balance=balance+" lost"}
else {balance=setComma(balance); balance=balance+" gained"}
if (page=="burn"){CBtext="Use the <a href='index_food.html' target='_top' title='Go to Food Calculator'>Food Calculator</a> to Calculate ";
if (mC=="kj"){CBtext+="Kilojoule"} else {CBtext+="Calorie"}
CBtext+="s Consumed<p>"}
else {CBtext="Use the <a href='index_burn.html' target='_top' title='Go to Activity Calculator'>Activity Calculator</a> to Calculate ";
if (mC=="kj"){CBtext+="Kilojoule"} else {CBtext+="Calorie"}
CBtext+="s Burned<p>"}
if (mC=="ca"){CBtext+="Calorie"} else {CBtext+="Kilojoule"}
CBtext+=" Balance:&nbsp;&nbsp;<font color='#aa0000'>"+commaTotFood+"&nbsp;consumed - "+commaTotBurned+"&nbsp;burned = "+balance}

// Calculator code before background
c1='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Free Calorie Counter, Weight Loss Calculator &amp; Weight Loss Tutorial | CaloriesPerHour.com</title><link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /><style>body {margin: 0;padding: 0;font-family: Verdana, Geneva, sans-serif;	text-align: center;font-size: .75em;}a {color: #376752;}a:hover {text-decoration: none;}h1, h2 {font-family: Georgia, serif;color: #2d5443;border-bottom: 1px dotted #d3d5c0;margin-top: 0;margin-bottom: 9px;}h1 {margin-top: 0;font-size: 1.8em;}h2 {font-size: 1.5em;}.clear {clear: both;height: 0;line-height: 0;}#wrapper {margin: 0 auto;width: 960px;}#contentWrapper {text-align: left;margin-top: 13px;color: #292929;width: 960px;}#contentWrapper:after { /*clears float for Firefox*/    content: ".";    display: block;    height: 0;    clear: both;    visibility: hidden;}#content {float: left;margin-right: 13px;}/********* header *************/#header {height: 111px;width: 958px;border: 1px solid #d2d4bf;border-top: 0;background: #b3c8bf;text-align: left;}#header iframe {margin-left: 30px;margin-bottom: 11px;}#headerAd {margin: 8px 0 0 38px;vertical-align: top;}#cphLogo {margin-left: 2px;}/********* main nav ***********/#menuWrapper {width: 959px;background: #efeed8;border-left: 1px solid #d2d4bf;border-bottom: 1px solid #d2d4bf;line-height: 46px;}#menuWrapper td {border: 0;}#menuWrapper.forumMenu {border-top: 1px solid #d2d4bf;border-left: 0!important;border-right: 0!important;border-bottom: 0!important;font-size: 18px!important;}#menuWrapper.forumMenu a {color: #376752!important;font-size: 12px;}#menuWrapper td.forumMenuLast {padding-left:1px;}#menuWrapper td.forumMenuLast a{border-right: 0;}#menuWrapper a {min-height: 46px;height: auto!important;height: 46px;font-family: Arial, Helvetica, sans-serif;font-weight: bold;text-align: center;display: block;padding: 0px 5px 0 5px;text-decoration: none;border-right: 1px solid #d2d4bf;}#menuWrapper a:hover {background: #f9fbfa;}.double, .doubleOn {line-height: 15px;	}#menuWrapper .menuOn, #menuWrapper .doubleOn {background: #f9fbfa;}.double span, .doubleOn span{display: block;padding-top: 8px;}/********* Body Content *****/#rightRads {width: 160px;min-height: 597px;height: auto!important;height: 597px;border: 1px solid #d3d5c0;float: left;}#rightRads ul {margin-left:0;margin-top: 9px;padding-left: 0;list-style: none;width: 140px;}#rightRads li {margin-bottom:8px;}#rightRads .searchLinks {margin: 10px 0 13px 13px;}.rightSkyscraper{width: 160px;text-align: center;}#rightRads h3 {color: #676767;font-size: 1em;}#homeBox1, #homeBox2, #homeBox3 {width: 766px;margin-bottom: 13px;padding: 9px 9px 15px 9px;background: #f5f7f6;border: 1px solid #d3d5c0;float: left;}#homeBox1 img {float: right;padding: 2px;border: 1px solid #d3d5c0;margin-left: 5px;}.calculator {background: #f4f5ea;border: 1px solid #d2d4bf;width: 407px;padding: 9px;}.calculatorBlurb {float: right;width: 323px;}.calculator form {text-align: center;margin-bottom: 15px;margin-top: 15px;}.calculator form br {line-height: 10px;}.calculator button {margin: 0 2px 0 2px;}.help {float: right;}/********* Footer ***********/#footer {width: 958px;height: 31px;margin-top: 20px;margin-bottom: 10px;clear: both;background: #efeed8;border: 1px solid #d2d4bf;}#footer ul {margin: 8px 0 0 0;padding: 0;}#footer li {display: inline;margin: 0 5px 0 5px;font-size: .9em;}#footer li a {padding-top:4px;font-weight: normal;}.forumFooter {margin: 0 auto;}.forumFooter a {font-weight: normal;}.forumFooter a, .forumFooter a:visited {color: #376752;text-decoration: underline;}.forumFooter a:hover {color: #376752;text-decoration: none;}#demandLogo {margin-bottom: 10px;}/********** Secondary page styles ****//********* left nav ***********/#leftNav {	float: left;	display: inline; /*ie 6 double margin bug*/	width: 187px;	margin: 0 13px 0 3px;	font-family: Arial, Helvetica, san-serif;}#leftNav h3 {	margin:0;	padding: 0;	display: inline;	font-size: 1em;}#leftNav ul {	margin: 0 0 10px 0;	padding: 0;}#leftNav li {	margin: 0;	padding: 0 0 0 10px;	list-style: none;	background: url(../img/left-nav-bullet.gif) no-repeat left top;}#leftNav li.leftNavOn  {	background: url(../img/left-nav-bullet-on.gif) no-repeat left top;}.leftNavOn a{	color: #932f2f;	text-decoration: none;}#leftNav iframe {	margin-top: 10px;}/********* content ***********/.callout {	background: url(../img/callout-lightbulb.gif) no-repeat center left;	min-height: 16px;	height: auto!important;	padding: 1px 0 1px 0;	height: 16px;	color: #395c4c;	font-style: italic;	}.callout p {	padding-top: 1px;	padding-left: 30px;}.hightlightText1 {	color: #932f2f;}#pageContentBox {	float: left;	width: 561px;	padding: 9px;	margin-right: 13px;	background: #f9fbfa;	border: 1px solid #d2d4bf;}#pageContentBox ul {	margin-bottom:0;}#pageContentBox li {	margin-bottom: 10px;}#pageContentBox h2 {	border: 0;}#pageContentBox h3 {	font-size: 1.2em;	color: #2d5443;	margin-bottom: 0;	font-family: Georgia, serif;}.nextLink {	float: right;	margin: 0;	padding: 20px 0 5px 0;	font-weight: bold;	line-height: 20px;}.bottomRad {	text-align: center;	border: 3px double #d2d4bf;	background: #fff;}.bottomRad h3 {	margin-top: .8em;	margin-bottom: .8em;}.bottomRad p {	margin-top: .8em;	margin-bottom: 1em;}/*** cross over from original site... calulator inactive buttons ***//* Active Button without Width */.buttonsAnoW {	font-family: verdana,arial;	font-size: 13px;	color: #000099}/* Active Button 75px */.buttonsA {	font-family: verdana,arial;	font-size: 13px;	color: #000099;	width: 75px}/* Inactive Button 75px */.buttonsI {	font-family: verdana,arial;	font-size: 13px;	color: #9999cc;	width: 75px}/* Active Button 110px */.buttonsAview {	font-family: verdana,arial;	font-size: 13px;	color: #000099;	width: 110px}/* Inactive Button 110px */.buttonsIview {	font-family: verdana,arial;	font-size: 13px;	color: #9999cc;	width: 110px}	label {	display: block;	width: 350px;	float: left;	margin-bottom: 20px;}label {	text-align: right;	width: 75px;	padding-right: 10px;	font: bold 11px helvetica;}br {	clear: left;}</style><META name="description" content="Calorie counter and calculator for food calories and nutrition for grocery, fast food, restaurant and vegetarian foods."><META name="keywords" content="free, calorie, calories, kilojoules, per, hour, burned, counter, counting, calculator, calculate, calculating, BMI, BMR, RMR, fat, protein, carbohydrates, carbs, carb, low, nutrition, vegetarian, sodium, salt, fiber, ideal weight, weight loss, weight, loss, tips, program, diet, food, foods, fast, groceries, liquor, walking, running, in-line skating, bicycling, elliptical trainer, elliptical machine, caloriesperhour"></head><body>';
c1+=" ";

// Calculator code after background
if (scReso=="high"){c2=" "}
else {c2=" "}

// Calculator logo
if (page=="burn") {
	c2+='<div id="wrapper"><!-- Header/Nav Start --><div id="header"><a href="/" target="_top" rel="nofollow"><img src="img/logo.gif" alt="caloriesperhour.com" border="0" id="cphLogo" /></a><iframe src="inc/ad-728x90.php" width="728" height="90" scrolling="no" frameborder="0" name="headerAd"></iframe></div><div id="menuWrapper"><table width="100%" cellpadding="0" cellspacing="0"><tr><td><a href="/" target="_top">Home</a></td><td  class="double"><a href="tips.php" target="_top"><span>Diet &amp; Weight<br /> Loss Tips</span></a></td><td><a href="tutorial.php" target="_top">Tutorial</a></td><td class="doubleOn"><a href="index_burn.php" target="_top"><span>Calories Burned<br />Calculator</span></a></td><td class="double" valign="bottom"><a href="index_food.php" target="_top"><span>Food Calories &amp; Nutrition<br />Calculator</span></a></td><td class="double"><a href="index_loss.php" target="_top"><span>Weight Loss<br />Calculator</span></a></td><td class="double"><a href="index_convert.php" target="_top"><span>Weights &amp; Measures<br /> Converter</span></a></td><td><a href="products.php" target="_top">Products</a></td><td><a href="/forums" target="_top">Weight Loss Forums</a></td><td><a href="news.php" target="_top">Newsletter</a></td></tr></table></div><!-- Header/Nav End --><!-- 	 Content Start --><div id="contentWrapper">';
	c2+='<div id="leftNav"><h3>Calories Burned, BMI, BMR & RMR Calculator</h3><ul><li class="leftNavOn"><a href="index_burn.php" target="_top">Calculator</a></li><li><a href="help_burn_search.php" target="_top">Activity Search Feature Instructions</a></li><li><a href="help_burn_balance.php" target="_top">Calorie Balance Feature Instructions</a></li><li><a href="help_burn_work.php" target="_top">How the Activity Calculator Works</a></li><li><a href="help_burn_accurate.php" target="_top">Activity Calculator Accuracy</a></li><li><a href="help_burn_source.php" target="_top">Activity Data Sources</a></li><li><a href="help_burn_missing.php" target="_top">Missing Activities</a></li><li><a href="help_burn_problems.php" target="_top">Calculator Problems</a></li></ul></div><div id="pageContentBox">';

}


if (page=="convert") {
	c2+='<div id="wrapper"><!-- Header/Nav Start --><div id="header"><a href="/" target="_top" rel="nofollow"><img src="img/logo.gif" alt="caloriesperhour.com" border="0" id="cphLogo" /></a><iframe src="inc/ad-728x90.php" width="728" height="90" scrolling="no" frameborder="0" name="headerAd"></iframe></div><div id="menuWrapper"><table width="100%" cellpadding="0" cellspacing="0"><tr><td><a href="/" target="_top">Home</a></td><td  class="double"><a href="tips.php" target="_top"><span>Diet &amp; Weight<br /> Loss Tips</span></a></td><td><a href="tutorial.php" target="_top">Tutorial</a></td><td class="double"><a href="index_burn.php" target="_top"><span>Calories Burned<br />Calculator</span></a></td><td class="double" valign="bottom"><a href="index_food.php" target="_top"><span>Food Calories &amp; Nutrition<br />Calculator</span></a></td><td class="double"><a href="index_loss.php" target="_top"><span>Weight Loss<br />Calculator</span></a></td><td class="doubleOn"><a href="index_convert.php" target="_top"><span>Weights &amp; Measures<br /> Converter</span></a></td><td><a href="products.php" target="_top">Products</a></td><td><a href="/forums" target="_top">Weight Loss Forums</a></td><td><a href="news.php" target="_top">Newsletter</a></td></tr></table></div><!-- Header/Nav End --><!-- 	 Content Start --><div id="contentWrapper">';
	c2+='<div id="leftNav"><h3>Weights & Measures Converter</h3><ul><li class="leftNavOn" target="_top"><a href="index_convert.php">Calculator</a></li></ul></div><div id="pageContentBox">';

}


if (page=="loss") {
	c2+='<div id="wrapper"><!-- Header/Nav Start --><div id="header"><a href="/" target="_top" rel="nofollow"><img src="img/logo.gif" alt="caloriesperhour.com" border="0" id="cphLogo" /></a><iframe src="inc/ad-728x90.php" width="728" height="90" scrolling="no" frameborder="0" name="headerAd"></iframe></div><div id="menuWrapper"><table width="100%" cellpadding="0" cellspacing="0"><tr><td><a href="/" target="_top">Home</a></td><td  class="double"><a href="tips.php" target="_top"><span>Diet &amp; Weight<br /> Loss Tips</span></a></td><td><a href="tutorial.php" target="_top">Tutorial</a></td><td class="double"><a href="index_burn.php" target="_top"><span>Calories Burned<br />Calculator</span></a></td><td class="double" valign="bottom"><a href="index_food.php" target="_top"><span>Food Calories &amp; Nutrition<br />Calculator</span></a></td><td class="doubleOn"><a href="index_loss.php" target="_top"><span>Weight Loss<br />Calculator</span></a></td><td class="double"><a href="index_convert.php" target="_top"><span>Weights &amp; Measures<br /> Converter</span></a></td><td><a href="products.php" target="_top">Products</a></td><td><a href="/forums" target="_top">Weight Loss Forums</a></td><td><a href="news.php" target="_top">Newsletter</a></td></tr></table></div><!-- Header/Nav End --><!-- 	 Content Start --><div id="contentWrapper">';
	c2+='<div id="leftNav"><h3>Weight Loss</h3><ul><li class="leftNavOn"><a href="index_loss.php" target="_top">Calculator</a></li><li><a href="help_loss.php">Instructions for the Weight Loss Calculator</a></li><li><a href="help_loss_problems.php" target="_top">Calculator Problems</a></li></ul></div><div id="pageContentBox">';
	
} 


if (page=="food") {
	c2+='<div id="wrapper"><!-- Header/Nav Start --><div id="header"><a href="/" target="_top" rel="nofollow"><img src="img/logo.gif" alt="caloriesperhour.com" border="0" id="cphLogo" /></a><iframe src="inc/ad-728x90.php" width="728" height="90" scrolling="no" frameborder="0" name="headerAd"></iframe></div><div id="menuWrapper"><table width="100%" cellpadding="0" cellspacing="0"><tr><td><a href="/" target="_top">Home</a></td><td  class="double"><a href="tips.php" target="_top"><span>Diet &amp; Weight<br /> Loss Tips</span></a></td><td><a href="tutorial.php" target="_top">Tutorial</a></td><td class="double"><a href="index_burn.php" target="_top"><span>Calories Burned<br />Calculator</span></a></td><td class="doubleOn" valign="bottom"><a href="index_food.php" target="_top"><span>Food Calories &amp; Nutrition<br />Calculator</span></a></td><td class="double"><a href="index_loss.php" target="_top"><span>Weight Loss<br />Calculator</span></a></td><td class="double"><a href="index_convert.php" target="_top"><span>Weights &amp; Measures<br /> Converter</span></a></td><td><a href="products.php" target="_top">Products</a></td><td><a href="/forums" target="_top">Weight Loss Forums</a></td><td><a href="news.php" target="_top">Newsletter</a></td></tr></table></div><!-- Header/Nav End --><!-- Content Start --><div id="contentWrapper">';

}
// left nav here

if (page=="food"){
	c2+='<div id="leftNav"><h3>Food Calories & Nutrition Calculator</h3><ul><li class="leftNavOn"><a href="index_food.php" target="_top">Calculator</a></li><li><a href="calculator_help.php">Weight Loss Calculators Troubleshooting and Support</a></li><li><a href="help_food_search.php" target="_top">Food Search Feature Instructions</a></li><li><a href="help_food_set.php" target="_top">Set Servings Feature Instructions</a></li><li><a href="help_food_add.php" target="_top">Add Foods Feature Instructions</a></li><li><a href="help_food_balance.php" target="_top">Calorie Balance Feature Instructions</a></li><li><a href="help_food_work.php" target="_top">How the Food Calculator Works</a></li><li><a href="help_food_source.php" target="_top">Food Data Sources</a></li><li><a href="help_food_missing.php" target="_top">Missing Foods</a></li><li><a href="help_food_problems.php" target="_top">Calculator Problems</a></li></ul></div><div id="pageContentBox">';
}
// Get news cookie
if (getCookie("newsCookie")==null){news=0} else {news=1}

// Function to turn newsletter note off
function weekNote(){news=1; saveCookie1w("newsCookie",1,X1w); MakeImage()}
function noNote(){news=1; saveCookie1y("newsCookie",1,X1y); MakeImage()}

// Calculator panel
c3=" ";
c3+="<form name=f1>";

// No cookies note
c4=" "
c4+="<p align=center>Error:&nbsp; No Cookies<p>It appears that the capability to write cookies has been disabled in your browser. Our calculators will not work without cookies.<p>For further explanation and instructions on how to enable cookies, click on the Help button, and then select Calculator Problems Help.</p>";

// Newsletter note
c5=" "

// Calculator title
c6=" ";

// Function to insert comma if length is > 3 and < 7
function setComma(S){
s=String(S); stringLength=s.length;
if (stringLength==4){newS=s.substring(0,1)+","+s.substring(1,stringLength)}
else if (stringLength==5){newS=s.substring(0,2)+","+s.substring(2,stringLength)}
else if (stringLength==6){newS=s.substring(0,3)+","+s.substring(3,stringLength)}
else newS=S; // if length < 4 or > 6
return newS}

// Links & copyright
linksA=links;
linksA+=" ";

if (scReso=="high"){
// Spacing between calc & ad column
rightAdsA=" ";
// Ad column
// Table for whole column
rightAdsA+=" ";
// Fill at top of ad column
rightAdsA+=" ";

// Ad table with Ads by cph
rightAdsB=" ";

// End of: Ad table with Ads by cph
rightAdsC=" ";

// End of table for high reso
rightAdsD=" "}

// Begin ad set 1

// BFFM #1
c=" ";

// FL4I #1
c+=" ";

// Hoodia #1
c+=" ";

// Firm and Flatten Your Abs
c+=" ";

// Ad #1
c+=" ";

rightAdSet1=c;  // End ad set 1; Begin ad set 2

// Ad #2
c=" ";
c+="";

// FL4I #2
c+=" ";

// Negative Calorie Diet
c+=" ";

// BFFM #2
c+=" ";

// Hoodia #1
c+=" ";

rightAdSet2=c;  // End ad set 2; Begin ad set 3

// Hoodia #2
c=" ";

rightAdSet3=c;  // End ad set 3

var pageLocation = location.href;
pageLocation = pageLocation.replace('http://www.caloriesperhour.com/','');
pageLocation = pageLocation.replace('.php', '');

linksB = '<br class="clear" /></div><div id="rightRads"><div class="searchLinks"><h3>Sponsored Links</h3><ul>';

if ( pageLocation == 'index_burn_create') {

	linksB += '<li><a href="results.php?searchTerm=Calorie+Calculator" rel="nofollow" target="_top">Calorie Calculator</a></li><li><a href="results.php?searchTerm=Food+Calorie+Calculator" rel="nofollow" target="_top">Food Calorie Calculator</a></li><li><a href="results.php?searchTerm=Activity+Calorie+Calculator" rel="nofollow" target="_top">Activity Calorie Calculator</a></li></a></li><li><a href="results.php?searchTerm=Calorie+Burning+Calculator" rel="nofollow" target="_top">Calorie Burning Calculator</a></li><li><a href="results.php?searchTerm=Weight Loss Calorie Calculator" rel="nofollow" target="_top">Weight Loss Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie Intake Weight Loss Calculator" rel="nofollow" target="_top">Calorie Intake Weight Loss Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burn+Calculator" rel="nofollow" target="_top">Calorie Burn Calculator</a></li><li><a href="results.php?searchTerm=Burrito+Calorie+Calculator" rel="nofollow" target="_top">Burrito Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Intake+Calculator" rel="nofollow" target="_top">Calorie Intake Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burner+Calculator" rel="nofollow" target="_top">Calorie Burner Calculator</a></li><li><a href="results.php?searchTerm=Daily+Calorie+Calculator" rel="nofollow" target="_top">Daily Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Counter+Calculator" rel="nofollow" target="_top">Calorie Counter Calculator</a></li>';
	
} else if (pageLocation == 'index_food_create') {

	linksB += '<li><a href="results.php?searchTerm=Calorie+Counter+Calculator" rel="nofollow" target="_top">Calorie Counter Calculator</a></li><li><a href="results.php?searchTerm=Food+Calorie+Calculator" rel="nofollow" target="_top">Food Calorie Calculator</a></li><li><a href="results.php?searchTerm=Activity+Calorie+Calculator" rel="nofollow" target="_top">Activity Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burning+Calculator" rel="nofollow" target="_top">Calorie Burning Calculator</a></li><li><a href="results.php?searchTerm=Weight Loss Calorie Calculator" rel="nofollow" target="_top">Weight Loss Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie Intake Weight Loss Calculator" rel="nofollow" target="_top">Calorie Intake Weight Loss Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burn+Calculator" rel="nofollow" target="_top">Calorie Burn Calculator</a></li><li><a href="results.php?searchTerm=Burrito+Calorie+Calculator" rel="nofollow" target="_top">Burrito Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Intake+Calculator" rel="nofollow" target="_top">Calorie Intake Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burner+Calculator" rel="nofollow" target="_top">Calorie Burner Calculator</a></li><li><a href="results.php?searchTerm=Daily+Calorie+Calculator" rel="nofollow" target="_top">Daily Calorie Calculator</a></li>';

} else if (pageLocation == 'index_loss_create') {

	linksB += '<li><a href="results.php?searchTerm=Calorie+Counter+Calculator" rel="nofollow" target="_top">Calorie Counter Calculator</a></li><li><a href="results.php?searchTerm=Food+Calorie+Calculator" rel="nofollow" target="_top">Food Calorie Calculator</a></li><li><a href="results.php?searchTerm=Activity+Calorie+Calculator" rel="nofollow" target="_top">Activity Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burning+Calculator" rel="nofollow" target="_top">Calorie Burning Calculator</a></li><li><a href="results.php?searchTerm=Weight Loss Calorie Calculator" rel="nofollow" target="_top">Weight Loss Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie Intake Weight Loss Calculator" rel="nofollow" target="_top">Calorie Intake Weight Loss Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burn+Calculator" rel="nofollow" target="_top">Calorie Burn Calculator</a></li><li><a href="results.php?searchTerm=Burrito+Calorie+Calculator" rel="nofollow" target="_top">Burrito Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Intake+Calculator" rel="nofollow" target="_top">Calorie Intake Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burner+Calculator" rel="nofollow" target="_top">Calorie Burner Calculator</a></li><li><a href="results.php?searchTerm=Daily+Calorie+Calculator" rel="nofollow" target="_top">Daily Calorie Calculator</a></li>';

} else if (pageLocation == 'index_convert_create') {

	linksB += '<li><a href="results.php?searchTerm=Calorie+Counter+Calculator" rel="nofollow" target="_top">Calorie Counter Calculator</a></li><li><a href="results.php?searchTerm=Food+Calorie+Calculator" rel="nofollow" target="_top">Food Calorie Calculator</a></li><li><a href="results.php?searchTerm=Activity+Calorie+Calculator" rel="nofollow" target="_top">Activity Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burning+Calculator" rel="nofollow" target="_top">Calorie Burning Calculator</a></li><li><a href="results.php?searchTerm=Weight Loss Calorie Calculator" rel="nofollow" target="_top">Weight Loss Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie Intake Weight Loss Calculator" rel="nofollow" target="_top">Calorie Intake Weight Loss Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burn+Calculator" rel="nofollow" target="_top">Calorie Burn Calculator</a></li><li><a href="results.php?searchTerm=Burrito+Calorie+Calculator" rel="nofollow" target="_top">Burrito Calorie Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Intake+Calculator" rel="nofollow" target="_top">Calorie Intake Calculator</a></li><li><a href="results.php?searchTerm=Calorie+Burner+Calculator" rel="nofollow" target="_top">Calorie Burner Calculator</a></li><li><a href="results.php?searchTerm=Daily+Calorie+Calculator" rel="nofollow" target="_top">Daily Calorie Calculator</a></li>';
	
} 


linksB += '</ul></div><div class="rightSkyscraper"><iframe src="inc/skyskraper.php" align="center" width="160" height="600" scrolling="no" frameborder="0" name="skyskraper"></iframe></div></div></div><!-- Content End --><!-- Footer Start --><div id="footer"><ul><li><a href="/">Online Weight Loss</a></li><li>|</li><li><a href="about.php" target="_top">About Us</a></li><li>|</li><li><a href="terms.php" target="_top">Terms of Use</a></li><li>|</li><li><a href="sitemap.php" target="_top">Site Map</a></li><li>|</li><li><a href="email.php" target="_top">E-mail</a></li></ul></div><img src="img/demand-media-knowledge.gif" alt="Demand Media Knowledge" id="demandLogo" /><!-- Footer End --></div><!-- start Vibrant Media IntelliTXT script section --><script type="text/javascript" src="http://caloriesperhour.us.intellitxt.com/intellitxt/front.asp?ipid=9919"></script><!-- end Vibrant Media IntelliTXT script section --></body></html>';

// Function to check numerical entry
function checkNum(n){
chkNum=0;
curPos=0;
while (curPos<=n.length-1){
chk=n.charAt(curPos);
if (chk!="0" & chk!="1" & chk!="2" & chk!="3" & chk!="4" & chk!="5" & chk!="6" & chk!="7" & chk!="8" & chk!="9" & chk!="."){chkNum++}
curPos++}if (chkNum>0){chkNumAlert()}}

// Illegal numerical entry alert
function chkNumAlert(){alert("Please enter only numbers and, if needed, a decimal point.")}

// Spacing between buttons
sp5="&nbsp; &nbsp; &nbsp;";
