var usewgt;
var last;
var longfin;
longfin=0;

//     ***********************weight on length***************
function lenwic(i,c,g,o,p)
{
	// cm
	y=(i * 2.54);
	x=y.toFixed(3);
	if (isNaN(x)) {x=0;}
	document.forms.lenw.cm.value=x;
	x=dorest(i);
}

function lenwcmc(i,c,g,o,p)
{
	// inch
	i=(c / 2.54);
	x=i.toFixed(3);
	if (isNaN(x)) {x=0;}
	document.forms.lenw.inch.value=x;
	x=dorest(i);
}
function lenwlfc(i)
{
  if (document.forms.lenw.lf.checked){
	longfin=1;}
  else 
	{longfin=0;}

x=dorest(i);
}

function dorest(i)
{
	if (longfin==1) {i=i * 1.12};
	//  pounds
	p=(i*i*i)/1650;
	x=p.toFixed(3);
	if (isNaN(x)) {x=0;}
	document.forms.lenw.pound.value=x;
	x=(p*16).toFixed(3);
	if (isNaN(x)) {x=0;}
	document.forms.lenw.ounce.value=x;
	x=(p*16*28.35).toFixed(3);
	if (isNaN(x)) {x=0;}
	document.forms.lenw.gram.value=x;
}