rem: } 
add: }, 
context:     "DIV.hetero-list-container" : function(e) {        // components for the add button        var menu = document.createElement("SELECT");        var btn = findElementsBySelector(e,"INPUT.hetero-list-add")[0];        YAHOO.util.Dom.insertAfter(menu,btn);        var prototypes = e.lastChild;        while(!Element.hasClassName(prototypes,"prototypes"))            prototypes = prototypes.previousSibling;        var insertionPoint = prototypes.previousSibling;    // this is where the new item is inserted.        // extract templates        var templates = []; var i=0;        for(var n=prototypes.firstChild;n!=null;n=n.nextSibling,i++) {            var name = n.getAttribute("name");            menu.options[i] = new Option(n.getAttribute("title"),""+i);            templates.push({html:n.innerHTML, name:name});        }        Element.remove(prototypes);        var menuButton = new YAHOO.widget.Button(btn, { type: "menu", menu: menu });        menuButton.getMenu().clickEvent.subscribe(function(type,args,value) {            var t = templates[parseInt(args[1].value)]; // where this args[1] comes is a real mystery            var nc = document.createElement("div");            nc.className = "repeated-chunk";            nc.setAttribute("name",t.name);            nc.innerHTML = t.html;            insertionPoint.parentNode.insertBefore(nc, insertionPoint);                        Behaviour.applySubtree(nc);        });    }
meta: 3881	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3881/1a0127eb6f5cef7781d49647a5562e17d94a6875/hudson-behavior.js/buggy/war/resources/scripts/hudson-behavior.js