 
     close: (id) ->
         if not id
-            $lastVexContent = vex.getAllVexes().last()
-            return false unless $lastVexContent.length
-            id = $lastVexContent.data().vex.id
+            $lastVex = vex.getAllVexes().last()
+            return false unless $lastVex.length
+            id = $lastVex.data().vex.id
 
         return vex.closeByID id
 

    defaultOptions:
        content: ''
        showCloseButton: true
        overlayClosesOnClick: true
        appendLocation: 'body'
        className: ''

$ = jQuery

animationEndSupport = false

$ ->
    # Detect CSS Animation Support

    s = (document.body || document.documentElement).style
    animationEndSupport = s.animation isnt undefined or s.WebkitAnimation isnt undefined or s.MozAnimation isnt undefined or s.MsAnimation isnt undefined or s.OAnimation isnt undefined

    # Register global handler for ESC

    $(window).bind 'keyup.vex', (event) ->
        vex.closeByEscape() if event.keyCode is 27

# Vex

