       @startPanel = document.querySelector startPanel
       if @startPanel is undefined then throw new Error "Cannot find start panel"
     else
-      @startPanel = startPanel    
+      @startPanel = startPanel
+      
+    if @useScroller is true
+      @setScroller(@startPanel)                  
     
   # Goes to page, transitionAnimation defines if transition happens or not
   goToPage: (targetPanel, options) =>

    @back = false
    @isTransitioning = false
    @currentPanel.removeEventListener "webkitTransitionEnd", @finishTransition, false

    if @useScroller is true
    
      if @iScrollInstance? then @iScrollInstance.destroy(); @iScrollInstance = null
    
      window.setTimeout =>
        @iScrollInstance = new iScroll(@targetPanel.getElementsByClassName('wrapper')[0].id)        
      , 0

   # displays pages when transiton is false
   displayPage: =>
    @targetPanel.style.display = "block"

      flightViewport.style.height = content.offsetHeight + "px"
    else
      throw new Error "#flight or .content not found."
  
  setScroller: (wrapper) =>
    
      if @iScrollInstance? then @iScrollInstance.destroy(); @iScrollInstance = null
    
      window.setTimeout =>
        @iScrollInstance = new iScroll(wrapper.getElementsByClassName('wrapper')[0].id)        
      , 0
  # detects user agent being used
  detectUserAgent: ->
    userAgent = window.navigator.userAgent
