activity = new Array("Lying Down","Sitting","Standing","Driving a Car","Walking downstairs","Walking upstairs","Mopping floors","Gardening","Walking [ Slow ]","Walking [ Medium ]","Walking [ Fast ]","Walking [ Very Fast ]","Jogging [ Slow ]","Jogging [ Fast ]","Dancing","Rowing [ Leisure ]","Rowing [ Vigorous ]","Cycling ","Tennis [ Recreative ]","Tennis [ Competitive ]","Football","Hockey","Swimming  [ Leisure]","Swimming [ Breast stroke ]");



calories = new Array(1,1.5,2.6,2.8,7.1,12.0,4.9,5.6,5.6,10,15,20,10.0,15.0,6.0,5.0,15.0,7.0,7.0,11.0,13.0,14.0,6.0,12.0)



var totalCalories = 0;		 
minutes = new Array();
hours = new Array();

for(var counter = 0; counter < activity.length; counter++)
{
	minutes[counter] = 0;
	hours[counter] = 0;
}	

function calc(selIndex,selName)
{

	totalCalories = 0;	
	selName = selName.name;
	
	var index =  selName.substring(7,8)
	index = parseInt(index);
	
	 
	if(selName.substring(0,3) == 'hrs')
	{
		hours[index] = selIndex;
	}	
	
	if(selName.substring(0,3) == 'min')
	{
		minutes[index] = selIndex;
	}	
	

	for(var counter = 0; counter < activity.length; counter++)
	{
			
		// Comment for moment -- alert( "Hours Number :" + hours[counter] + "\n Hours in minutes : " + (hours[counter] * 60)  + "\nMinutes : " + minutes[counter] + "\nTotal Minutes : " + ( minutes[counter] + ( 60 * hours[counter] )) + "\nCalories for Activity" + calories[counter] + "\nTotal Calories :" + ( ( minutes[counter] + ( 60 * hours[counter] )) * calories[counter]) + "\n" + totalCalories);
		totalCalories += ( ( minutes[counter] + ( 60 * hours[counter] )) * calories[counter]);
		
	}	
	result = "<span class=\"nutrition\">Your target <b class=\"nutrition1\">" + target + "</b> calories<br clear=all><BR>Calories burned :<br clear=\"all\"><br><b class=\"nutrition1\">" + totalCalories + "</b> calories<br clear=all>"
	
	if(document.layers)
	{
		document.score.document.open();
		document.score.document.write(result);
		document.score.document.close();
	}
	else
	{
		if(document.all)
		{
			document.all.score.innerHTML = result;
		}
	}	

}











