 
   constructor:(options = {}, data)->
 
-    {entryPoint} = KD.config
-    options.cssClass = 'hidden'
+    options.cssClass = 'login-screen login'
 
     super options, data
 
-    @setCss 'background-image', "url('../a/images/unsplash/#{backgroundImageNr}.jpg')"
-
-    @hidden = yes
-
-    handler =(route, event)=>
-      stop event
-      KD.getSingleton('router').handleRoute route, {entryPoint}
-
-    homeHandler     = handler.bind null, '/'
-    loginHandler    = handler.bind null, '/Login'
-    registerHandler = handler.bind null, '/Register'
-    recoverHandler  = handler.bind null, '/Recover'
-
     @logo = new KDCustomHTMLView
-      tagName   : "a"
-      cssClass  : "koding-logo"
-      partial   : '<cite></cite>'
-      click     : (event)->
-        KD.utils.stopDOMEvent event
-        homeHandler()
-
-    @backToLoginLink = new KDCustomHTMLView
-      tagName     : "a"
-      partial     : "Sign In"
+      tagName    : 'a'
+      cssClass   : 'koding-logo'
+      partial    : '<cite></cite>'
+      attributes : href : '/'
+
+    @backToLoginLink = new CustomLinkView
+      title       : 'Sign In'
+      href        : '/Login'
       click       : ->
-        KD.mixpanel "Login button form in /Login, click"
-        loginHandler()
-
-
-    @goToRecoverLink = new KDCustomHTMLView
-      tagName     : "a"
-      cssClass    : "forgot-link"
-      partial     : "Forgot your password?"
-      testPath    : "landing-recover-password"
-      click       : recoverHandler
-
-    @goToRegisterLink = new KDCustomHTMLView
-      tagName     : "a"
-      partial     : "Sign up"
-      click       : ->
-        KD.mixpanel "Register button form in /Login, click"
-        registerHandler()
-
-    @formHeader      = new KDCustomHTMLView
+        KD.mixpanel 'Login button form in /Login, click'
+
+    @goToRecoverLink = new CustomLinkView
+      cssClass    : 'forgot-link'
+      title       : 'Forgot your password?'
+      testPath    : 'landing-recover-password'
+      href        : '/Recover'
+
+    @goToRegisterLink = new CustomLinkView
+      title       : 'Sign up'
+      href        : '/Register'
+
+    @formHeader = new KDCustomHTMLView
       tagName     : "h4"
       cssClass    : "form-header"
+      click       : (event)->
+        return  unless $(event.target).is 'a.register'
+        KD.mixpanel 'Register button form in /Login, click'
 
     if KD.utils.oauthEnabled() is yes
       @github          = new KDCustomHTMLView


    KD.getSingleton('router').clear @getRouteWithEntryPoint 'Register'
    $('body').removeClass 'recovery'
    @show =>
      @animateToForm "register"
      @$('.flex-wrapper').addClass 'taller'
      KD.getSingleton('mainController').emit 'InvitationReceived', invite

  hide:(callback)->

    @$('.flex-wrapper').removeClass 'expanded'
    @emit "LoginViewHidden"
    @setClass 'hidden'
    callback?()

  show:(callback)->

    @unsetClass 'hidden'
    @emit "LoginViewShown"
    @hidden = no
    callback?()

  # click:(event)->


  viewAppended:->


    @setTemplate @pistachio()
    @template.update()
