$(function(){$('#calculate').submit(function(){$widthNew=$('#width-new :selected').val();$widthOld=$('#width-old :selected').val();$heightNew=$('#height-new :selected').val();$heightOld=$('#height-old :selected').val();$radiusNew=$('#radius-new :selected').val();$radiusOld=$('#radius-old :selected').val();$dNew=Math.round($widthNew*$heightNew*2+$radiusNew*25.4);$dOld=Math.round($widthOld*$heightOld*2+$radiusOld*25.4);$speedometer=$('#speedometer').val();$speed=Math.round((Math.round($widthNew*$heightNew*2+$radiusNew*25.4)/Math.round($widthOld*$heightOld*2+$radiusOld*25.4))*$speedometer*100)/100;$('#a-new').html($widthNew);$('#a-old').html($widthOld);$('#a-diff').html($widthNew-$widthOld);$('#c-new').html(Math.round($radiusNew*25.4));$('#c-old').html(Math.round($radiusOld*25.4));$('#c-diff').html(Math.round($radiusNew*25.4)-Math.round($radiusOld*25.4));$('#d-new').html($dNew);$('#d-old').html($dOld);$('#d-diff').html($dNew-$dOld);$('#clearance').html(($dNew-$dOld)/2);$('#speed').html($speed);$('#diff').html(Math.round(($speed-$speedometer)*100)/100);return false})});
