             @options.dialog.dialog("open")
 
         _closeDialog: ->
+            jQuery('.image_button').removeClass('ui-state-active')
             @options.dialog.dialog("close")
 
-
-)(jQuery)+)(jQuery)


            id = "#{@options.uuid}-image"
            buttonset.append jQuery("<input id=\"#{id}\" type=\"checkbox\" /><label for=\"#{id}\" class=\"image_button\" >Image</label>").button()
            button = jQuery "##{id}", buttonset
            button.bind "change", (event) ->
                if widget.options.dialog.dialog "isOpen"

        _init: ->

        _openDialog: ->
            jQuery('.image_button').addClass('ui-state-active')

            # Update active Image
            jQuery(".#{@widgetName}-activeImage").attr "src", jQuery(".#{@widgetName}-imageThumbnailActive").first().attr "src"

