 			@.body.on 'click', '.drm-blackout .img-visible', (e) ->
 			    e.stopPropagation()
 
-			images.on 'click', 'a', @.addLightbox	
+			@.images.on 'click', 'a', @.addLightbox	
 
-			body.on 'click', '.drm-blackout .close', @.removeLightbox
+			@.body.on 'click', '.drm-blackout .close', @.removeLightbox
 
-			body.on 'click', '.drm-blackout .thumbnail-list a', @.changeImage			
+			@.body.on 'click', '.drm-blackout .thumbnail-list a', @.changeImage			
 
-			body.on 'click', '.drm-blackout', @.removeLightbox
+			@.body.on 'click', '.drm-blackout', @.removeLightbox
 
 		createThumbnails: ->
 			links = @.images.find 'a'

			# html for the actual lightbox
			lightboxHtml = "<div class='drm-blackout'><button class='close'>x</button><img src='#{img}' alt='thumbnail' class='img-visible'><ul class='thumbnail-list'>#{thumbnails}</div>"

		addLightbox: (e) ->
			lightbox = $ '.drm-blackout'
			lightboxHtml = drmLightbox.createLightbox()

			# if the lightbox isn't already showing, append it to body and fade it into view
			if lightbox.length == 0
				$(lightboxHtml).hide().appendTo(body).fadeIn drmLightbox.config.speed

			e.preventDefault()


			e.stopPropagation()	

		removeLightbox: ->
			$('.drm-blackout').fadeOut drmLightbox.config.speed, ->
				$(@).remove()
	}

	drmLightbox.init()
