function ModalBox(args) {
    self = this;
    this.view = $('<div class="modalbox"><div class="wrapper"><p></p><div class="buttons"></div></div></div>');
    this.view.find('.wrapper p').text(args.message);

    $.each(args.buttons, function(i, button) {
        var elem = $('<button></button>').text(button.label);
        elem.click(button.callback);
        self.view.find('.buttons').append(elem);
    });

    this.show = function() {
        $('body').append(this.view);
    };

    this.remove = function() {
        this.view.remove();
    };
}

function ReloadDialog() {
}

ReloadDialog.prototype = new ModalBox({
    message: 'Your account has been used somewhere else. Please reload the page.',
    buttons: [
        {
            label: 'Reload',
            callback: function() {
                location.reload();
            }
        }
    ]
});

function WhatIsFlattrDialog() {
}

WhatIsFlattrDialog.prototype = new ModalBox({
    message: 'Flattr is an easy way to send micropayments. With your help we can create a sustainable way for music artists to get paid.',
    buttons: [
        {
            label: 'Connect your Flattr account',
            callback: function() {
                location.href = '/flattrconnect';
            }
        }
    ]
});

@@ -15,32 +15,11 @@
 Box(
-args) %7B%0A    self = this;
+) %7B
 %0A   
@@ -127,16 +127,71 @@
 div%3E');%0A
+%7D%0A%0AModalBox.prototype.setMessage = function(message) %7B%0A
     this
@@ -220,21 +220,16 @@
 ').text(
-args.
 message)
@@ -234,33 +234,42 @@
 e);%0A
-%0A    $.each(args.b
+%7D;%0A%0AModalBox.prototype.addB
 utton
-s,
+ =
  fun
@@ -278,25 +278,48 @@
 ion(
-i, button) %7B%0A    
+label, callback) %7B%0A    var self = this;%0A
     
@@ -361,23 +361,16 @@
 ext(
-button.
 label);%0A
     
@@ -365,20 +365,16 @@
 label);%0A
-    
     elem
@@ -384,38 +384,60 @@
 ick(
-button.callback);%0A        self
+function() %7B%0A        callback(self)%0A    %7D);%0A    this
 .vie
@@ -473,25 +473,30 @@
 m);%0A
-    %7D);%0A%0A    this
+%7D;%0A%0AModalBox.prototype
 .sho
@@ -516,20 +516,16 @@
 ) %7B%0A    
-  
-  
 $('body'
@@ -549,24 +549,30 @@
 w);%0A
-    %7D;%0A%0A    this
+%7D;%0A%0AModalBox.prototype
 .rem
@@ -594,20 +594,16 @@
 ) %7B%0A    
-  
-  
 this.vie
@@ -618,100 +618,181 @@
 ();%0A
-    %7D;%0A%7D%0A%0Afunction ReloadDialog() %7B%0A%7D%0A%0AReloadDialog.prototype = new ModalBox(%7B%0A    m
+%7D;%0A%0A/* RELOAD DIALOG%0A ****************************************************************************/%0A%0Afunction ReloadDialog() %7B%0A    ModalBox.call(this);%0A%0A    this.setM
 essage
-: 
+(
 'You
@@ -859,263 +859,364 @@
 ge.'
-,
+);%0A
 %0A    
-buttons: %5B%0A        %7B%0A            label: 'Reload',%0A            callback: function() %7B%0A                location.reload();%0A            %7D%0A        %7D%0A    %5D%0A%7D);%0A%0Afunction WhatIsFlattrDialog() %7B%0A%7D%0A%0AWhatIsFlattrDialog.prototype = new ModalBox(%7B%0A    m
+this.addButton('Reload', function(self) %7B%0A        location.reload();%0A    %7D);%0A%7D%0A%0AReloadDialog.prototype = new ModalBox();%0AReloadDialog.prototype.constructor = ReloadDialog;%0A%0A/* FLATTR DIALOG%0A ****************************************************************************/%0A%0Afunction WhatIsFlattrDialog() %7B%0A    ModalBox.call(this);%0A%0A    this.setM
 essage
-: 
+(
 'Fla
@@ -1339,200 +1339,316 @@
 id.'
-,
+);%0A
 %0A    
-buttons: %5B%0A        %7B%0A            label: 'Connect your Flattr account',%0A            callback: function() %7B%0A                location.href = '/flattrconnect';%0A            %7D%0A        %7D%0A    %5D%0A%7D)
+this.addButton('Connect your Flattr account', function(self) %7B%0A        location.href = '/flattrconnect';%0A    %7D);%0A%0A    this.addButton('Cancel', function(self) %7B%0A        self.remove();%0A    %7D);%0A%7D%0A%0AWhatIsFlattrDialog.prototype = new ModalBox();%0AWhatIsFlattrDialog.prototype.constructor = WhatIsFlattrDialog
 ;%0A

Rework the ModalBox code