
/** Card package **/
SJourney.Cards = {};

/*** 
ITEM = Card metadata object
KEY = Card PMC code
VALUE = css class, helper text, etc.
		ordinal:		Integer value to indicate order in a list
		cardinal:		Integer or Array[Integer,Integer] representing Card heirarchy/importance in Card Finder tools
						Array[Integer,Integer] stores Card family cardinality in first cell, product cardinality in last cell
        cssClass:		String value used by the Navigation
        cssName:		String value used by the benefit/perk match tool; will eventually be used by all pages
        urlName:		String value representing the SEO-friendly Card name for "Learn More" URLs
        omnitureKey:	String value representing a very shortened Card name for Omniture reporting
		descript:		String value representing the legal Card product name, long-form
***/
SJourney.Cards.CardData = {
		"145": {
        ordinal: 1,
        cardinal: 6,
        cssClass: 'sj_prefrewgreenSm',
        cssName: 'Product_Green',
		urlName: 'Preferred-Rewards-Green',
        omnitureKey: 'PrefRewardsGreen',
		descript: 'American Express® Preferred Rewards Green Card'
	},
    "784": {
        ordinal: 2,
        cardinal: [2, 1],
        cssClass: 'sj_premiergoldSm',
        cssName: 'Product_PremierGold',
        urlName: 'Premier-Gold',
		omnitureKey: 'PremierGold',
		descript: 'Premier Rewards Gold Card from American Express'
    },
    "144": {
        ordinal: 3,
        cardinal: [2, 2],
        cssClass: 'sj_prefrewgoldSm',
        cssName: 'Product_Gold',
        urlName: 'Preferred-Rewards-Gold',
		omnitureKey: 'PrefRewardsGold',
		descript: 'American Express® Preferred Rewards Gold Card'
    },
    "137": {
        ordinal: 4,
        cardinal: 1,
		cssClass: 'sj_platCardSm',
        cssName: 'Product_Platinum',
        urlName: 'Platinum-Card',
		omnitureKey: 'Platinum',
		descript: 'Platinum Card® from American Express'
    },
    "81": {
        ordinal: 5,
        cardinal: 11,
        cssClass: 'sj_blueCardSm',
        cssName: 'Product_Blue',
        urlName: 'Blue',
		omnitureKey: 'Blue',
		descript: 'Blue from American Express®'
    },
    "77": {
        ordinal: 6,
        cardinal: 10,
        cssClass: 'sj_bluecashCardSm',
        cssName: 'Product_BlueCash',
        urlName: 'BlueCash',
		omnitureKey: 'BlueCash',
		descript: 'Blue Cash® from American Express'
    },
    "82": {
        ordinal: 7,
        cardinal: 9,
        cssClass: 'sj_blueskyCardSm',
        cssName: 'Product_BlueSky',
        urlName: 'BlueSky',
		omnitureKey: 'BlueSky',
		descript: 'Blue Sky from American Express'
    },
    "331": {
        ordinal: 8,
        cardinal: 999,
        cssClass: 'sj_clearCardSm',
        cssName: 'Product_Clear',
        urlName: 'Clear',
		omnitureKey: 'Clear',
		descript: 'Clear from American Express®'
    },
    "161": {
        ordinal: 9,
        cardinal: 8,
        cssClass: 'sj_costcoCardSm',
        cssName: 'Product_Costco',
        urlName: 'Costco-TrueEarnings',
		omnitureKey: 'CostcoTrueEarnings',
		descript: 'True Earnings® Card from Costco and American Express'
    },
    "113": {
        ordinal: 10,
        cardinal: 5,
        cssClass: 'sj_gdskymilesCardSm',
        cssName: 'Product_DeltaGold',
        urlName: 'Gold-Delta-Skymiles',
		omnitureKey: 'GoldDelta',
		descript: 'Gold Delta SkyMiles® Credit Card'
    },
    "142": {
        ordinal: 11,
        cardinal: 4,
        cssClass: 'sj_platskymilesSm',
        cssName: 'Product_DeltaPlatinum',
        urlName: 'Platinum-Delta-Skymiles',
		omnitureKey: 'PlatinumDelta',
		descript: 'Platinum Delta SkyMiles® Credit Card'
    },
    "106": {
        ordinal: 12,
        cardinal: 3,
        cssClass: 'sj_deltaCardSm',
        cssName: 'Product_DeltaReserve',
        urlName: 'Delta-Reserve',
		omnitureKey: 'DeltaReserve',
		descript: 'Delta Reserve Credit Card'
    },
    "117": {
        ordinal: 14,
        cardinal: [7, 3],
        cssClass: 'sj_hiltonHHSm',
        cssName: 'Product_HiltonHHonors',
        urlName: 'Hilton-HHonors',
		omnitureKey: 'HiltonHHonors',
		descript: 'Hilton HHonors® Card from American Express'
    },
    "774": {
        ordinal: 15,
        cardinal: [7, 2],
        cssClass: 'sj_surpassSm',
        cssName: 'Product_HiltonSurpass',
        urlName: 'Hilton-HHonors-Surpass',
		omnitureKey: 'HiltonSurpass',
		descript: 'Hilton HHonors® Surpass Card from American Express'
    },
		"158": {
        ordinal: 16,
        cardinal: [7, 1],
        cssClass: 'sj_starwoodSm',
        cssName: 'Product_Starwood',
        urlName: 'Starwood-Preferred',
		omnitureKey: 'Starwood',
		descript: 'Starwood Preferred Guest® Credit Card from American Express'
	},
	"119": {
		ordinal: 13, 
	    cardinal: 999, 
	    cssClass: 'sj_jetblueCardSm',
	    cssName: 'Product_JetBlue',
	    urlName: 'Jetblue',
	    omnitureKey: 'JetBlue',
	    descript: 'JetBlue Card from American Express'
    }	
	 
};

/*** 
ITEM = Card Tray objects
VALUE = Creates an easier to handle instance of a Card, with a few more properties of use
***/
SJourney.Cards.Card = function(pmc, CardDataObj) {
    return {
        type: "card",
        pmc: pmc,
        descript: CardDataObj.descript,
        cssClass: CardDataObj.cssClass,
		cssName: CardDataObj.cssName,
		urlName: CardDataObj.urlName,
        ordinal: CardDataObj.ordinal,
        cardinal: CardDataObj.cardinal
    }
};

/*** 
ITEM = Singleton card tray objects
VALUE = Create placeholder objects
***/
SJourney.Cards.CardEmptySlot = {
    type: "cardslot",
    cssClass: "cardslot"
};
SJourney.Cards.CardAddSlot = {
    type: "addCardSlot",
    cssClass: "addCardSlot"
};

/*** 
ITEM = Sorts array of card objects
VALUE = Card objects from Menu or Tray Objects
***/
SJourney.Cards.sortCards = function(a,b){
    if ( a.ordinal < b.ordinal ) return -1;
    if ( a.ordinal > b.ordinal ) return 1;    
    return 0;
};

