add: if(!wFORMS.processedForm || !wFORMS.processedForm.id) var formId = "undefined"; else var formId = wFORMS.processedForm.id; 
context: 		   evaluate: function(node) {               			    // Handle Switch Triggers				// add event handles and populate the wFORMS.switchTriggers 				// associative array (switchname->element Ids)				// ------------------------------------------------------------------------------------------								if (wFORMS.helpers.hasClassPrefix(node, wFORMS.classNamePrefix_switch)) {					if(!node.id) node.id = wFORMS.helpers.randomId();										//wFORMS.debug('switch/evaluate: '+ node.className + ' ' + node.tagName);										// Go through each class (one element can have more than one switch trigger).					var switchNames = wFORMS.behaviors['switch'].getSwitchNames(node);					for(var i=0; i < switchNames.length; i++) {						if(!wFORMS.switchTriggers[switchNames[i]]) 							wFORMS.switchTriggers[switchNames[i]] = new Array();						if(!wFORMS.switchTriggers[switchNames[i]][node.id])							wFORMS.switchTriggers[switchNames[i]].push(node.id);						//wFORMS.debug('switch/evaluate: [trigger] '+ switchNames[i] + ' ' + node.id,3);					}					switch(node.tagName.toUpperCase()) {													case "OPTION":							// get the SELECT element							var selectNode = node.parentNode;							while(selectNode && selectNode.tagName.toUpperCase() != 'SELECT') {								var selectNode = selectNode.parentNode;							}							if(!selectNode) { alert('Error: invalid markup in SELECT field ?'); return false;  } // invalid markup							if(!selectNode.id) selectNode.id = wFORMS.helpers.randomId();							// Make sure we have only one event handler for the select.							if(!selectNode.getAttribute('rel') || selectNode.getAttribute('rel').indexOf('wfHandled')==-1) {								//wFORMS.debug('switch/add event: '+ selectNode.className + ' ' + selectNode.tagName);								selectNode.setAttribute('rel', (selectNode.getAttribute('rel')||"") + ' wfHandled');								wFORMS.helpers.addEvent(selectNode, 'change', wFORMS.behaviors['switch'].run);							}														break;						case "INPUT":														if(node.type && node.type.toLowerCase() == 'radio') {								// Add the onclick event on radio inputs of the same group								var formElement = node.form;									for (var j=0; j<formElement[node.name].length; j++) {									var radioNode = formElement[node.name][j];									// prevents conflicts with elements with an id = name of radio group									if(radioNode.type.toLowerCase() == 'radio') {										// Make sure we have only one event handler for this radio input.										if(!radioNode.getAttribute('rel') || radioNode.getAttribute('rel').indexOf('wfHandled')==-1) {																			wFORMS.helpers.addEvent(radioNode, 'click', wFORMS.behaviors['switch'].run);											// flag the node 											radioNode.setAttribute('rel', (radioNode.getAttribute('rel')||"") + ' wfHandled');										} 									}								}							} else {								wFORMS.helpers.addEvent(node, 'click', wFORMS.behaviors['switch'].run);							}							break;												default:									wFORMS.helpers.addEvent(node, 'click', wFORMS.behaviors['switch'].run);							break;					}				}								// Push targets in the wFORMS.switchTargets array 				// (associative array with switchname -> element ids)				// ------------------------------------------------------------------------------------------				if (wFORMS.helpers.hasClassPrefix(node, wFORMS.classNamePrefix_offState) ||				    wFORMS.helpers.hasClassPrefix(node, wFORMS.classNamePrefix_onState)) {										if(!node.id) node.id = wFORMS.helpers.randomId();										// Go through each class (one element can be the target of more than one switch).					var switchNames = wFORMS.behaviors['switch'].getSwitchNames(node);										for(var i=0; i < switchNames.length; i++) {						if(!wFORMS.switchTargets[switchNames[i]]) 							wFORMS.switchTargets[switchNames[i]] = new Array();						if(!wFORMS.switchTargets[switchNames[i]][node.id]) 							wFORMS.switchTargets[switchNames[i]].push(node.id);						//wFORMS.debug('switch/evaluate: [target] '+ switchNames[i],3);					}														}								if(node.tagName && node.tagName.toUpperCase()=='FORM') {					// function to be called when all behaviors for this form have been applied					//wFORMS.debug('switch/push init');					wFORMS.onLoadComplete.push(wFORMS.behaviors['switch'].init); 				}           },
meta: 8955	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8955/6de8188e214da9dfbd3dbaa370c6a8570ee2d380/wforms_switch.js/clean/trunk/src/wforms_switch.js