anchor.diff:    var updateDeckTr = function(tr) {
       var tr = $(tr)
       var card_entry = deck.get(tr.data('code'))
  -    var cost = card_entry.card.cost()
  -    $('td.cost', tr).text(cost) 
  -    $('td.total', tr).text(card_entry.amount * cost) 
  -  }
  -
  -  var updateListTr = function(tr) {
  -    var tr = $(tr)
  -    var card = $(tr).data('card')
  -    $('td.cost', tr).text(card.cost())
  -  }
  -
  -  var updateTotalDeckCost = function(start) {
  -    var total = (start || 0) + _.reduce($('#deck_table td.total'), function(memo, td) {
  -      return memo + parseInt($(td).text())
  -    },0)
  -
  -    $("#total_deck_cost").text(total)
  -    return total
  -  }
  -
  -  var updateAllCards = function() {
  -    _.each($('#deck_table tbody tr[data-code]'), updateDeckTr)
  -    _.each($('#card_list_table tbody tr[data-code]'), updateListTr)
  -    updateTotalDeckCost()
  -  }
  -
  -  var updateListCardMaxTr = function(tr) {
  -    var tr = $(tr)
  -    var card = $(tr).data('card')
  -        
  -    var user_max = card.user_max()
  -    var maxText = '' + user_max
  -    if(user_max != card.deck_max) {
  -      maxText += '/' + card.deck_max
  -    }
  -
  -    $('td.max', tr).text(maxText)
  -  }
  -
  -  var updateDeckAmountTr = function(tr) {
  -    var tr = $(tr)
  -    var card_entry = deck.get(tr.data('code'))
  +
       var max = card_entry.card.user_max()
  -
       var td = $('td.amount', tr).empty()
       if(max === 1) {
         td.text('1') 
  
positive.code:   }, 2000))
  
    var buildCards = function() {
       return _.flatten(_.map($('#deck_table tbody tr'), function(tr, i) {
         var card = $(tr).data('card')
         var base = 'deck[deck_cards_attributes][]'
         return [
           $('<input type="hidden"/>').attr('name', base + '[card_code]').attr('value', card.code),
           $('<input type="hidden"/>').attr('name', base + '[amount]').attr('value', card.deck_amount)
         ]
       }))
    }
  
negative.code:     add : function(card) {
        var card_entry = this.entries[card.code]
        if(!card_entry) {
          card_entry = this.entries[card.code] = {card : $.extend({}, card), amount : 0}
        } 
        card_entry.amount += 1
        return card_entry
      },
      remove : function(code) {
        delete this.entries[code]
      },
      cost : function() {
        return  _.reduce(this.entries, function(memo, card_entry) {
          return memo + card_entry.amount * card_entry.card.cost()
        }, 0)
      }
    }
  
    $('#mage_select').one('change', 'input', function() {
  
  