// JavaScript Document

function CalculateMulch(dim1,dim2) {
bedlength = dim1.value;
bedwidth = dim2.value;

if (bedlength == 0) {
alert("Enter a valid length");
   dim1.focus();
   dim1.select();
   return false;
}

if (isNaN(bedlength)) {
alert("Enter a valid length");
   dim1.focus();
   dim1.select();
   return false;
}

if (bedwidth == 0) {
alert("Enter a valid width");
   dim2.focus();
   dim2.select();
   return false;
}

if (isNaN(bedwidth)) {
alert("Enter a valid width");
   dim2.focus();
   dim2.select();
   return false;
}
quantity = (bedlength * bedwidth * .25)/27
quantityrounded = Math.ceil(quantity);
jQuery('#totalyds').val(quantityrounded);
}