// JavaScript Document

// quantity calc
var j
j=0
function calc()	{
	j = 5
	//alert(j)
	document.forms[1].myTotal.value = (document.forms[1].length.value * document.forms[1].width.value * document.forms[1].depth.value) /1000
	return false;
}

// Area calc - rectangle
var k
k=0
function calcTurf()	{
	k = 5
	//alert(k)
	//alert(document.forms.calcTurfForm.name);
	document.forms.calcTurfForm.myTotal.value = (document.forms.calcTurfForm.length.value * document.forms.calcTurfForm.width.value ) /1
	return false;
}

// Area calc - circle
// rounded numbers from here
// http://forums.devarticles.com/javascript-development-22/javascript-to-round-to-2-decimal-places-36190.html
//
var l
l=0
function calcCircle()	{

	document.forms.calcCircleForm.myTotal.value = Math.round( Math.round( (((document.forms.calcCircleForm.length.value / 2) * (document.forms.calcCircleForm.length.value / 2) ) * Math.PI ) * Math.pow( 10, 2 + 1 ) ) / Math.pow( 10, 1 ) ) / Math.pow(10,2);
	
	return false;
}


function calc_lhs()	{
	n = 1
	//alert(n)
	document.forms.bark_lhs.myTotal.value = (document.forms.bark_lhs.length.value * document.forms.bark_lhs.width.value * document.forms.bark_lhs.depth.value) /1000
	return false;
}


function calc_rubber_lhs()	{
	n = 1
	//alert(n)
	x = (document.forms.rubber_lhs.length.value * document.forms.rubber_lhs.width.value * document.forms.rubber_lhs.depth.value) /1000
	document.forms.rubber_lhs.myTotal.value = (document.forms.rubber_lhs.length.value * document.forms.rubber_lhs.width.value * document.forms.rubber_lhs.depth.value) /1000
	
	z = Math.round((x*416.666)*1)/1
	document.forms.rubber_lhs.myRubberTotal.value = z
	
	return false;
}
