 
         _daysInFirstWeek = @daysPerWeek - _dayShift
 
-        i = 1
+        _i = 1
         # get the number of dates in each week
         while _i <= _numberWeeks
             dates = []

            if _i is 1
            # first week of the month
                _j = 0
                while j < daysInFirstWeek
                    _j = _j + 1
                    dates.push _j
            # middle weeks


    showEventDetails: (eventId, fullDate) =>
        self = @
        _index = self.getEventIndex eventId
        _events = self.events[_index]
        _eventDate = "#{fullDate.month} #{fullDate.date}, #{fullDate.year}"

        _eventFrequency = do ->
            if _events.recurrance is 'yearly' and _events.dayNum?
                "Every #{_events.dayNum} #{_events.day} of #{_events.month}"
            else if _events.recurrance is 'yearly'
                "Every #{_events.eventDate} of #{_events.month}"
            else if _events.recurrance is 'monthly' and _events.dayNum?
                "Every #{_events.dayNum} #{_events.day} of the month"
            else if _events.recurrance is 'monthly'
                "Every #{_events.eventDate} of the month"
            else if _events.recurrance is 'biweekly'
                "Every other #{_events.day}"
            else if _events.recurrance is 'weekly'
                "Every #{_events.day}"
            else if _events.recurrance is 'daily'
                "Every Day"
            else
                "One Time Event"
        
        _eventDetails =
            date: _eventDate
            time: _events.time
            type: _events.type
            frequency: _eventFrequency
            repeat: _events.recurrance
            notes: _events.notes

        _eventHolder = $ '<div></div>',
            class: 'drm-calendar-event-details'
            html: "<h1 class='drm-calendar-header'>#{_events.name}</h1>"
        _closeButton = $ '<button></button>',
            class: 'drm-event-close'
            text: 'Close'
            type: 'button'
        _editButton = $ "<button></button>",
            class: 'drm-event-edit'
            'data-event': _events.id
            text: 'Edit'
            type: 'button'
        _deleteButton = $ "<button></button>",
            class: 'drm-event-delete'
            'data-event': _events.id
            text: 'Delete'
            type: 'button'
        _eventDetailList = $ '<ul></ul>',
            class: 'drm-event-detail-list'
        _close = $ '<button></button>',
            class: 'close'
            text: 'x'
        _lightboxHtml = $ '<div></div>',
            class: 'drm-blackout'
            html: _close + _eventHolder

        _lightboxHtml.hide().appendTo('body').fadeIn 300, ->
            _eventHolder.appendTo _lightboxHtml
            _eventDetailList.appendTo _eventHolder
            $.each _eventDetails, (key, value) ->
                if value?
                    _title = self.capitalize key
                    _listItem = $ '<li></li>',
                        html: "<span class='drm-bold'>#{_title}: </span><span class='drm-event-detail'>#{value}</span>"
                    _listItem.appendTo _eventDetailList

            _closeButton.appendTo _eventDetailList
            _editButton.appendTo _eventDetailList
            _deleteButton.appendTo _eventDetailList

        return

    removeEventDetails: (e) ->
        $('div.drm-blackout').fadeOut 300, ->
