				// form 1
				function doComma() {
					obj = document.form1.gtotala.value;
					j = obj.indexOf(".");
					if (j == -1) j= obj.length;
						k = Math.floor(j/3);
						r = j - k * 3;
						num1='';
				  		if (k > 0) {
				     			if (r > 0) num1 = obj.substring(0,r)+',';
				     				for (i=1; i < k; i++){
									num1 = num1 + obj.substring(r,r+3)+',';
				        				r = r +3;
			       				}
			  				num1 = num1 + obj.substring(r);
				  		}
				  	else num1=obj;
					document.form1.gtotala.value = num1;
				}
				function doA() {
					taa = document.form1.aa.value;
					tab = document.form1.ab.value;
					tac = document.form1.ac.options[document.form1.ac.selectedIndex].value;
					tac = (tac / 12);
					preatotal = ((taa * tab * tac)/27);
					preatotal=Math.round(preatotal*100)/100  
					document.form1.atotal.value = preatotal;
					var gtotala = document.form1.atotal.value * 1;
					var gtotalb = document.form1.btotal.value * 1;
					var gtotalc = document.form1.ctotal.value * 1;
					var gtotald = document.form1.dtotal.value * 1;
					var gtotale = document.form1.etotal.value * 1;
					pregtotala = (gtotala + gtotalb + gtotalc + gtotald + gtotale);
					pregtotala=Math.round(pregtotala*100)/100  
					document.form1.gtotala.value = pregtotala;
					doComma();
				}
				function doB() {
					tba = document.form1.ba.value;
					tbb = document.form1.bb.value;
					tbc = document.form1.bc.options[document.form1.bc.selectedIndex].value;
					tbc = (tbc / 12);
					prebtotal = ((tba * tbb * tbc)/27);
					prebtotal=Math.round(prebtotal*100)/100
					document.form1.btotal.value = prebtotal;
					var gtotala = document.form1.atotal.value * 1;
					var gtotalb = document.form1.btotal.value * 1;
					var gtotalc = document.form1.ctotal.value * 1;
					var gtotald = document.form1.dtotal.value * 1;
					var gtotale = document.form1.etotal.value * 1;
					pregtotala = (gtotala + gtotalb + gtotalc + gtotald + gtotale);
					pregtotala=Math.round(pregtotala*100)/100  
					document.form1.gtotala.value = pregtotala;
					doComma();
				}
				function doC() {
					tca = document.form1.ca.value;
					tcb = document.form1.cb.value;
					tcc = document.form1.cc.options[document.form1.cc.selectedIndex].value;
					tcc = (tcc / 12);
					prectotal = ((tca * tcb * tcc)/27);
					prectotal=Math.round(prectotal*100)/100
					document.form1.ctotal.value = prectotal;
					var gtotala = document.form1.atotal.value * 1;
					var gtotalb = document.form1.btotal.value * 1;
					var gtotalc = document.form1.ctotal.value * 1;
					var gtotald = document.form1.dtotal.value * 1;
					var gtotale = document.form1.etotal.value * 1;
					pregtotala = (gtotala + gtotalb + gtotalc + gtotald + gtotale);
					pregtotala=Math.round(pregtotala*100)/100  
					document.form1.gtotala.value = pregtotala;
					doComma();
				}
				function doD() {
					tda = document.form1.da.value;
					tdb = document.form1.db.value;
					tdc = document.form1.dc.options[document.form1.dc.selectedIndex].value;
					tdc = (tdc / 12);
					predtotal = ((tda * tdb * tdc)/27);
					predtotal=Math.round(predtotal*100)/100
					document.form1.dtotal.value = predtotal;
					var gtotala = document.form1.atotal.value * 1;
					var gtotalb = document.form1.btotal.value * 1;
					var gtotalc = document.form1.ctotal.value * 1;
					var gtotald = document.form1.dtotal.value * 1;
					var gtotale = document.form1.etotal.value * 1;
					pregtotala = (gtotala + gtotalb + gtotalc + gtotald + gtotale);
					pregtotala=Math.round(pregtotala*100)/100  
					document.form1.gtotala.value = pregtotala;
					doComma();
				}
				function doE() {
					tea = document.form1.ea.value;
					teb = document.form1.eb.value;
					tec = document.form1.ec.options[document.form1.ec.selectedIndex].value;
					tec = (tec / 12);
					preetotal = ((tea * teb * tec)/27);
					preetotal=Math.round(preetotal*100)/100
					document.form1.etotal.value = preetotal
					var gtotala = document.form1.atotal.value * 1;
					var gtotalb = document.form1.btotal.value * 1;
					var gtotalc = document.form1.ctotal.value * 1;
					var gtotald = document.form1.dtotal.value * 1;
					var gtotale = document.form1.etotal.value * 1;
					pregtotala = (gtotala + gtotalb + gtotalc + gtotald + gtotale);
					pregtotala=Math.round(pregtotala*100)/100  
					document.form1.gtotala.value = pregtotala;
					doComma();
				}



				// form 2
				function doCommaB() {
					obj = document.form2.gtotala2.value;
					j = obj.indexOf(".");
					if (j == -1) j= obj.length;
						k = Math.floor(j/3);
						r = j - k * 3;
						num1='';
				  		if (k > 0) {
				     			if (r > 0) num1 = obj.substring(0,r)+',';
				     				for (i=1; i < k; i++){
									num1 = num1 + obj.substring(r,r+3)+',';
				        				r = r +3;
			       				}
			  				num1 = num1 + obj.substring(r);
				  		}
				  	else num1=obj;
					document.form2.gtotala2.value = num1;
				}
				function doAA() {
					taa2 = document.form2.aa2.value;
					tab2 = document.form2.ab2.options[document.form2.ab2.selectedIndex].value;
					prea2total = (((taa2*tab2)/12)/27);
					prea2total=Math.round(prea2total*100)/100
					document.form2.a2total.value = prea2total;
					var gtotala2 = document.form2.a2total.value * 1;
					var gtotalb2 = document.form2.b2total.value * 1;
					var gtotalc2 = document.form2.c2total.value * 1;
					var gtotald2 = document.form2.d2total.value * 1;
					var gtotale2 = document.form2.e2total.value * 1;
					pretotalgb = (gtotala2 + gtotalb2 + gtotalc2 + gtotald2 + gtotale2);
					pretotalgb=Math.round(pretotalgb*100)/100  
					document.form2.gtotala2.value = pretotalgb;
					doCommaB();
				}
				function doAB() {
					tba2 = document.form2.ba2.value;
					tbb2 = document.form2.bb2.options[document.form2.bb2.selectedIndex].value;
					preb2total = (((tba2*tbb2)/12)/27);
					preb2total=Math.round(preb2total*100)/100
					document.form2.b2total.value = preb2total
					var gtotala2 = document.form2.a2total.value * 1;
					var gtotalb2 = document.form2.b2total.value * 1;
					var gtotalc2 = document.form2.c2total.value * 1;
					var gtotald2 = document.form2.d2total.value * 1;
					var gtotale2 = document.form2.e2total.value * 1;
					pretotalgb = (gtotala2 + gtotalb2 + gtotalc2 + gtotald2 + gtotale2);
					pretotalgb=Math.round(pretotalgb*100)/100  
					document.form2.gtotala2.value = pretotalgb;
					doCommaB();
				}
				function doAC() {
					tca2 = document.form2.ca2.value;
					tcb2 = document.form2.cb2.options[document.form2.cb2.selectedIndex].value;
					prec2total = (((tca2*tcb2)/12)/27);
					prec2total=Math.round(prec2total*100)/100
					document.form2.c2total.value = prec2total
					var gtotala2 = document.form2.a2total.value * 1;
					var gtotalb2 = document.form2.b2total.value * 1;
					var gtotalc2 = document.form2.c2total.value * 1;
					var gtotald2 = document.form2.d2total.value * 1;
					var gtotale2 = document.form2.e2total.value * 1;
					pretotalgb = (gtotala2 + gtotalb2 + gtotalc2 + gtotald2 + gtotale2);
					pretotalgb=Math.round(pretotalgb*100)/100  
					document.form2.gtotala2.value = pretotalgb;
					doCommaB();
				}
				function doAD() {
					tda2 = document.form2.da2.value;
					tdb2 = document.form2.db2.options[document.form2.db2.selectedIndex].value;
					pred2total = (((tda2*tdb2)/12)/27);
					pred2total=Math.round(pred2total*100)/100
					document.form2.d2total.value = pred2total
					var gtotala2 = document.form2.a2total.value * 1;
					var gtotalb2 = document.form2.b2total.value * 1;
					var gtotalc2 = document.form2.c2total.value * 1;
					var gtotald2 = document.form2.d2total.value * 1;
					var gtotale2 = document.form2.e2total.value * 1;
					pretotalgb = (gtotala2 + gtotalb2 + gtotalc2 + gtotald2 + gtotale2);
					pretotalgb=Math.round(pretotalgb*100)/100  
					document.form2.gtotala2.value = pretotalgb;
					doCommaB();
				}
				function doAE() {
					tea2 = document.form2.ea2.value;
					teb2 = document.form2.eb2.options[document.form2.eb2.selectedIndex].value;
					pree2total = (((tea2*teb2)/12)/27);
					pree2total=Math.round(pree2total*100)/100
					document.form2.e2total.value = pree2total
					var gtotala2 = document.form2.a2total.value * 1;
					var gtotalb2 = document.form2.b2total.value * 1;
					var gtotalc2 = document.form2.c2total.value * 1;
					var gtotald2 = document.form2.d2total.value * 1;
					var gtotale2 = document.form2.e2total.value * 1;
					pretotalgb = (gtotala2 + gtotalb2 + gtotalc2 + gtotald2 + gtotale2);
					pretotalgb=Math.round(pretotalgb*100)/100  
					document.form2.gtotala2.value = pretotalgb;
					doCommaB();
				}


				// form 3
				function doCommac() {
					obj = document.form3.e3total.value;
					j = obj.indexOf(".");
					if (j == -1) j= obj.length;
						k = Math.floor(j/3);
						r = j - k * 3;
						num1='';
				  		if (k > 0) {
				     			if (r > 0) num1 = obj.substring(0,r)+',';
				     				for (i=1; i < k; i++){
									num1 = num1 + obj.substring(r,r+3)+',';
				        				r = r +3;
			       				}
			  				num1 = num1 + obj.substring(r);
				  		}
				  	else num1=obj;
					document.form3.e3total.value = num1;
				}
				function DoRolls() {
					pree3total = (document.form3.sqfoot.value / 150);
					pree3total=Math.round(pree3total*100)/100
					document.form3.e3total.value = pree3total
					doCommac()
				}

				// form 4
				function doCommad() {
					obj = document.form4.e4total.value;
					j = obj.indexOf(".");
					if (j == -1) j= obj.length;
						k = Math.floor(j/3);
						r = j - k * 3;
						num1='';
				  		if (k > 0) {
				     			if (r > 0) num1 = obj.substring(0,r)+',';
				     				for (i=1; i < k; i++){
									num1 = num1 + obj.substring(r,r+3)+',';
				        				r = r +3;
			       				}
			  				num1 = num1 + obj.substring(r);
				  		}
				  	else num1=obj;
					document.form4.e4total.value = num1;
				}
				function DoRollsCu() {
					pree4total = (document.form4.thenumb.value * 0.67);
					pree4total=Math.round(pree4total*100)/100
					document.form4.e4total.value = pree4total
					doCommad()
				}