rem: to = to.lastChild || to; 
add: to = to.lastChild || to; 
context: function init() {  gCmdUndo = document.getElementById("cmd:undo");  gCmdNewGame = document.getElementById("cmd:newgame");  gCmdRestartGame = document.getElementById("cmd:restart");  gCmdHint = document.getElementById("cmd:hint");  gCmdRedeal = document.getElementById("cmd:redeal");  gCmdSetDifficulty = document.getElementById("cmd:setdifficulty");  gOptionsMenu = document.getElementById("options-menu");  gDifficultyLevelMenu = document.getElementById("game-difficulty-menu");  gDifficultyLevelPopup = document.getElementById("game-difficulty-popup");  gGameSelector = document.getElementById("game-type-menu");  gGameWonMsg = document.getElementById("game-won-msg-box");  gScoreDisplay = document.getElementById("score-display");  // init the pref branch  gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService)  gPrefs = gPrefs.getBranch("games.cards.");  // load stringbundle  var svc = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);  var bundle = svc.createBundle("chrome://cards/locale/cards.properties").getSimpleEnumeration();  while(bundle.hasMoreElements()) {    var property = bundle.getNext().QueryInterface(Components.interfaces.nsIPropertyElement);    gStrings[property.key] = property.value;  }  // restore choice of cardset  var cardset = "normal";  try {    cardset = gPrefs.getCharPref("cardset");  } catch(e) {}  useCardSet(cardset);  document.getElementById("cardset-"+cardset).setAttribute("checked","true");  gGameStack = document.getElementById("games");  gGameStackTop = gGameStack.boxObject.y;  gGameStackLeft = gGameStack.boxObject.x;  // 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");  // init other stuff  initMouseHandlers();  CardMover1.init();  CardMover2.init();  gHintHighlighter = createHighlighter();  gHintHighlighter.showHint = function(from, to) {    to = to.lastChild || to; // |to| could be a stack    disableUI();    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();enableUI();}, 800);  };  // build the games menu  var menu = document.getElementById("menupopup-gametypes");  var names = [];  var lookup = [];  var name, game;  for(game in Games) {    name = gStrings[game+".name"];    names.push(name);    lookup[name] = game;  }  names.sort();  for(var i in names) {    name = names[i], game = lookup[name];    var mi = document.createElement("menuitem");    mi.setAttribute("label",names[i]);    mi.setAttribute("accesskey",gStrings[game+".menukey"]);    mi.value = game;    menu.appendChild(mi);  }  // switch to last played game  game = "klondike";  try {    game = gPrefs.getCharPref("current-game");  } catch(e) {}  if(!(game in Games)) game = "klondike"; // just in case pref gets corrupted  Game = Games[game];  Game.start();  // set window title. (setting window.title does not work while the app. is starting)  document.documentElement.setAttribute("title",gStrings[game+".name"]);}
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/15f3df693ddf02fb9ee6a2662189220868368b23/cardslib.js/clean/cardslib.js