$(".draggable").draggable({handle:".dragHandle"});$(".measurementCalc h5").corner("top");$(".measurementInfo").corner("bottom");var options={};$(".calculatorShow.side a").effect("bounce")
$(".calculatorShow a").click(function(event){event.preventDefault();$(this).blur();$("#measurementCalcDisplay").show();$(document).bind("keydown.es",function(event){if(event.keyCode==27){$("#measurementCalcDisplay").hide();$(document).unbind("keydown.es");}});});$(".closeCalc a").click(function(event){event.preventDefault();$(this).blur();$("#measurementCalcDisplay").hide();});$("#calcButton").click(function(){var length=$("#calculationForm #lenghtInches").val();var width=$("#calculationForm #widthInches").val();var height=$("#calculationForm #heightInches").val();var weight=$("#calculationForm #material").val();if(weight=="Dirt"){weight=1.3;}else if(weight=="Rock"){weight=1.4;}else if(weight=="Sand"){weight=1.5;}
var cubicYards=CalcCubicYards(length,width,height);var tonnage=CalcTonnage(length,width,height,weight);$("#calculationForm #cubicYards").val(cubicYards);$("#calculationForm #Tonnage").val("Estimate: "+tonnage);});function CalcCubicYards(length,width,height){var cubicYards=Math.round((length*width*height)/27);var value=cubicYards;return value;}
function CalcTonnage(length,width,height,weight){var math=((length*width*height)/27);var tonnage=Math.round(math*weight);var value=tonnage;return value;}
