<!--

function myRound(num,decimals)
{
  x= Math.pow(10,decimals);
  res = Math.round(num* x)/x;
  return (res);
}

function odoweight(oform)
{
  vol = oform.olength.value * oform.owidth.value * oform.oheight.value * oform.opieces.value;

  volw =  vol / oform.odimFactor.value;
  b = volw - parseInt( volw );
  if( b <= .5 && 0 < b && (oform.odimFactor.value == 366) )
  {
    c=.5;		// if Kg go to next pound or half Kilo
  }
  else // if( (.5 < b) && (b < 1 ) )
  {
    c=1;		// if Lbs go to next pound
  }
  if( b==0 ) c=0;
  fweight = volw - b + c;
  if( ( isNaN( fweight ) || fweight < 1 ) ) fweight = 1;
  oform.answer.value = myRound(parseFloat(fweight),3);

  iCubeFeet = vol / 1728;
  oform.answerCubeFeet.value = myRound(iCubeFeet,3); 
				
  iCubeMeter = iCubeFeet / 35.314;
  oform.answerCubeMeter.value = myRound(iCubeMeter,3);
  
  
  oform.answerActWeight.value = myRound(oform.actWeight.value / 2.2046,3);
  return 1;
}

function changetype(element)
{
  oform=element.oform;
  if (oform.pkgtype[0].checked)
  {
     oform.odimFactor.value=194;
  }
  else if (oform.pkgtype[1].checked)
  {
     oform.odimFactor.value=366;
  }
  else if (oform.pkgtype[2].checked)
  {
     oform.odimFactor.value=166
  }
  else if (form.pkgtype[3].checked)
  {
     oform.odimFactor.value=366
  }
    
  odoweight(oform);
}

//-->