﻿function round(number,X) {
	X = (!X ? 2 : X);
	return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}
function UpdateDistance(input) {
	var Dist=input.value*1;
	var Type=input.name;
	if (Type == "km")	   { A = Dist * 10000000000000; }
	else if (Type == "m")  { A = Dist * 10000000000; }
	else if (Type == "st") { A = Dist * 1922700000000; }
	km = round(A*1e-13);
	m = round(A*1e-10);
	st = round(A*5.201019e-13);
	if (Type != "m")  { document.Distances.m.value=m; }
	if (Type != "st") { document.Distances.st.value=st; }
}