  function calculate() {
      var calc_frm = document.calculator;

      var thisWidth = calc_frm.width.value;
      var thisLength = calc_frm.length.value;
      var thisThick = calc_frm.thick.value;
      var thisDensity = calc_frm.density.value;

      if(calc_frm.thick_unit[1].checked)
         thisThick = thisThick / 12;

      if ((thisDensity != "N/A") && (calc_frm.density_unit[1].checked))
            thisDensity = thisDensity / 27;

      if (isNaN(thisWidth) || isNaN(thisLength) || isNaN(thisThick) || isNaN(thisDensity)) {
         document.getElementById('result-contact').innerHTML = "<b>Please call (618) 833-5121 for assitance.</b>";
		 document.getElementById('results').innerHTML = "Estimated Tons : N/A";
      } else {
		 document.getElementById('results').innerHTML = "Estimated Tons : " + ((thisWidth * thisLength * thisThick)  * thisDensity) / 2000;
      }
   }

   function density_calc() {
      var a = document.calculator.ge.selectedIndex - 1;
      var b = document.calculator.pr.selectedIndex - 1;
      var thisDensity = 0;

      switch(a) {
         case 0:
            switch(b)
			{
               case 0:
			    thisDensity = 118;
				break;
				
               case 1:
			    thisDensity = 120;
				break;
				
               case 2:
			    thisDensity = 111;
				break;
				
               case 3:  
			    thisDensity = 96;
				break;
				
			   case 4:  
			    thisDensity = 86;
				break;
				
               default: 
			    thisDensity = 0;
				break;
            }
            break;
         
			
         default:
            thisDensity = 0;
            break;
      }

      if (thisDensity == 0) {
         document.getElementById('result-contact').innerHTML = "<b>Undetermined Value.  Please call (618) 763-4796 for assitance.</b>";
         document.calculator.density.value = "N/A";
      } else {
         document.calculator.density.value = ((Math.round(thisDensity * 100)) / 100);
      }
   }
