
material=new Array('Bricking Sand','Plastering Sand','Sharp Sand','Ballast','Pea Shingle','20mm Stone','Hogging','Crushed Concrete','Hardcore','Wearing Tarmac','Base Tarmac','Limestone','Kiln Dried Sand','Dry Sand Fine','Dry Sand Coarse','Topsoil - some moisture','Ballast','Gravel','Shingle','Stiff Clay','Loam','Peat - Wet','Peat - Dry','Lump Chalk','Sandstone','Lias','Granite','Slate','Flint','Yorkshire','Brick Rubble','Fire Clay Brick','Common Red Brick')
matvols=new Array(1.442,1.602,1.800,1.760,1.500,1.522,1.922,2.403,1,1.300,1.35,1.400,1.602,1.602,1.6,1.44,1.76,1.92,1.62,1.6,1.28,0.96,0.8,1.2,2.32,2.48,2.72,2.8,2.3,2.5,2,2.403,1.922)
skipname=new Array('1 Yard Bag','4 Yard Skip','6 Yard Skip','8 Yard Skip','12 Yard Skip','16 Yard Skip','20 Yard Roll On','30 Yard Roll On','40 Yard Roll On','12 Yard Lorry Tipper','18 Yard Lorry Tipper')
skipvols=new Array(0.67,3.05,4.56,6.08,9.12,12.16,15.2,22.8,30.40,9.12,13.68)
skipcost=new Array(30,70,90,120,150,250,300,400,495,120,145)
bricktype=new Array('Brick','Block')
bricktypeimage=new Array('<img src="images/1.png" />','<img src="images/2.png" />')
brickside=new Array(0.0168,0.1012)//in square cm
brickplusfloatvolume=new Array(0.206,1094.9)//in cubic cm
brickonlyfloatvolume=new Array(0.360,0.810)//in cubic cm

function volume()
{
	var dimensions = document.dimensions;
dimensions.totalvolume.value=Math.round((dimensions.length.value*dimensions.width.value*dimensions.depth.value)*10)/10
dimensions.materialVol.value=Math.round((matvols[dimensions.MaterialType.selectedIndex]*dimensions.totalvolume.value)*10)/10
dimensions.totalvolumeyards.value=(Math.round((dimensions.length.value*dimensions.width.value*dimensions.depth.value)* 1.3079*10)/10) 
}

function tonnage()
{
var matcubed = document.matcubed;
matcubed.totaltonnage.value=Math.round((matcubed.volume.value*matvols[matcubed.MaterialType.selectedIndex])*10)/10
}


function cuboid()
{
var square = document.square;
square.msquared.value=Math.round((square.tonnes.value/matvols[square.MaterialType.selectedIndex])*10)/10
}

function disposal()
{
var disposals = document.disposals;
var expansion=disposals.percentage.value/100
expansion=expansion+1
disposals.totalvolume.value=Math.round((disposals.length.value*disposals.width.value*disposals.depth.value*expansion)*10)/10
disposals.totalvolumeyards.value=Math.round((disposals.length.value*disposals.width.value*disposals.depth.value*expansion*1.45)*10)/10
disposals.skipsrequired.value=Math.ceil(disposals.totalvolume.value/skipvols[disposals.skiptype.selectedIndex])
if (null==disposals.skipprice)
	{
	disposals.skipcost.value=disposals.skipsrequired.value*skipcost[disposals.skiptype.selectedIndex]
 	}
else
	{
	disposals.skipcost.value=disposals.skipsrequired.value*disposals.skipprice.value
  	}   
//disposals.skipcost.value=disposals.skipsrequired.value*skipcost[disposals.skiptype.selectedIndex]
//disposals.skipcost.value=disposals.skipsrequired.value*disposals.skipprice.value
}

function buildwall()
{

var bricklayer = document.bricklayer;
//Switch image...
var imageType = bricklayer.bricktype.options[bricklayer.bricktype.selectedIndex].value;
document.wallType.src = 'images/' + imageType + '-Wall.jpg';
var waste=bricklayer.wastage.value/100
var waste=waste+1
bricklayer.wallsize.value=bricklayer.height.value*bricklayer.width.value*waste
bricklayer.bricksneeded.value=Math.ceil(bricklayer.wallsize.value/brickside[bricklayer.bricktype.selectedIndex])
bricklayer.mixneeded.value=(bricklayer.bricksneeded.value*brickonlyfloatvolume[bricklayer.bricktype.selectedIndex]/100)
//bricklayer.four2onemix.value=(Math.round((bricklayer.mixneeded.value/4)*100)/100)*1000/25
//bricklayer.five2onemix.value=(Math.round((bricklayer.mixneeded.value/5)*100)/100)*1000/25
//bricklayer.six2onemix.value=(Math.round((bricklayer.mixneeded.value/6)*100)/100)*1000/25
bricklayer.testmix.value=(Math.round((bricklayer.mixneeded.value/bricklayer.mixstrength.value)*100)/100)*1000/25
bricklayer.mixneeded.value=Math.round((bricklayer.bricksneeded.value*brickonlyfloatvolume[bricklayer.bricktype.selectedIndex]*bricklayer.sandvalue.value/100)*100)/100
}
