rem: var elements = wFORMS.behaviors['switch'].getElementsBySwitchName(switches_ON[i]); 
add: var elements = wFORMS.behaviors['switch'].getElementsBySwitchName(switches_ON[i], formId); 
context:            run: function(e) {                var element   = wFORMS.helpers.getSourceElement(e);				if(!element) element = e;			    //wFORMS.debug('switch/run: ' + element.id , 5);					var switches_ON  = new Array();				var switches_OFF = new Array();								// Get list of triggered switches (some ON, some OFF)				switch(element.tagName.toUpperCase()) {					case 'SELECT':						for(var i=0;i<element.options.length;i++) {							if(i==element.selectedIndex) {									switches_ON  = switches_ON.concat(wFORMS.behaviors['switch'].getSwitchNames(element.options[i]));							} else {								switches_OFF = switches_OFF.concat(wFORMS.behaviors['switch'].getSwitchNames(element.options[i]));							}						}						break;					case 'INPUT':						if(element.type.toLowerCase() == 'radio') {							// Go through the radio group.														for(var i=0;i <element.form[element.name].length;i++) { 								var radioElement = element.form[element.name][i];								if(radioElement.checked) {									switches_ON  = switches_ON.concat(wFORMS.behaviors['switch'].getSwitchNames(radioElement));								} else {									//wFORMS.debug(wFORMS.behaviors['switch'].getSwitchNames(radioElement).length,1);									switches_OFF = switches_OFF.concat(wFORMS.behaviors['switch'].getSwitchNames(radioElement));								}							}						} else {							if(element.checked || wFORMS.helpers.hasClass(element, wFORMS.className_switchIsOn)) {								switches_ON  = switches_ON.concat(wFORMS.behaviors['switch'].getSwitchNames(element));							} else {								switches_OFF = switches_OFF.concat(wFORMS.behaviors['switch'].getSwitchNames(element));							}													}						break;					default:						break;				}								// Turn off switches first				for(var i=0; i < switches_OFF.length; i++) {					// Go through all targets of the switch 					var elements = wFORMS.behaviors['switch'].getElementsBySwitchName(switches_OFF[i]);					for(var j=0;j<elements.length;j++) {																															// only turn off a target if all its triggers are off						var triggers = wFORMS.switchTriggers[switches_OFF[i]];																		var doSwitch = true;													for (var k=0; k < triggers.length; k++) {							var trigger = document.getElementById(triggers[k]);							if(wFORMS.behaviors['switch'].isTriggerOn(trigger, switches_OFF[i])) {								// An element with the REPEAT behavior limits the scope of switches 								// targets outside of the scope of the switch are not affected. 								if(wFORMS.behaviors['switch'].isWithinSwitchScope(trigger, elements[j])) {									// one of the trigger is still ON. no switch off									doSwitch = false;								}							}													}						if(doSwitch) {							wFORMS.behaviors['switch'].switchState(elements[j], wFORMS.classNamePrefix_onState, wFORMS.classNamePrefix_offState);						}					}				}				// Turn on				for(var i=0; i < switches_ON.length; i++) {					var elements = wFORMS.behaviors['switch'].getElementsBySwitchName(switches_ON[i]);					for(var j=0;j<elements.length;j++) {						// An element with the REPEAT behavior limits the scope of switches 						// targets outside of the scope of the switch are not affected. 						if(wFORMS.behaviors['switch'].isWithinSwitchScope(element, elements[j])) {							wFORMS.behaviors['switch'].switchState(elements[j], wFORMS.classNamePrefix_offState, wFORMS.classNamePrefix_onState);							//wFORMS.debug('switch/run: [turn on ' + switches_ON[i] + '] ' + elements[j].id , 3);							}					}				}           },
meta: 8955	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8955/6de8188e214da9dfbd3dbaa370c6a8570ee2d380/wforms_switch.js/clean/trunk/src/wforms_switch.js