var Amount1 = 0.00,Amount2 = 0.00,Amount3= 0.00,Amount4 = 0.00,Amount5 = 0.00,Amount6= 0.00,Amount7= 0.00,Amount8 = 0.00,Amount9 = 0.00,Amount10= 0.00,Amount11 = 0.00,Amount12 = 0.00,Amount13= 0.00,Amount14 = 0.00,Amount15 = 0.00,Amount16= 0.00,Amount17= 0.00,Amount18 = 0.00,Amount19 = 0.00,Amount20= 0.00,Amount21 = 0.00,Amount22 = 0.00,Amount23= 0.00,Amount24 = 0.00,Amount25 = 0.00,Amount26= 0.00,Amount27= 0.00,Amount28 = 0.00,Amount29 = 0.00,Amount30= 0.00,Amount31 = 0.00,Amount32 = 0.00,Amount33= 0.00,Amount34 = 0.00,Amount35 = 0.00,Amount36= 0.00,Amount37= 0.00,Amount38 = 0.00,Amount39 = 0.00,Amount40= 0.00,Amount41 = 0.00,Amount42 = 0.00,Amount43= 0.00,Amount44 = 0.00,Amount45 = 0.00,Amount46= 0.00,Amount47= 0.00,Amount48 = 0.00;

var Btw = 0.00,Subtotaal = 0.00,Totala = 0.00;

var Item1 ="",Item2 = "",Item3 = "",Item4 ="",Item5 = "",Item6 = "",Item7 = "",Item8 = "",Item9 = "",Item10 = "",Item11 ="",Item12 = "",Item13 = "",Item14 ="",Item15 = "",Item16 = "",Item17 = "",Item18 = "",Item19 = "",Item20 = "",Item21 ="",Item22 = "",Item23 = "",Item24 ="",Item25 = "",Item26 = "",Item27 = "",Item28 = "",Item29 = "",Item20 = "",Item31 ="",Item32 = "",Item33 = "",Item34 ="",Item35 = "",Item36 = "",Item37 = "",Item38 = "",Item39 = "",Item40 = "",Item41 = "",Item42 = "",Item43 = "",Item44 ="",Item45 = "",Item46 = "",Item47 = "",Item48 = "";


/*****************

** Geeft een decimaal aan een nummer

*/

function AddDecimal(number)
{

  var withdecimal = "";

  var num = "" + number;

  if (num.length == 0)
  {
    withdecimal += "0";
  }
  else if (num.length == 1)
  {
    withdecimal += "0.0" + num;
  }
  else if (num.length == 2)
  {
    withdecimal += "0." + num;
  }
  else
  {
  	withdecimal += num.substring(0, num.length - 2);
  	withdecimal += "."
  	withdecimal += num.substring(num.length - 2, num.length);
  }

  return withdecimal;

}


function toonUnit(total)
{
	if (total > 0)
	{
		total = total/100;
		var sRecommended = "";
		
		var aBox=MultiDimensionalArray(9,3);
	
					aBox[0][0] = 47.00;
			aBox[0][1] = "47 m<sup>3</sup>";
			aBox[0][2] = 8;		
					aBox[1][0] = 39.00;
			aBox[1][1] = "39 m<sup>3</sup>";
			aBox[1][2] = 7;		
					aBox[2][0] = 28.00;
			aBox[2][1] = "28 m<sup>3</sup>";
			aBox[2][2] = 6;		
					aBox[3][0] = 24.00;
			aBox[3][1] = "24 m<sup>3</sup>";
			aBox[3][2] = 4;		
					aBox[4][0] = 24.00;
			aBox[4][1] = "24 m<sup>3</sup>";
			aBox[4][2] = 5;		
					aBox[5][0] = 13.00;
			aBox[5][1] = "13 m<sup>3</sup>";
			aBox[5][2] = 3;		
					aBox[6][0] = 8.00;
			aBox[6][1] = "8 m<sup>3</sup>";
			aBox[6][2] = 9;		
					aBox[7][0] = 7.00;
			aBox[7][1] = "7 m<sup>3</sup>";
			aBox[7][2] = 2;		
					aBox[8][0] = 6.00;
			aBox[8][1] = "6 m<sup>3</sup>";
			aBox[8][2] = 1;		
				
		var i;
		var j;
		var iRows = 9;
	
		for (i=0; i < iRows; i++)
		{
			if (total <= aBox[i][0])
			{
				sRecommended = "<h3>De meest geschikte ruimte voor "+total+"m<sup>3</sup> is <nobr>onze mini-box van "+aBox[i][1]+" <a href='/minibox/"+aBox[i][2]+"'>&raquo; meer info</a></nobr></h3>";
			}
		}
		
		
		if (sRecommended == "")
		{
			sRecommended = "<h3><a href='/informatie'>Informeer</a> vrijblijvend naar onze units van 25m<sup>2</sup>, 50m<sup>2</sup> en groter!</h3>";
		}
		aanbevolen.innerHTML = sRecommended;
	}
}


