
				function Pesoideal()
				{
					if (!Validate()) return; 
					{var pe = document.calcolatorepesoforma.peso.value;
					var tz = document.calcolatorepesoforma.altezza.value;
					if (document.calcolatorepesoforma.radio1[0].checked == true)
					{var ig = (tz-100) * 0.85;
					}
					else 
					{var ig = (tz-100) * 0.9;
					}
					document.calcolatorepesoforma.Vpi.value =ig;
					}
				}
				function Pesott() 
				{
					if (!Validate()) return; 
					{var pe = document.calcolatorepesoforma.peso.value;
					var tz = document.calcolatorepesoforma.altezza.value;
					if (document.calcolatorepesoforma.radio1[0].checked == true) 
					{var vpo = (tz-100) - ((tz - 150) / 2.5);
					}
					else 
					{var vpo = (tz-100) - ((tz - 150) / 4);
					}
					document.calcolatorepesoforma.VPO.value =vpo;
					}
				}
				function BMI() 
				{
					var pe = document.calcolatorepesoforma.peso.value;
					var tz = document.calcolatorepesoforma.altezza.value;
					var bi = pe / tz  / tz  * 10000;
					var re = bi - Math.floor(bi);
					re = Math.floor(re * 10);
					re = re / 10;
					bi = Math.floor(bi) + re;
					document.calcolatorepesoforma.bmi.value = bi;
				}
				function Clear() 
				{
					document.calcolatorepesoforma.altezza.value = "";
					document.calcolatorepesoforma.peso.value = "";
					document.calcolatorepesoforma.Vpi.value = "";
					document.calcolatorepesoforma.bmi.value = "";
					document.calcolatorepesoforma.VPO.value = "";
				}
				function Validate() 
				{
				if (document.calcolatorepesoforma.peso.value == "" ||document.calcolatorepesoforma.peso.value == null)  
				{
				alert ("ATTENZIONE: Inserisci il tuo peso attuale in Kg!");
				document.calcolatorepesoforma.peso.focus();
				return false;
				}
				if (document.calcolatorepesoforma.altezza.value == "" ||document.calcolatorepesoforma.peso.value == null)  
				{alert ("ATTENZIONE: Inserisci la tua altezza in Cm!");
				document.calcolatorepesoforma.altezza.focus();
				return false;
				}
				return true;	
				}
				
