rem: var classNames = child.className.split(' '); for (var j=0;j<classNames.length;j++) { 
add: var classNames = child.className.split(' '); for (var j=0;j<classNames.length;j++) { 
context: Freja.View.prototype._connectBehavior = function(destination) {	try {		var connectCallback = function(node, eventType, callback) {			Freja._aux.connect(node, eventType, Freja._aux.bind(				function(e) {					var allow = false;					try {						allow = callback(this);					} catch (ex) {						throw new Error("An error ocurred in user handler.\n" + ex.message);					} finally {						if (!allow) {							e.stop();						}					}				}, node)			);		};		var applyHandlers = function(node, behaviors) {			for (var i = 0, c = node.childNodes, l = c.length; i < l; ++i) {				var child = c[i];				if (child.nodeType == 1) {					if(child.className) {						var classNames = child.className.split(' ');												for (var j=0;j<classNames.length;j++) {																		var handler = behaviors[classNames[j]];							if (handler) {								for (var eventType in handler) {									if (eventType == "init") {										handler.init(child);									} else {										connectCallback(child, eventType, handler[eventType]);									}								}							}						}					}					applyHandlers(child, behaviors);				}			}		};		// Avoid traversing the DOM tree if there's no handler to process.		// @note: is there a better way? this.behaviors.length is always 0.		// @note  This is fine. behaviors is a hashmap, not an array.		for (var ids in this.behaviors) {			applyHandlers(destination, this.behaviors);			break;		}	} catch (ex) {		alert(ex.message);	}};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/8b42fb2ed090da7f1e336726dcb69d2649658e7c/Freja.js/clean/trunk/lib/Freja.js