//initialize
      var idepth
      var ithickness
      var iwidth
      var idiam
      var iheight
      var ilength = 1; ilength <= 3; ilength       
      var icubicyards      function calculateSlabPour()
      {
      
      
        var form = document.SlabCalculator;
        
        if (!validateField(form.Thickness,"Please enter a number value in cms for thickness."))
            return false;
        
        if (!validateField(form.Width,"Please enter a number value in meter for width."))
            return false;
            
        if (!validateField(form.Length,"Please enter a number value in meter for length."))
            return false;
      
      
        //starting values
        ithickness = form.Thickness.value
        iwidth = form.Width.value;
        ilength = form.Length.value; 
        //1 inch = 2.54 centimeters;
        icubicyards = "";
        
           //massage floating point values                                                               
          // ithickness = ithickness / 12;
    	ithickness = ithickness / 100;
		//alert(ithickness);
	     //  icubicyards = floatFix(ithickness * iwidth * ilength / 27, 2);
		 icubicmeter = floatFix(ithickness * iwidth * ilength, 2);
		 //1 meter = 1.0936133 yard
		 //1 cubic meter = 1.30795062 cubic yard
         icubicyards=icubicmeter/1.30795062;
	     icubicyards=floatFix(icubicyards, 2);
		   iBags40 = floatFix((icubicyards * 90), 1);
		   iBags60 = floatFix((icubicyards * 60), 1);
		   iBags80 = floatFix((icubicyards * 45), 1);
		
		   //assign
           form.CubicYards.value = icubicmeter;
		   form.Bags40.value = iBags40;
		   form.Bags60.value = iBags60;
		   form.Bags80.value = iBags80;	 
	   }
       
      function calculateFootingPour()
      {
      
        var form = document.FootingCalculator;
        
        if (!validateField(form.Depth,"Please enter a number value in cms for the depth."))
            return false;
        
        if (!validateField(form.Width,"Please enter a number value in cms for the width."))
            return false;
            
        if (!validateField(form.Length,"Please enter a number value in meter for the length."))
            return false;
            
      
        //starting values
        idepth = form.Depth.value;
        iwidth = form.Width.value;
        ilength = form.Length.value; 
        icubicyards = "";
        
        
           //massage floating point values                                                               
           //idepth = floatFix(idepth / 12, 2);
          // iwidth = floatFix(iwidth / 12, 2);
		  idepth = floatFix(idepth / 100, 2);
          iwidth = floatFix(iwidth / 100, 2);
		  icubicmeter = floatFix(iwidth * idepth * ilength, 2);		  // icubicyards = floatFix(icubicmeter / 1.30795062, 2);
              icubicyards=icubicmeter/1.30795062;
			  icubicyards=floatFix(icubicyards, 2);
		   iBags40 = floatFix((icubicyards * 90), 1);
		   iBags60 = floatFix((icubicyards * 60), 1);
		   iBags80 = floatFix((icubicyards * 45), 1);
		
		   //assign
           form.CubicYards.value = icubicmeter;
		   form.Bags40.value = iBags40;
		   form.Bags60.value = iBags60;
		   form.Bags80.value = iBags80;
		 
	   }
	
	function calculateColumnPour()
      {
      
        var form = document.ColumnCalculator;
      
        if (!validateField(form.Diameter,"Please enter a number value in cms for the diameter."))
            return false;
        
        if (!validateField(form.Height,"Please enter a number value in cms for the height."))
            return false;
            
            
        //starting values
        idiam = form.Diameter.value;
        iheight = form.Height.value; 
        icubicyards = "";
		icubicmeter = "";
        idiam= idiam/2.54; //convert in to inches
        iheight= iheight/2.54;  //convert in to inches
        //idiam= floatFix(idiam,2);
		
		//iheight= floatFix(iheight,2);
		//alert(idiam);
		//alert(iheight);
        icubicyards = floatFix(((idiam / 2)*(idiam / 2) * Math.PI * iheight * .0000214334705),2);
//alert(icubicyards);
	    icubicmeter=floatFix(icubicyards/1.30795062,2);
		
		iBags40 = floatFix((icubicyards * 90), 1);
		iBags60 = floatFix((icubicyards * 60), 1);
		iBags80 = floatFix((icubicyards * 45), 1);		 
		// icubicmeter = floatFix(((idiam / 2)*(idiam / 2) * Math.PI * iheight),2);		//assign
        form.CubicYards.value = icubicmeter;
		form.Bags40.value = iBags40;
		form.Bags60.value = iBags60;
		form.Bags80.value = iBags80;
	 
	   }
              
        function validateField(field, errormsg) {
            
            var value = field.value;
    
           if ((isNaN(value) == true) || (value == ''))
           {
             alert (errormsg);
             field.value = '';
             field.focus();
             return false;
           }
           
           return true;
        }
       function floatFix(value, places)
       {
	
           outstring = Math.round(value*100)/100  
         return (outstring);
       }