Fixed bug where currIndex was being set locally, not globally. ALWAYS set window.currIndex, not just currIndex. Thanks coffeescript.