// JavaScript Document
function calculate() {
	
	if (document.images) {
	unitsChart = new Object();
	unitsChart.a = new Array("1","1","1","1","2","2","2","2","2","2"); <!--less than 50 people
	unitsChart.b = new Array("2","2","2","2","2","3","3","3","3","3"); <!--100 people
	unitsChart.c = new Array("3","3","3","3","4","4","4","6","6","6"); <!--250 people
	unitsChart.d = new Array("4","4","4","4","6","6","8","8","8","8"); <!--500 people
	unitsChart.e = new Array("4","5","6","7","7","8","8","8","9","9"); <!--1,000 people
	unitsChart.f = new Array("6","9","11","13","14","14","15","15","16","16"); <!--2,000 people
	unitsChart.g = new Array("9","14","17","19","21","22","22","23","23","24"); <!--3,000 people
	unitsChart.h = new Array("12","18","23","26","28","29","30","31","31","32"); <!--4,000 people
	unitsChart.i = new Array("15","23","28","32","35","36","37","39","39","40"); <!--5,000 people
	unitsChart.j = new Array("18","28","34","39","41","43","44","46","47","48"); <!--6,000 people
	unitsChart.k = new Array("21","32","40","45","48","51","52","54","55","57"); <!--7,000 people
	unitsChart.l = new Array("24","37","46","51","55","58","59","62","62","65"); <!--8,000 people
	unitsChart.m = new Array("30","46","57","64","69","72","74","77","78","81"); <!--10,000 people
	unitsChart.n = new Array("44","69","85","96","104","108","111","116","117","121"); <!--15,000 people
	unitsChart.o = new Array("59","92","114","128","138","144","148","155","156","162"); <!--20,000 people
	unitsChart.p = new Array("89","138","171","193","207","217","222","232","234","242"); <!--30,000 people
	unitsChart.q = new Array("118","184","228","257","276","289","296","310","312","323"); <!--40,000 people
	unitsChart.r = new Array("148","229","285","321","345","361","371","387","389","404"); <!--50,000 people
	unitsChart.s = new Array("222","344","427","482","518","541","556","581","584","606"); <!--75,000 people
	unitsChart.t = new Array("296","459","570","642","691","722","741","774","779","808"); <!--100,000 people
	}

	if (document.images) {
		attenders = document.calculator.attending.selectedIndex;
		theHours = document.calculator.duration.selectedIndex;
		units = new Object();
		if (attenders == 1) {
   			units = unitsChart.a;
		} else if (attenders == 2) {
   			units = unitsChart.b;
		} else if (attenders == 3) {
   			units = unitsChart.c;
		} else if (attenders == 4) {
   			units = unitsChart.d;
		} else if (attenders == 5) {
   			units = unitsChart.e;
		} else if (attenders == 6) {
   			units = unitsChart.f;
		} else if (attenders == 7) {
   			units = unitsChart.g;
		} else if (attenders == 8) {
   			units = unitsChart.h;
		} else if (attenders == 9) {
   			units = unitsChart.i;
		} else if (attenders == 10) {
   			units = unitsChart.j;
		} else if (attenders == 11) {
   			units = unitsChart.k;
		} else if (attenders == 12) {
   			units = unitsChart.l;
		} else if (attenders == 13) {
   			units = unitsChart.m;
		} else if (attenders == 14) {
   			units = unitsChart.n;
		} else if (attenders == 15) {
   			units = unitsChart.o;
		} else if (attenders == 16) {
   			units = unitsChart.p;
		} else if (attenders == 17) {
   			units = unitsChart.q;
		} else if (attenders == 18) {
   			units = unitsChart.r;
		} else if (attenders == 19) {
   			units = unitsChart.s;
		} else if (attenders == 20) {
   			units = unitsChart.t;
		} else {
			document.calculator.num_required.value = "Call For Estimate";
		}
		var toiletCount = Number(toiletCount);
		var theHours = Number(theHours);
		toiletCount = units[theHours];
		if (document.calculator.women[1].checked) {
			toiletCount = toiletCount * 1;
		} else {
			toiletCount = toiletCount * 1.13;
		}
		if (document.calculator.alcohol[1].checked) {
			toiletCount = toiletCount * 1;
		} else {
			toiletCount = toiletCount * 1.13;
		}
		toiletCount = Math.round(toiletCount);
		document.calculator.num_required.value = toiletCount;
		
	} else {
		alert("Can not calculate. Please enable Javascript.");
	}
}