context:   initStacks: function(numStacks, numFoundations, numReserves, hasStock, hasWaste, tableauRows, tableauCols, numCells) {    this.allstacks = [];    var name = this.shortname; // e.g. "klondike", "simon" etc    if(numStacks) {      this.stacks = new Array(numStacks);      for(var i = 0; i < numStacks; i++) {        this.stacks[i] = document.getElementById(name+"-pile-"+i);        this.stacks[i].isPile = true;        this.allstacks.push(this.stacks[i]);      }    }    if(numFoundations==1) {      this.foundation = document.getElementById(name+"-foundation");      this.foundation.isFoundation;      this.allstacks.push(this.foundation);    } else if(numFoundations) {      this.foundations = new Array(numFoundations);      for(var i = 0; i < numFoundations; i++) {        this.foundations[i] = document.getElementById(name+"-foundation-"+i);        this.foundations[i].isFoundation = true;        this.allstacks.push(this.foundations[i]);      }    }    if(numReserves==1) {      this.reserve = document.getElementById(name+"-reserve");      this.reserve.isReserve = true;      this.allstacks.push(this.reserve);    } else if(numReserves) {      this.reserves = new Array(numReserves);      for(var i = 0; i < numReserves; i++) {        this.reserves[i] = document.getElementById(name+"-reserve-"+i);        this.reserves[i].isReserve = true;        this.allstacks.push(this.reserves[i]);      }    }    // XXX should these have .isStock/.isWaste set, or is foo==Game.stock sufficient?    if(hasStock) {      this.stock = document.getElementById(name+"-stock");      this.stock.isStock = true;      this.allstacks.push(this.stock);    }    if(hasWaste) {      this.waste = document.getElementById(name+"-waste");      this.waste.isWaste = true;      this.allstacks.push(this.waste);    }    // create a 2D stacks array    if(tableauRows) {      this.tableau = new Array(tableauRows);      for(var i = 0; i < tableauRows; i++) {        this.tableau[i] = new Array(tableauCols);        for(var j = 0; j < tableauCols; j++) {          var s = document.getElementById(name+"-tableau-"+i+"-"+j);          s.row = i;          s.col = j;          s.isPile = true;          this.tableau[i][j] = s;          this.allstacks.push(s);        }      }    }    // cells    if(numCells) {      this.cells = new Array(numCells);      for(var i = 0; i < numCells; i++) {        this.cells[i] = document.getElementById(name+"-cell-"+i);        this.cells[i].isCell = true;        this.allstacks.push(this.cells[i]);      }    }  },
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/4d80781516102d341ffd92b4e391f5f6730491d2/cardgame.js/clean/cardgame.js