         #       Add default texts to NOTIFICATION_MSG for new notification types
 
         selector = ".notification-message-#{type}"
-        @.el = angular.element(selector)
+        el = angular.element(selector)
 
         if title
-           @.el.find("h4").html(title)
+           el.find("h4").html(title)
         else
-           @.el.find("h4").html(NOTIFICATION_MSG[type].title)
+           el.find("h4").html(NOTIFICATION_MSG[type].title)
 
         if message
-            @.el.find("p").html(message)
+            el.find("p").html(message)
         else
-            @.el.find("p").html(NOTIFICATION_MSG[type].message)
+            el.find("p").html(NOTIFICATION_MSG[type].message)
 
         body = angular.element("body")
         body.find(".notification-message .notification-light")

                selected: choicesField.val()
                finish: =>
                    @loading.finish(target)
                    @.hide()
            }

        @.el.on "click.confirm-dialog", "a.button-red", (event) =>
            event.preventDefault()
            defered.reject()
            @.hide()

        @lightboxService.open(@.el)

        return defered.promise

    error: (message) ->
        @.el = angular.element(".lightbox-generic-error")

        # Render content
        @.el.find("h2.title").html(message)
        defered = @q.defer()

        # Assign event handlers
        @.el.on "click.confirm-dialog", "a.button-green", (event) =>
            event.preventDefault()
            defered.resolve()
            @.hide()

        @.el.on "click.confirm-dialog", "a.close", (event) =>
            event.preventDefault()
            defered.resolve()
            @.hide()

        @lightboxService.open(@.el)

        return defered.promise

    success: (message) ->
        @.el = angular.element(".lightbox-generic-success")

        # Render content
        @.el.find("h2.title").html(message)
        defered = @q.defer()

        # Assign event handlers
        @.el.on "click.confirm-dialog", "a.button-green", (event) =>
            event.preventDefault()
            defered.resolve()
            @.hide()

        @.el.on "click.confirm-dialog", "a.close", (event) =>
            event.preventDefault()
            defered.resolve()
            @.hide()

        @lightboxService.open(@.el)

        return defered.promise


    constructor: (@q, @lightboxService, @loading) ->
        _.bindAll(@)

    hide: (el)->
        if el
            @lightboxService.close(el)

            el.off(".confirm-dialog")

    ask: (title, subtitle, lightboxSelector=".lightbox_confirm-delete") ->
        el = angular.element(lightboxSelector)

        # Render content
        el.find("h2.title").html(title)
        el.find("span.subtitle").html(subtitle)
        defered = @q.defer()

        # Assign event handlers
        el.on "click.confirm-dialog", "a.button-green", debounce 2000, (event) =>
            event.preventDefault()
            target = angular.element(event.currentTarget)
            @loading.start(target)
            defered.resolve =>
                @loading.finish(target)
                @.hide(el)

        el.on "click.confirm-dialog", "a.button-red", (event) =>
            event.preventDefault()
            defered.reject()
            @.hide(el)

        @lightboxService.open(el)

        return defered.promise

    askChoice: (title, subtitle, choices, lightboxSelector=".lightbox-ask-choice") ->
        el = angular.element(lightboxSelector)

        # Render content
        el.find("h2.title").html(title)
        el.find("span.subtitle").html(subtitle)
        choicesField = el.find("select.choices")
        choicesField.html('')
        _.each choices, (value, key) ->
            choicesField.append(angular.element("<option value='#{key}'>#{value}</option>"))
        defered = @q.defer()

        # Assign event handlers
        el.on "click.confirm-dialog", "a.button-green", debounce 2000, (event) =>
            event.preventDefault()
            target = angular.element(event.currentTarget)
            @loading.start(target)
