Box = new (function() {
   var _data, _this = this;
   
   _this.constructor = null;
   
   _this.getData = function() {
      return _data;
   }
   
   _this.activate = function(form) {
      Utils.request({
         url: '/backend/confirm_box.php',
         data: $(form).serialize(),
         success: function(data) {
            location = data;
         },
         error: function(errno, error) {
            Utils.alert('Fel: ' + error);
         }
      });
   }
   _this.restore = function()
   {
      Utils.request({
         url: '/backend/restore_box.php',
         
         success: function(rs)
         {
            Utils.request({
               url: '/backend/confirm_box.php',
               data: 'id='+rs.id+'&code='+rs.code+'',
               success: function(data) {
                  location = data;
               },
               error: function(errno, error) {
                  Utils.alert('Fel: ' + error);
               }
            });
         },
         error: function (rs,error)
         {
            Utils.alert('Kunde inte återställa boxen.' + error);
         }
      });
   }
});

