function calculate(row){

	
	cube_feet = document.getElementById('cbf'+row).innerHTML; // Get cubc feet value of row
	quantity = document.getElementById('qty'+row).value; // get the quantity from this row
	if (isNaN(quantity)){ // if a letter or other character other than anumber is entered then ..
	document.getElementById('qty'+row).value=''; //remove it ..
	alert('Please enter numbers only'); // and warn
	}else{
	
	volume=cube_feet*quantity; // Work out the volume based on the qty * the space it requires
	
	document.getElementById('vol'+row).value=volume; //automagically enter the volume in the rows Volume cell
	}
	
}

function calc_crates(){

			total_space=0; 
			for(var no=1;no<104;no++){ // for each row...
				total_space += Number(document.getElementById('vol'+no).value); // get the value of Vol and add it on
			}
			no_of_crates=total_space/250; // divide by the cubic size of a crate
			
			no_of_crates=Math.ceil(no_of_crates); // round the number up so there is always room
			document.getElementById('cratesno').innerHTML='We estimate you have '+total_space+' cubic feet and will require '+no_of_crates+' crate(s). Please contact us for a competitive quote.';
			alert('We estimate you have '+total_space+' cubic feet and will require '+no_of_crates+' crate(s).'+ '\n' +'Please contact us for a competitive quote.'); //respond
			}


