	q = 0	quant_array = new Array()//	blah blah blah	a = 0	add_array = new Array()	s = 0	select_array = new Array()	select_array[s++] = 'fooforder'		m = 0	multiply_array = new Array()	multiply_array[m++] = 'exchange'	e = 0	extra_array = new Array()	extra_array[e++] = 'add'		//	'that' is the form that we are talking about	function calculate(that) {	//	make sure that the total is reset first		total = 0	//	add up all the things that need multplying out		for (i = 0; i < quant_array.length; i++) {			subtotal = ''			my = eval("that." + quant_array[i])			subtotal = extract(my.options[my.options.selectedIndex].text)	//		if it doesnt look like there is a value, then skip to the next i			if(!subtotal)				continue							qt = eval("that.qty" + quant_array[i])	//		if quanity isnt specified, assume 1			if(!qt)				mult = 1			else				mult =  qt.options[qt.options.selectedIndex].value						total += subtotal*mult		}		for (i = 0; i < select_array.length; i++) {			my = eval("that." + select_array[i])			for (j = 0; j < my.options.length; j++) {				if (my.options[j].selected)					total += extract(my.options[j].text)			}		}				//	add in the straight additions		for (i = 0; i < add_array.length; i++) {			subtotal = ''			my = eval("that." + add_array[i])			subtotal = extract(my.options[my.options.selectedIndex].text)			if(!subtotal)				continue							total += subtotal		}			//	multiply by multiply_array		for (i = 0; i < multiply_array.length; i++) {			subtotal = ''			my = eval("that." + multiply_array[i])			subtotal = my.options[my.options.selectedIndex].value			if(!subtotal)				continue							total = total * subtotal		}			//	add in extras		for (i = 0; i < extra_array.length; i++) {			subtotal = ''			my = eval("that." + extra_array[i])			if(my.type == 'checkbox') {				if(my.checked)					subtotal = extract(my.value)			}							if(!subtotal)				continue						total += subtotal		}				total=parseInt(total)		that.total.value = total	}			function extract(txt) {		c = txt.indexOf('$')		if(c < 0) 			txt = ''		else {			txt = txt.substring(c+1,txt.length)	//	remove commas			comma = txt.indexOf(',')			if(comma) 				txt = txt.substring(0,comma) + "" + txt.substring(comma+1,txt.length)				//	cut at ]			if(txt.indexOf(']') > 0) 				txt = txt.substring(0,txt.indexOf(']'))	//	remove white space			txt *= 1		}		return(txt)	}
