//plants per inch calc
function PlantCalc(distance, area, square, triangle)
{
 distance = document.forms[0].distance.value;
 area = document.forms[0].area.value;

 if ((distance <= 0) || (area <= 0))
   window.alert("Please do not enter negative or zero values!");
 else
   {
       s = 144 * area / (distance * distance);
       document.forms[0].square.value=
         Math.round(s - 0.5);
       document.forms[0].triangle.value=
         Math.round(s * 2 / Math.sqrt(3) - 0.5);
     }
}


function clearForm(form)

{
   form.distance.value="";
   form.area.value="";
   form.square.value="";
   form.triangle.value="";

}
//mulch calc
function CompostVolCalc(aCmpst, vCmpst, hCmpst)

{
 aCmpst = document.forms[0].aCmpst.value;
 vCmpst = document.forms[0].vCmpst.value;
 hCmpst = document.forms[0].hCmpst.value;

 if ((aCmpst < 0) || (vCmpst < 0) || (hCmpst < 0))
   window.alert("Please do not enter negative values!");
 else if ((aCmpst == 0) && (vCmpst == 0))
   window.alert("Please enter exactly two positive values!");
 else if ((aCmpst == 0) && (hCmpst == 0))
   window.alert("Please enter exactly two positive values!");
 else if ((hCmpst == 0) && (vCmpst == 0))
   window.alert("Please enter exactly two positive values!");
 else if ((aCmpst > 0) && (vCmpst > 0) && (hCmpst > 0))
   window.alert("Please enter exactly two positive values!");
 else
   {
    if (aCmpst == 0)
       document.forms[0].aCmpst.value=
         Math.round((324 * vCmpst / hCmpst));
    else if (vCmpst == 0)
       document.forms[0].vCmpst.value=
         Math.round((10 * hCmpst * aCmpst / 324)) / 10;
    else if (hCmpst == 0)
       document.forms[0].hCmpst.value=
         Math.round((324 * vCmpst / aCmpst));
     }
}

function clearForm2(form)

{
   form.aCmpst.value="";
   form.vCmpst.value="";
   form.hCmpst.value="";

}