 
     width  = Math.min(1000, window.screen.width - 20)
     height = Math.min(800, window.screen.height - 30)
-    options = ["toolbar=no", "location=" + (window.opera ? "no" : "yes"),
+    options = ["toolbar=no", "location=" + (if @props.window.opera then "no" else "yes"),
       "directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no",
       "width=" + width, "height=" + height,
       "top="   + (window.screen.height - height) / 2,
       "left="  + (window.screen.width - width)   / 2].join()
-
-    loginWindow = window.open(@urlForLogin(), 'oxlogin', options)
+    loginWindow = @props.window.open(@urlForLogin(), 'oxlogin', options)
     @setState({loginWindow})
     _.delay(@windowClosedCheck, SECOND)
 


  propTypes:
    title: React.PropTypes.string

  getDefaultProps: ->
    title: 'You need to login or signup in order to use ConceptCoach™'

  getInitialState: ->
    loginWindow: false

    User.endpoints.login + '?parent=' + encodeURIComponent(window.location.href)

  loginLink: (msg) ->
    <a data-bypass className='login' onClick={@openLogin} href={@urlForLogin()}>
      {msg}
    </a>

