

function calcCal(obj) {
var Minutes=0; 
var Hours=0;

if(IsNum(obj.minutes.value)){ Minutes = eval(obj.minutes.value);}
if(IsNum(obj.hours.value)){Hours=eval(obj.hours.value);}

var Time=Minutes+Hours*60;
var Weight=eval(obj.weight.value);

// From Wellness guid to fitness p 29
obj.aerDanceLight.value  = Math.round(120* (Time/50)*(Weight/150) );
obj.aerDanceMod.value  = Math.round(200* (Time/50)*(Weight/150) ); 
obj.aerDanceVig.value  = Math.round(300* (Time/50)*(Weight/150) );

obj.cyc5mph.value  = Math.round(130* (Time/50)*(Weight/150) );
obj.cyc10mph.value  = Math.round(220* (Time/50)*(Weight/150) );
obj.cyc13mph.value  = Math.round(320* (Time/50)*(Weight/150) );


obj.badmitton.value   = Math.round(175* (Time/50)*(Weight/150) );
obj.tennis.value      = Math.round(210* (Time/50)*(Weight/150) );
obj.Racquetball.value  = Math.round(360* (Time/50)*(Weight/150) );
obj.squash.value      = Math.round(420* (Time/50)*(Weight/150) );

obj.run5mph.value  		 = Math.round(320* (Time/50)*(Weight/150) );
obj.run6mph.value      = Math.round(350* (Time/50)*(Weight/150) );
obj.run7mph.value  		= Math.round(430* (Time/50)*(Weight/150) );
obj.run10mph.value      = Math.round(550* (Time/50)*(Weight/150) );

obj.skiDown.value  		 = Math.round(300* (Time/50)*(Weight/150) );
obj.skiCC1.value      = Math.round(200* (Time/50)*(Weight/150) );
obj.skiCC2.value      = Math.round(560* (Time/50)*(Weight/150) );

obj.crawl25ypm.value      = Math.round(180* (Time/50)*(Weight/150) );
obj.crawl40ypm.value      = Math.round(260* (Time/50)*(Weight/150) );
obj.crawl50ypm.value      = Math.round(375* (Time/50)*(Weight/150) );

obj.walk2mph.value      = Math.round(150* (Time/50)*(Weight/150) );
obj.walk4mph.value      = Math.round(200* (Time/50)*(Weight/150) );
obj.walk6mph.value      = Math.round(370* (Time/50)*(Weight/150) );

 }

// isNum function

function IsNum(str) {
      for (var i = 0; i < str.length; i++) {
         var chr = str.substring(i, i+1);
         if ((chr < "0" || "9" < chr) && chr != ".")
            return false; 
      }
      if (eval(str)==0)
         return false;
      return true;
   }

 
