rem: for(var game in Games) Games[game] = new GameController(game, Games[game]); 
add: for(var game in Games) Games[game] = new GameControllerObj(game, Games[game]); 
context: function init() {  const things = ["gCmdNewGame","gCmdRestartGame","gCmdUndo","gCmdRedo","gCmdHint",      "gCmdRedeal","gMessageBox","gMessageLine1","gMessageLine2","gOptionsMenu",      "gGameSelector","gScoreDisplay","gGameStack","gGameMenuPopup"];  for(var i = 0; i != things.length; ++i) {    var thing = things[i];    window[thing] = document.getElementById(window[thing]);  }  gGameStackTop = gGameStack.boxObject.y;  gGameStackLeft = gGameStack.boxObject.x;  createFloatingPile();  // init the pref branch  gPrefs = CC["@mozilla.org/preferences-service;1"]      .getService(CI.nsIPrefService).getBranch("games.cards.");  // load stringbundle  var svc = CC["@mozilla.org/intl/stringbundle;1"].getService(CI.nsIStringBundleService);  var bundle = svc.createBundle("chrome://cards/locale/cards.properties").getSimpleEnumeration();  while(bundle.hasMoreElements()) {    var property = bundle.getNext().QueryInterface(CI.nsIPropertyElement);    gStrings[property.key] = property.value;  }  // restore choice of cardset  try { var cardset = gPrefs.getCharPref("cardset"); }  catch(e) { cardset = "normal"; }  useCardSet(cardset);  document.getElementById("cardset-"+cardset).setAttribute("checked","true");  // restore animation pref  var useAnimation = true;  try { useAnimation = gPrefs.getBoolPref("use-animation"); } catch(e) {}  enableAnimation(useAnimation);  var animationMenuItem = document.getElementById("animation");  if(useAnimation) animationMenuItem.setAttribute("checked","true");  else animationMenuItem.removeAttribute("checked");  gHintHighlighter = createHighlighter();  gHintHighlighter.showHint = function(from, to) {    to = to.lastChild || to; // |to| could be a pile    this.highlight(from);    var thisthis = this; // because |this| within these functions would refer to the wrong thing    setTimeout(function(){thisthis.highlight(to);}, 350);    setTimeout(function(){thisthis.unhighlight();}, 800);  };  gGameStack.addEventListener("click", handleMouseClick, false);  gGameStack.addEventListener("mousedown", handleMouseDown, false);  // Fx 20050623 on Mac only produces an Up event with .ctrlKey true for right-  // clicks (no down or click events), so it's easiest to do all right-click  // detection this way. NB: middle-click only gives a click event (no up/down).  gGameStack.oncontextmenu = handleRightClick;  // make controllers for each game type  for(var game in Games) Games[game] = new GameController(game, Games[game]);  // work out which game was played last  game = "klondike";  try { game = gPrefs.getCharPref("current-game"); } catch(e) {}  if(!(game in Games)) game = "klondike"; // just in case pref gets corrupted  // build the games menu  var gamesInMenu = ["freecell","fan","divorce","gypsy","klondike","mod3","penguin","pileon",      "russiansol","simon","spider","spider-2suits","unionsquare","whitehead","wasp","yukon"];  try { gamesInMenu = gPrefs.getCharPref("gamesInMenu").split(","); } catch(e) {}  buildGamesMenu(gamesInMenu, game);  // document.title works in Fx 1.1, setAttribute works in Fx 1.0 official  document.title = gStrings["game."+game];  document.documentElement.setAttribute("title", gStrings["game."+game]);  // switch to the last game played  GameController = Games[game];  GameController.switchTo();  updateUI();}
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/9c50ed94fb7a3278a429c697fad783c8a4c23b9b/cardslib.js/clean/cardslib.js