Deck = Class.create({ id: 0, initialize: function(H, E, B, A) {
    var C = this; C.cards = H.clone(); C.count = H.size(); C.width = E ? E : 420; C.height = B ? B : 113; C.infoWidth = A ? A : 250; C.id = "deck" + (Deck.prototype.id++); C.index = 0; var G = 0; var F = null; C.cards.each(function(I) { I.cardId = C.id + "card" + (I.index = G++); I.v = 0; I.previous = F; I.next = null; if (F) { F.next = I } F = I }); document.write(C.html()); var D = $(C.id); if (!D) { return } D.deck = C; C.element = D; C.cards.each(function(I) {
        Event.observe($(I.cardId), "mouseover", function(J) {
            clearTimeout(C.rotationTimer); setTimeout(function() { C.auto = false }, 100);
            C.index = I.index; C.target(); C.animate()
        })
    }); Event.observe(D, "mouseout", function(I) { C.animate(); C.auto = true }); C.auto = true; C.animate(true)
}, start: function() { var A = this }, html: function() {
    var A = this; A.target(); var B = '<b class="deck" id="' + A.id + '" style="position:relative;overflow:hidden;width:' + A.width + "px;height:" + A.height + 'px;">'; var D = A.height; var C = D - 2; A.cards.each(function(E) {
        E.width = E.targetWidth; E.left = E.targetLeft; B += '<b id="' + E.cardId + '" style="position:absolute;left:' + E.left + "px;width:" + E.width + 'px;overflow:hidden;">' + '<b style="position:relative;height:' + A.height + 'px;">' + '<b style="position:absolute;">' + '<a href="' + E.url + '"  style="position:relative;display:block;width:' + D + "px;height:" + D + 'px;" class="js-stat-deckArt" target="_top" >' + '<b class="artBorder" style="position:absolute;width:' + D + "px;height:" + D + 'px;"></b>' + '<b id="' + E.cardId + 'back" style="position:absolute;left:1px;top:1px;width:' + C + "px;height:" + C + 'px;background:#ccc;"></b>' + '<b id="' + E.cardId + 'holder" style="position:absolute;left:1px;top:1px;width:' + C + "px;height:" + C + 'px;overflow:hidden;">' +   '<img id="' + E.cardId + 'art" src="' + E.img + '" style="width:' + C + "px;height:" + C + 'px;cursor:hand;border:0px;" onclick="document.location = \'' + E.url + "'\">" + "</b>" + "</a>" + "</b>" + '<b class="info" style="position:absolute;left:' + D + "px;width:" + (A.infoWidth - D) + "px;height:" + D + 'px;">' + "<b>" + A.infoHTML(E) + "</b>" + "</b>" + "</b>" + "</b>"
    }); return B + "</b>"
}, infoHTML: function(B) { var A = this; var C = ""; C += '<img src="' + contextPath + 'img/spacer.gif" class="play-icon js-' + B.type + B.id + ' fl-l js-stat-deckAlbum" style="margin-right:5px;">'; C += '<h4 style="padding: 4px 0px 1px;"><a href="' + B.url + '" target="_top" class="js-stat-deckAlbum">' + B.name + "</a></h4>"; if (B.name2) { C += '<h5>' + B.name2 + "</h5>" } return C }, target: function() { var B = this; var D = 0; var C = 0; var A = Math.round((B.width - B.infoWidth) / (B.count - 1)) + 1; B.cards.each(function(E) { E.targetWidth = (E.index == B.count - 1) ? B.width - D : (E.index == B.index) ? B.infoWidth : A; E.targetLeft = D; D += E.targetWidth - 1 }) }, animate: function(C) {
    var B = this; var A = 0; clearTimeout(B.animationTimer); clearTimeout(B.rotationTimer); B.cards.each(function(D) {
        D.oldWidth = C ? 0 : D.width; if (D.index) {
            var E = D.targetLeft - D.left; if (E != 0) {
                D.v = Math.round((D.v + E / 5) * 0.6); if (Math.abs(D.v) > Math.abs(E)) { D.v = E; E = 0 } $(D.cardId).style.left = (D.left += D.v) + "px"; D.previous.width += D.v; D.width -= D.v;
                A += Math.abs(D.v); if (E == 0) { D.v = 0 }
            }
        }
    }); B.cards.each(function(D) { if (D.width != D.oldWidth) { $(D.cardId).style.width = D.width + "px"; artWidth = B.height - 2; var E = Math.min(D.width - 2, artWidth); $(D.cardId + "back").style.width = E + "px"; $(D.cardId + "holder").style.width = E + "px"; var F = $(D.cardId + "art").style; F.marginLeft = Math.min(0, parseInt((E - artWidth) / 2)) + "px" } }); if (A) { B.animationTimer = setTimeout(function() { B.animate() }, 50) } else { if (B.auto) { B.rotationTimer = setTimeout(function() { B.rotate() }, 2500) } }
}, rotate: function() { var A = this; if (A.auto) { A.index = (A.index + 1) % A.count; A.target(); A.animate() } }
});