function MultiDimensionalArray(iRows,iCols)
{
	var i;
	var j;
	var a = new Array(iRows);
	for (i=0; i < iRows; i++)
	{
		a[i] = new Array(iCols);
		for (j=0; j < iCols; j++)
		{
			a[i][j] = "";
		}
	}
	return(a);
}

function berekenRuimte(form)

{

 Amount1 = Math.round(eval(form.Item1.value * 66));

 Amount2 = Math.round(eval(form.Item2.value * 35));

 Amount3 = Math.round(eval(form.Item3.value * 35));

 Amount4 = Math.round(eval(form.Item4.value * 114));

 Amount5 = Math.round(eval(form.Item5.value * 13));

 Amount6 = Math.round(eval(form.Item6.value * 253));

 Amount7 = Math.round(eval(form.Item7.value * 119));

 Amount8 = Math.round(eval(form.Item8.value * 158));

 Amount9 = Math.round(eval(form.Item9.value * 128));

 Amount10 = Math.round(eval(form.Item10.value * 212));

 Amount11 = Math.round(eval(form.Item11.value * 30));

 Amount12 = Math.round(eval(form.Item12.value * 105));

 Amount13 = Math.round(eval(form.Item13.value * 186));

 Amount14 = Math.round(eval(form.Item14.value * 125));

 Amount15 = Math.round(eval(form.Item15.value * 64));

 Amount16 = Math.round(eval(form.Item16.value * 39));

 Amount17 = Math.round(eval(form.Item17.value * 97));

 Amount18 = Math.round(eval(form.Item18.value * 20));

 Amount19 = Math.round(eval(form.Item19.value * 37));

 Amount20 = Math.round(eval(form.Item20.value * 37));

 Amount21 = Math.round(eval(form.Item21.value * 82));

 Amount22 = Math.round(eval(form.Item22.value * 52));

 Amount23 = Math.round(eval(form.Item23.value * 38));

 Amount24 = Math.round(eval(form.Item24.value * 20));

 Amount25 = Math.round(eval(form.Item25.value * 99));

 Amount26 = Math.round(eval(form.Item26.value * 38));

 Amount27 = Math.round(eval(form.Item27.value * 38));

 Amount28 = Math.round(eval(form.Item28.value * 82));

 Amount29 = Math.round(eval(form.Item29.value * 84));

 Amount30 = Math.round(eval(form.Item30.value * 67));

 Amount31 = Math.round(eval(form.Item31.value * 49));

 Amount32 = Math.round(eval(form.Item32.value * 38));

 Amount33 = Math.round(eval(form.Item33.value * 67));

 Amount34 = Math.round(eval(form.Item34.value * 50));

 Amount35 = Math.round(eval(form.Item35.value * 19));

 Amount36 = Math.round(eval(form.Item36.value * 79));

 Amount37 = Math.round(eval(form.Item37.value * 79));

 Amount38 = Math.round(eval(form.Item38.value * 139));

 Amount39 = Math.round(eval(form.Item39.value * 56));

 Amount40 = Math.round(eval(form.Item40.value * 35));

 Amount41 = Math.round(eval(form.Item41.value * 250));

 Amount42 = Math.round(eval(form.Item42.value * 5000));

 Amount43 = Math.round(eval(form.Item43.value * 38));

 Amount44 = Math.round(eval(form.Item44.value * 20));

 Amount45 = Math.round(eval(form.Item45.value * 10));

 Amount46 = Math.round(eval(form.Item46.value * 16));

 Amount47 = Math.round(eval(form.Item47.value * 34));

 Amount48 = Math.round(eval(form.Item48.value * 68));

 Amount49 = Math.round(eval(form.Item49.value * 89));





 Subtotaal =(Amount1 + Amount2 + Amount3 + Amount4 + Amount5 + Amount6 + Amount7 + Amount8 + Amount9 + Amount10 + Amount11 + Amount12 + Amount13 + Amount14 + Amount15 + Amount16 + Amount17 + Amount18 + Amount19 + Amount20 + Amount21 + Amount22 + Amount23 + Amount24 + Amount25 + Amount26 + Amount27 + Amount28 + Amount29 + Amount30 + Amount31 + Amount32 + Amount33 + Amount34 + Amount35 + Amount36 + Amount37 + Amount38 + Amount39 + Amount40 + Amount41 + Amount42 + Amount43 + Amount44 + Amount45 + Amount46 + Amount47 + Amount48 + Amount49) ;

 Btw = 0;

 Totala =Subtotaal + Btw;

 form.SubTotal.value = AddDecimal(Subtotaal);
 
 toonUnit(Subtotaal);

}



