
      //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 inches for the depth."))
            return false;
        
        if (!validateField(form.Width,"Please enter a number value in feet for the width."))
            return false;
            
        if (!validateField(form.Length,"Please enter a number value in feet for the length."))
            return false;
      
      
        //starting values
        ithickness = form.Thickness.value
        iwidth = form.Width.value;
        ilength = form.Length.value; 
        
        icubicyards = "";
        
           //massage floating point values                                                               
           ithickness = ithickness / 12;
    	
	       icubicyards = floatFix(ithickness * iwidth * ilength / 27, 2);
		   iBags40 = floatFix((icubicyards * 90), 1);
		   iBags60 = floatFix((icubicyards * 60), 1);
		   iBags80 = floatFix((icubicyards * 45), 1);
		
		   //assign
           form.CubicYards.value = icubicyards;
		   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 inches for the depth."))
            return false;
        
        if (!validateField(form.Width,"Please enter a number value in inches for the width."))
            return false;
            
        if (!validateField(form.Length,"Please enter a number value in feet 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);
		   icubicyards = floatFix(((iwidth * idepth) * ilength) / 27, 2);
		   iBags40 = floatFix((icubicyards * 90), 1);
		   iBags60 = floatFix((icubicyards * 60), 1);
		   iBags80 = floatFix((icubicyards * 45), 1);
		
		   //assign
           form.CubicYards.value = icubicyards;
		   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 inches for the diameter."))
            return false;
        
        if (!validateField(form.Height,"Please enter a number value in inches for the height."))
            return false;
            
            
        //starting values
        idiam = form.Diameter.value;
        iheight = form.Height.value; 
        icubicyards = "";
        
        icubicyards = floatFix(((idiam / 2)*(idiam / 2) * Math.PI * iheight * .0000214334705),2);
	    iBags40 = floatFix((icubicyards * 90), 1);
		iBags60 = floatFix((icubicyards * 60), 1);
		iBags80 = floatFix((icubicyards * 45), 1);
		
		//assign
        form.CubicYards.value = icubicyards;
		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);
       }
/*--------------------------------------------------*/
function hide(a) {
	get_id(a).className=(get_id(a).className=='list on') ? 'list':'list on';
}

function get_id(id) {

return document.getElementById(id);

}
	   
function showbags(e) {
	get_id(e).className='list on';
}
			
function hidebags(h,i) {
	get_id(h).className='list';
}
function show_calc_tab(on, off, off1) {
			
	get_id(on).className='list on';
	get_id(off).className='list';
	get_id(off1).className='list';
}

function tab(a, b, c) {
			
	get_id(a).className='current';
	get_id(b).className='noncurrent';
	get_id(c).className='noncurrent';
			
}

function numbers_only(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
    	return false;

	return true;
}