rem: for(var i = 0; i < node.childNodes.length; i++) replaceIds(newId, old, node.childNodes[i]); 
add: for(var i = 0; i != node.childNodes.length; i++) replaceIds(newId, old, node.childNodes[i]); 
context:   initXulElement: function() {    if(!this.layout || this.layout==this.id) { this.xulElement = document.getElementById(this.id); return; }    function replaceIds(newId, old, node) {      if(node.id) node.id = newId + node.id.substring(old.length);      for(var i = 0; i < node.childNodes.length; i++) replaceIds(newId, old, node.childNodes[i]);    }    // if it uses the same layout as another game then clone that layout and fix the ids in the clone (so initPiles() works)    var elt = this.xulElement = document.getElementById(this.layout).cloneNode(true);    replaceIds(this.id, this.layout, elt);    gGameStack.insertBefore(elt, gGameStack.firstChild);  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/15f3df693ddf02fb9ee6a2662189220868368b23/cardgame.js/buggy/cardgame.js