function ClearForm(form)
{
	form.Item1.value = "";
	
	form.Item2.value = "";
	
	form.Item3.value = "";
	
	form.Item4.value = "";
	
	form.Item5.value = "";
	
	form.Item6.value = "";
	
	form.Item7.value = "";
	
	form.Item8.value = "";
	
	form.Item9.value = "";
	
	form.Item10.value = "";
	
	form.Item11.value = "";
	
	form.Item12.value = "";
	
	form.Item13.value = "";
	
	form.Item14.value = "";
	
	form.Item15.value = "";
	
	form.Item16.value = "";
	
	form.Item17.value = "";
	
	form.Item18.value = "";
	
	form.Item19.value = "";
	
	form.Item20.value = "";
	
	form.Item21.value = "";
	
	form.Item22.value = "";
	
	form.Item23.value = "";
	
	form.Item24.value = "";
	
	form.Item25.value = "";
	
	form.Item26.value = "";
	
	form.Item27.value = "";
	
	form.Item28.value = "";
	
	form.Item29.value = "";
	
	form.Item30.value = "";
	
	form.Item31.value = "";
	
	form.Item32.value = "";
	
	form.Item33.value = "";
	
	form.Item34.value = "";
	
	form.Item35.value = "";
	
	form.Item36.value = "";
	
	form.Item37.value = "";
	
	form.Item38.value = "";
	
	form.Item39.value = "";
	
	form.Item40.value = "";
	
	form.Item41.value = "";
	
	form.Item42.value = "";
	
	form.Item43.value = "";
	
	form.Item44.value = "";
	
	form.Item45.value = "";
	
	form.Item46.value = "";
	
	form.Item47.value = "";
	
	form.Item48.value = "";
		
	form.Item49.value = "";

	Subtotaal = 0;
	
	form.SubTotal.value = 0;
	
	
	Amount1 = 0;
	
	Amount2 = 0;
	
	Amount3 = 0;
	
	Amount4 = 0;
	
	Amount5 = 0;
	
	Amount6 = 0;
	
	Amount7 = 0;
	
	Amount8 = 0;
	
	Amount9 = 0;
	
	Amount10 = 0;
	
	Amount11 = 0;
	
	Amount12 = 0;
	
	Amount13 = 0;
	
	Amount14 = 0;
	
	Amount15 = 0;
	
	Amount16 = 0;
	
	Amount17 = 0;
	
	Amount18 = 0;
	
	Amount19 = 0;
	
	Amount20 = 0;
	
	Amount21 = 0;
	
	Amount22 = 0;
	
	Amount23 = 0;
	
	Amount24 = 0;
	
	Amount25 = 0;
	
	Amount26 = 0;
	
	Amount27 = 0;
	
	Amount28 = 0;
	
	Amount29 = 0;
	
	Amount30 = 0;
	
	Amount31 = 0;
	
	Amount32 = 0;
	
	Amount33 = 0;
	
	Amount34 = 0;
	
	Amount35 = 0;
	
	Amount36 = 0;
	
	Amount37 = 0;
	
	Amount38 = 0;
	
	Amount39 = 0;
	
	Amount40 = 0;
	
	Amount41 = 0;
	
	Amount42 = 0;
	
	Amount43 = 0;
	
	Amount44 = 0;
	
	Amount45 = 0;
	
	Amount46 = 0;
	
	Amount47 = 0;
	
	Subtotaal = 0;

	form.SubTotal.value = 0;

	aanbevolen.innerHTML = "";

}