context: 		function(elem){			// extract formula			var formula = elem.className.substr(elem.className.indexOf('formula=')+8).split(' ')[0];			// [don] Safari 1.2 workaround			var variables = formula.split(/[^a-zA-Z]+/g);//			var variables = formula.split(/[^\w]+/gi);			b.varFields = [];						// process variables, add onchange/onblur event to update total.			for (var i = 0; i < variables.length; i++) {				if(variables[i]!='') {					f.matchAll("*[class*=\""+wFORMS.behaviors.calculation.VARIABLE_SELECTOR_PREFIX+variables[i]+"\"]").forEach(						function(variable){							//console.log('variable:',variable, variable.tagName + ":" + variable.getAttribute('type'));							switch(variable.tagName + ":" + variable.getAttribute('type') ) {								case 'INPUT:':			// (type attribute empty)								case 'INPUT:null': 		// (type attribute missing)								case 'INPUT:text':								case 'INPUT:hidden':								case 'INPUT:password':								case 'TEXTAREA:null':									if(!variable._wforms_calc_handled) {										variable.addEventListener('blur', function(e){ return b.run(e, this)}, false);										variable._wforms_calc_handled = true;									}									break;								case 'INPUT:radio':		 														case 'INPUT:checkbox':									if(!variable._wforms_calc_handled) {										variable.addEventListener('click', function(e){ return b.run(e, this)}, false);										variable._wforms_calc_handled = true;									}									break;											case 'SELECT:null':									if(!variable._wforms_calc_handled) {										variable.addEventListener('change',  function(e){ return b.run(e, this)}, false);										variable._wforms_calc_handled = true;									}									break;										default:									// error: variable refers to a non supported element.									return;									break;							}							b.varFields.push({name: variables[i], field: variable});												}					);							}					}					var calc = { field: elem, formula: formula, variables: b.varFields };					b.calculations.push(calc);				b.compute(calc);		}
meta: 8955	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8955/b4c3f459a214f1abf932ebf4eecf8504548aeec6/wforms_calculation.js/clean/branches/3.0/wforms_calculation.js