function updatePoints(cal, fat, fiber, servings)
{
	servings = Number(servings);
	cal = Number(cal);
	//alert(cal);
	fat = Number(fat);
	fiber = Number(fiber);
	if (fiber > 4) {
		fiber = 4;
	}
	cal = cal*servings;
	fat = fat*servings;
	fiber = fiber*servings;
	
	
	points = (cal/50)+(fat/12)-(fiber/5);
	points2 = (Math.round(points*10))/10;
	points = (Math.round(points));
	points3 = points2/servings;
	points3 = (Math.round(points3*10))/10;
	//alert(points);

	document.getElementById("calcPointsDisplay").innerHTML = points;
	document.getElementById("calcPointsDisplay2").innerHTML = points2;
	document.getElementById("calcPointsDisplay3").innerHTML = points3;
	//document.getElementById("DanielPoints").value = points;
	//document.getElementById("MariePoints").value = points;
	//document.getElementById("JoshPoints").value = points;
	
}

function addPoints(action, person, points) 
{
	target = "update.php?name=" + person + "&action=" + action + "&num=" + points;
	//alert(target);
	location.href = target;
}

function updateWeight(person) 
{
	weight = prompt("Please enter you current weight.");
	if (weight){
		target = "update.php?name=" + person + "&action=updateWeight&num=" + weight;
		//alert(target);
		location.href = target;
	}
}


