  function calculateYardage(){

       var fydepth = parseInt(document.calc.FYdepthSelect.options[document.calc.FYdepthSelect.selectedIndex].value);
       var bydepth = parseInt(document.calc.BYdepthSelect.options[document.calc.BYdepthSelect.selectedIndex].value);
       var gdepth = parseInt(document.calc.GdepthSelect.options[document.calc.GdepthSelect.selectedIndex].value);
       
       var fyLen= parseFloat(document.calc.FYlengthFt.value);
       var byLen= parseFloat(document.calc.BYlengthFt.value);
       var gLen= parseFloat(document.calc.GlengthFt.value);

       var fyWd = parseFloat(document.calc.FYwidthFt.value);
       var byWd = parseFloat(document.calc.BYwidthFt.value);
       var gWd = parseFloat(document.calc.GwidthFt.value);

       if(isNaN(fydepth))fydepth = 0; 
       if(isNaN(bydepth))bydepth = 0; 
       if(isNaN(gdepth))gdepth = 0; 

       if(isNaN(fyLen))fyLen = 0;
       if(isNaN(byLen))byLen = 0;
       if(isNaN(gLen)) gLen = 0;

       if(isNaN(fyWd)) fyWd = 0;
       if(isNaN(byWd)) byWd = 0;
       if(isNaN(gWd))  gWd = 0;
     
       document.calc.FYtotal.value = 0;
       document.calc.BYtotal.value = 0;
       document.calc.Gtotal.value = 0;

       //Calculate Front Yard data...
       if (isPos(fyLen) && isPos(fyWd)){
	    var cubicFt = fyLen * fyWd * fydepth/12;
            CubicYards = cubicFt/27;
	    document.calc.FYtotal.value = CubicYards;

       } else {
          alert("You must enter an integer for all fields.  Length and width must be greater than 0.");
       }
      //Calculate Back Yard data...
      	if (isPos(byLen) && isPos(byWd)){
	    var cubicFt = byLen * byWd * bydepth/12;
            CubicYards = cubicFt/27;
	    document.calc.BYtotal.value = CubicYards;

	} else {
		alert("You must enter an integer for all fields.  Length and width must be greater than 0.");
	}
	if (isPos(gLen) && isPos(gWd)){
	    var cubicFt = gLen * gWd * gdepth/12;
            CubicYards = cubicFt/27;
	    document.calc.Gtotal.value = CubicYards;

	}
        //the total amount of mulch....
	document.calc.total.value = (parseFloat(document.calc.FYtotal.value) + 
				    parseFloat(document.calc.BYtotal.value) +
				    parseFloat(document.calc.Gtotal.value));
	
   }
   function isPos(s){
	if(s >=0)
	 return true;
        return false;
  }

  function reset(form, count, st, last){
      for(var i = 0; i< count; i++){
	  form.elements[i].value = "0";
      }
      for(var j=st; j<=last;j++){
	form.elements[j].value = "0";
      }
  }

