rem: this.className = "card-"+suitstr+"-"+number; 
add: this.className = "card "+suitstr+"-"+number; 
context:   createCard: function(colour, suit, suitstr, number) {    var c = document.createElement("image");    // base query methods, number() returns 14 if Game.acesHigh==true    c.number = function() { return (number==1 ? (Game.acesHigh ? 14 : 1) : number); };    //c.trueNumber = function() { return number; }; // needed for isConsecMod13To, but for mo just using _num    c.colour = function() { return colour; };    c.altcolour = function() { return (colour==RED ? BLACK : RED); };    c.suit   = function() { return suit; };    c.faceUp   = function() { return !this._facedown;};    c.faceDown = function() { return this._facedown; };    c.isAce  = function() { return number==1;  };    c.isQueen = function() { return number==12;};    c.isKing = function() { return number==13; };    c.isLastOnPile = function() { return !this.nextSibling; };    // more queries (consecutive ones use number() to get 14 for Aces)    c.isConsecutiveTo = function(card) { return (this.number()==card.number()+1); };    c.notConsecutiveTo = function(card) { return (this.number()!=card.number()+1); };    c.isSameSuit = function(card) { return this._suit==card._suit; };    c.notSameSuit = function(card) { return this._suit!=card._suit; };    c.isSameColour = function(card) { return this._colour==card._colour; };    c.notSameColour = function(card) { return this._colour!=card._colour; };    // advanced queries, used in games where stacks can wrap round (King,Ace,2)    c.isConsecutiveMod13To = function(card) {      // returns true if card is one less than this, or card is King and this is Ace      // uses _number rather than number() to avoid the Ace=14 thingy      return ((this._number==card._number+1) || (this._number-1==card._number%13));    };    c.isAtLeastCountingFrom = function(number, from_num) {      var thisnum = this._number;      if(thisnum<from_num) thisnum+=13;      if(number<from_num) number+=13;      return (thisnum>=number);    };    // simple card turning    c.setFaceUp = function() {      this._facedown = false;      this.className = "card-"+suitstr+"-"+number;    };    c.setFaceDown = function() {      this._facedown = true;      this.className = "card-facedown";    };    // hangover from when source was a property of the first card in the move/drag stacks    // (rather than of the stacks themselves as is now the case)    c.getSource = function() { return this.parentNode.source; };    // other methods    c.turnFaceUp = function() { CardTurner.turnFaceUp(this); };    c.moveTo     = function(targetStack) { CardMover.move(this,targetStack); };    c.transferTo = function(targetStack) { CardMover.transfer(this,targetStack); };    // initialise properties    c.isCard = true;    c._number = number; // needed for isConsecMod13, but no longer used in number()    c._suit = suit; // used in the more complex queries.  may delete in future.    c._colour = colour;    c.setFaceDown();    return c;  }
meta: 3385	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3385/b29f05ae5b036b4445d7cdc823d74b68896f7e7b/cardslib.js/buggy/cardslib.js