function calcNa(form)
{
	
	var fw = document.fw;
	var na = form.na.value;
	var gluc = form.gluc.value;
	
	if ((na == "") || (na <= 0) || (isNaN(na))) {
		alert("Please enter the Sodium Value");
		eval("document.fw.na.focus();");
		return false;
	}
	if ((gluc == "") || (gluc <= 0) || (isNaN(gluc))) {
		alert("Please enter the Glucose Value");
		eval("document.fw.gluc.focus();");
		return false;
	}
	if (gluc > 100) {
		na = parseFloat(na);
		var newNa = ((gluc-100) / 100) + na;

		//form.correctNa.value = roundNum(newNa,1);
		newNa = roundNum(newNa,1);
		
		window.location.href="SodiumResult.asp?correctNa="+newNa+"&Sodium="+na+"&glu="+gluc;
		//window.open('SodiumResult.asp?correctNa='+newNa+"&Sodium="+na+"&glu="+gluc,'inbox','top=200 height=220 width=460 left=200 status=0 toolbar=0') ;

          	}

	else 
  	{
    	alert("Glucose value greater than 100");
    	form.gluc.focus();
	    return false;
	  }

function roundNum(thisNum,dec) {
	thisNum = thisNum * Math.pow(10,dec)
	thisNum = Math.round(thisNum)
	thisNum = thisNum / Math.pow(10,dec)
	return thisNum
}
}
