/*
	Please note, you MAY need to add several entries for the same page to take into account
	/path/index.html and /path/ and in rare cases /path (no trailing slash)
	All lines should end in , except for the final line 
	Example line
	"[URL]" : {"naf" : "[High Flyer Source Code]", "f" : "[NAF Source Code]", "hf" : [Flyer Source Code], "savings" : "[Savings Source Code]"},
	
	Use null (no quotes) if you do not want the source code set at all.
*/

source_codes = {
	"/credit-card/welcome/cards/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/flyer/velocity/" : {"naf" : null, "lr" : null,  "f" : "O1C1M26A", "hf" : "O1C1RX6I", "savings" : null},	
	"/credit-card/welcome/cards/search/" : {"naf" : "O1C1V261", "lr" : "O1C2U291", "f" : "O1C2MXC1", "hf" : "O1C1RX61", "savings" : null},
	"/credit-card/welcome/cards/velocity-virgin-australia-search/" : {"naf" : "O1C1V261", "lr" : "O1C2U291", "f" : "O1C2MXC1", "hf" : "O1C1RX6I", "savings" : null},
		
	"/credit-card/welcome/flyer/20Kcohort/" : {"naf" : null, "lr" : null, "f" : "OFC2MXCC", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/20Kempd/" : {"naf" : null, "lr" : null,  "f" : "OFC2MXCB", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/20KWRM/" : {"naf" : null, "lr" : null, "f" : "OFC2MXCE", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/20Krewardscentral/" : {"naf" : null, "lr" : null, "f" : "OFC2MXCF", "lr" : null,"hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/20Kviva9/" : {"naf" : null, "lr" : null, "f" : "OFC2MXCA", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/accruer/" : {"naf" : null, "lr" : null, "f" : "OFC1M26D", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/accruer2/" : {"naf" : null, "lr" : null,  "f" : "OFC1M26D", "hf" : "OFC1RX6D", "savings" : null},							 		
	"/credit-card/welcome/flyer/apply/" : {"naf" : null, "lr" : null, "f" : "OAC2MXC4", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/CBOL/" : {"naf" : null, "lr" : null, "f" : "OWC2MXC1", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/creditcardworld/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCA", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/dgm/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCH", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/domestic/" : {"naf" : null, "lr" : null, "f" : "OFC1M26F", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/domestic2/" : {"naf" : null, "lr" : null, "f" : "OFC1M26F", "hf" : "OFC1RX6F", "savings" : null},
	"/credit-card/welcome/flyer/fly/" : {"naf" : null, "lr" : null, "f" : "OAC2MXC3", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/free/" : {"naf" : null, "lr" : null, "f" : "OAC2MXC1", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/frequent/" : {"naf" : null, "lr" : null, "f" : "OFC1M26G", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/frequent2/" : {"naf" : null, "lr" : null, "f" : "OFC1M26G", "hf" : "OFC1RX6G", "savings" : null},	
	"/credit-card/welcome/flyer/hive/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCB", "hf" : null, "savings" : null},	
	"/credit-card/welcome/flyer/infochoice/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCE", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/international/" : {"naf" : null, "lr" : null, "f" : "OFC1M26C", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/international2/" : {"naf" : null, "lr" : null, "f" : "OFC1M26C", "hf" : "OFC1RX6C", "savings" : null},
	"/credit-card/welcome/flyer/mozo/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCD", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/offer/" : {"naf" : null, "lr" : null, "f" : "OFC2MXC1", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/phoneoffer/" : {"naf" : null, "lr" : null, "f" : "OFC1M26H", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/planet49/" : {"naf" : null, "lr" : null, "f" : "OFC2MXCD", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/ratecity/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCF", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/searchcards/" : {"naf" : null, "lr" : null, "f" : "O1C2MXC1", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/spender/" : {"naf" : null, "lr" : null, "f" : "OFC1M26E", "hf" : null, "savings" : null},	
	"/credit-card/welcome/flyer/spender2/" : {"naf" : null, "lr" : null, "f" : "OFC1M26E", "hf" : "OFC1RX6E", "savings" : null},		
	"/credit-card/welcome/flyer/tv/" : {"naf" : null, "lr" : null, "f" : "OAC2MXC2", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/velocity-members/" : {"naf" : null, "lr" : null, "f" : "OFC1M26B", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/velocityshop/" : {"naf" : null, "lr" : null, "f" : "OWC1M26C", "hf" : "OWC1RX6C", "savings" : null},
	"/credit-card/welcome/flyer/velocityspecial/" : {"naf" : null, "lr" : null, "f" : "OWC1M26B", "hf" : "OWC1RX6B", "savings" : null},
	"/credit-card/welcome/flyer/velocityhome/" : {"naf" : null, "lr" : null, "f" : "OWC1M26A", "hf" : "OWC1RX6A", "savings" : null},
	"/credit-card/welcome/flyer/velocityitinerary" : {"naf" : null, "lr" : null, "f" : "OWC1M26A", "hf" : "OWC1RX6A", "savings" : null},
	"/credit-card/welcome/flyer/virgin-mobile/" : {"naf" : null, "lr" : null, "f" : "OEC2MXCA", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/viva9/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCG", "hf" : null, "savings" : null},
	"/credit-card/welcome/flyer/which4u/" : {"naf" : null, "lr" : null, "f" : "O1C2MXCC", "hf" : null, "savings" : null},
	
	"/credit-card/welcome/high-flyer/creditcardworld/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6A", "savings" : null},
	"/credit-card/welcome/high-flyer/hive/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6B", "savings" : null},
	"/credit-card/welcome/high-flyer/mozo/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6D", "savings" : null},
	"/credit-card/welcome/high-flyer/infochoice/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6E", "savings" : null},
	"/credit-card/welcome/high-flyer/ratecity/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6F", "savings" : null},
	"/credit-card/welcome/high-flyer/dgm/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6H", "savings" : null},
	"/credit-card/welcome/high-flyer/viva9/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6G", "savings" : null},
	"/credit-card/welcome/high-flyer/which4u/" : {"naf" : null, "lr" : null, "f" : null, "hf" : "O1C1RX6C", "savings" : null},
	
	"/credit-card/welcome/low-rate/creditcardworld/" : {"naf" : null, "lr" : "O1C2U292", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/dgm/" : {"naf" : null, "lr" : "O1C2U298", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/hive/" : {"naf" : null, "lr" : "O1C2U293", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/display/" : {"naf" : null, "lr" : "O1C2U29G", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/edmoffer/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/facebook/" : {"naf" : null, "lr" : "ODC2U291", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/infochoice/" : {"naf" : null, "lr" : "O1C2U296", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/mozo/" : {"naf" : null, "lr" : "O1C2U295", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/nova/" : {"naf" : null, "lr" : "O1C2U29K", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/ratecity/" : {"naf" : null, "lr" : "O1C2U297", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/search/" : {"naf" : null, "lr" : "O1C2U291", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/search2/" : {"naf" : "O1C1V261", "lr" : "O1C2U291", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/search3/" : {"naf" : "O1C1V261", "lr" : "O1C2U291", "f" : "O1C2MXC1", "hf" : "O1C1RX61", "savings" : null},
	"/credit-card/welcome/low-rate/search4/" : {"naf" : "O1C1V261", "lr" : "O1C2U291", "f" : "O1C2MXC1", "hf" : "O1C1RX61", "savings" : null},
	"/credit-card/welcome/low-rate/searchfee/" : {"naf" : null, "lr" : "O1C2U291", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/viva9/" : {"naf" : null, "lr" : "O1C2U299", "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/low-rate/which4u/" : {"naf" : null, "lr" : "O1C2U294", "f" : null, "hf" : null, "savings" : null},
	
	"/credit-card/welcome/nofee/creditcardworld/" : {"naf" : "O1C1V26A", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/dgm/" : {"naf" : "O1C1V26H", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/infochoice/" : {"naf" : "O1C1V26E", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/hive/" : {"naf" : "O1C1V26B", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/mozo/" : {"naf" : "O1C1V26D", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/ratecity/" : {"naf" : "O1C1V26F", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/searchcards/" : {"naf" : "O1C1V261", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/viva9/" : {"naf" : "O1C1V26G", "lr" : null, "f" : null, "hf" : null, "savings" : null},
	"/credit-card/welcome/nofee/which4u/" : {"naf" : "O1C1V26C", "lr" : null, "f" : null, "hf" : null, "savings" : null},

	"/savings/welcome/50/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ2BZAZYCAZB"},
	"/savings/welcome/75/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ2BZAZYCAZC"},
	"/savings/welcome/adconion/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZC"},
	"/savings/welcome/applytoday/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZC"},
	"/savings/welcome/creditworld/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4AA7AYZZYNAZA"},
	"/savings/welcome/dgm/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4FA7AYMZYNAZA"},
	"/savings/welcome/brand/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4GA7AYAZYNAZB"},
	"/savings/welcome/greatrate/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZD"},
	"/savings/welcome/highinterest/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZH"},
	"/savings/welcome/highrate/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA2BYAZYCAZG"},
	"/savings/welcome/hive/" : {"naf" : null, "f" : null, "hf" : null, "lr" : null, "savings" :  "V4AA7AYZZYNAZA"},
        "/savings/welcome/infochoice/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4AA7AYJZYNAZA"},
	"/savings/welcome/moremoney/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA2BYAZYCAZC"},
	"/savings/welcome/julyoffer/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/savings/welcome/mozo/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4AA7AYKZYNAZA"},
	"/savings/welcome/newsoffer/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA2BYAZYCAZB"},
	"/savings/welcome/offer1/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ8AFAZ3CAZA"},
	"/savings/welcome/offer2/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ8AFAZ3CAZA"},
	"/savings/welcome/offer3/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ8AFAZ3CAZA"},
	"/savings/welcome/online/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4GA7AYAZYNAZA"},
	"/savings/welcome/onlinesaver/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ2BZAZYCAZA"},
	"/savings/welcome/onlinesavings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA1BYAZYNAZA"},
	"/savings/welcome/press/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA7AYAZYNAZA"},
	"/savings/welcome/ratecity/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4AA7AYCZYNAZA"},
	"/savings/welcome/save50/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA2BYAZYCAZE"},
	"/savings/welcome/savenow/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQNAAAZYNAZA"},
	"/savings/welcome/saver/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA2BYAZYCAZF"},
	"/savings/welcome/savetoday/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQNA8AZYNAZA"},
	"/savings/welcome/savings1/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4FA7AYBZYNAZA"},
	"/savings/welcome/savings2/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4FA7AYMZYNAZA"},
	"/savings/welcome/savings3/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4AA7AYZZYNAZA"},
	"/savings/welcome/savingsoffer/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ8AFAZ3CAZA"},
	"/savings/welcome/savingsrate/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZD"},
	"/savings/welcome/search/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4Q77AYGZYNAZA"},
	"/savings/welcome/search/offer/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4Q77AYGZYNAZA"},
	"/savings/welcome/searchnominbalanceand24-7/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4Q77AYGZYNAZA"},
	"/savings/welcome/searchnominbalanceand24-7ncompare/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4Q77AYGZYNAZA"},
	"/savings/welcome/searchsavingforagoal/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4GA7AYAZYNAZA"},
	"/savings/welcome/searchsavingforagoalncompare/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4Q77AYGZYNAZA"},
	"/savings/welcome/surveychoice/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZC"},
	"/savings/welcome/virginsavings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZD"},
	"/savings/welcome/virginsaver/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4PA2BYAZYCAZD"},
	"/savings/welcome/vm/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZB"},
	"/savings/welcome/viva9/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4FA7AYBZYNAZA"},
	"/savings/welcome/wrm/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V4EQ5BYZZYNAZC"},
			
	"/my-virgin-money/my-life-insurance/promotions/savings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZB"},
	"/my-virgin-money/my-car-insurance/promotions/savings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZB"},
	"/my-virgin-money/my-credit-cards/promotions/savings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZB"},
	"/my-virgin-money/my-superannuation/promotions/savings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZB"},
	"/my-virgin-money/promotions/savings/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZB"},
	
	"/credit-card/welcome/cards/searchjuly/" : {"naf" : null, "lr" : null, "f" : "O1CYMY91", "hf" : null, "savings" : null},
	"/welcome/5-offers/" : {"naf" : null, "lr" : null, "f" : "OWCYMY62", "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/welcome/5-offers/infochoice/" : {"naf" : null, "lr" : null, "f" : "OWCYMY62", "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/welcome/5-offers/wines/" : {"naf" : null, "lr" : null, "f" : "OWCYMY62", "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/welcome/4-offers/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/welcome/4-offers/atlantic/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/welcome/4-offers/wines/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/welcome/4-offers/mobile/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZA"},
	"/savings/welcome/julyoffer/" : {"naf" : null, "lr" : null, "f" : null, "hf" : null, "savings" :  "V42Z7AZZZYNAZA"}
	
};
savings_source_code = Array('V4EQ5BYZZYNAZC' ,'V4AA7AYZZYNAZA' ,'V4FA7AYMZYNAZA' ,'V4AA7AYZZYNAZA' ,'V4AA7AYJZYNAZA' ,'V42Z7AZZZYNAZA' ,'V4AA7AYKZYNAZA' ,'V4AA7AYCZYNAZA' ,'V4Q77AYGZYNAZA' ,'V4Q77AYGZYNAZA' ,'V42Z7AZZZYNAZB' ,'V42Z7AZZZZYNAZA' ,'V4Q77AYGZYNAZA' ,'V4Q77AYGZYNAZA' ,'V4EQ5BYZZYNAZC' ,'V4EQ5BYZZYNAZC' ,'V42Z7AZZZYNAZA');



















/*********************************************************************
 * Nothing to see here, move along
 *********************************************************************/
function hasSourceCode(){
	path = document.location.pathname;
	if(hasSavingsSourceCode()){
		return true;
	}else{
	
	//	path = path.replace("/index.html", "/");
		// set the cookies for CC, the link for savings
	//	if(source_codes[path]){
		// set the cookies for CC, the link for savings
		foundPath = false;
		if(source_codes[path]){
			foundPath = true;
		}else{
			path = path.replace("/index.html", "/");
			if(source_codes[path]){
				foundPath = true;
			}else{
				path += "/";
				if(source_codes[path]){
					foundPath = true;
				}
			}
		}
		if(foundPath){
			options = { 'expires': (1 * 1 * 60 * 60), path: "/", domain: "." + document.domain };
			optionsExpires = { 'expires': -1, path: "/", domain: "." + document.domain };
			if(getSourceCode("savings") != null){
				setCookie("_source_savings", getSourceCode("savings"), options);
			}else{
				if(getSourceCode("naf") != null){
					setCookie("_source_naf", getSourceCode("naf"), options);
				}else{
					setCookie("_source_naf", getSourceCode("naf"), optionsExpires);
				}
				if(getSourceCode("lr") != null){
					setCookie("_source_lr", getSourceCode("lr"), options);
				}else{
					setCookie("_source_lr", getSourceCode("lr"), optionsExpires);
				}
				if(getSourceCode("hf") != null){
					setCookie("_source_hf", getSourceCode("hf"), options);
				}else{
					setCookie("_source_hf", getSourceCode("hf"), optionsExpires);
				}
				if(getSourceCode("f") != null){
					setCookie("_source_f", getSourceCode("f"), options);
				}else{
					setCookie("_source_f", getSourceCode("f"), optionsExpires);
				}
				
			}
		}
	
		return (source_codes[path]) ? source_codes[path] : null;
	}
}
function hasSavingsSourceCode(){
	path = document.location.pathname;
	if(path.substring(0, 8) == "/savings"){
		query = document.location.search;
		URLParams = new Object();
		if(query != ""){
			URLkeyPairs = query.substring(1, query.length).split('&');
			for(i=0; i<URLkeyPairs.length; i++){
				var URLkeyPair = URLkeyPairs[i].split('=');
				if(URLkeyPair.length == 2){
					if(URLkeyPair[0] == "sourceCode" && isSavingsSourceCode(URLkeyPair[1])){
						options = { 'expires': (1 * 1 * 60 * 60), path: "/", domain: "." + document.domain };
						setCookie("_source_savings", URLkeyPair[1], options);
						return true;
					}
				};
			};
		}
	}
	return false;
}
function isSavingsSourceCode(val){
	for(i=0; i<savings_source_code.length; i++){
		if(val == savings_source_code[i]){
			return true;
		}
	}
	return false;
}
function getSourceCode(key){
	path = document.location.pathname;
//	path = path.replace("/index.html", "/");
	foundPath = false;
	if(source_codes[path]){
	}else{
		path = path.replace("/index.html", "/");
		if(source_codes[path]){
		}else{
			path += "/";
		}
	}
	try{
		return (source_codes[path][key]) ? source_codes[path][key] : null;
	}catch(e){
		return null;
	}
}
function setSourceCode(cookieName, cookieValue){
	options = { 'expires': (1 * 1 * 60 * 60), path: "/", domain: "." + document.domain };
	setCookie(cookieName, cookieValue, options);
}
function getSourceCookie(cookieName){
	cookieValue = null;
	cookies = document.cookie.split(";");
	for(i = 0; i < cookies.length; i++){
		cookie = cookies[i].split("=");
		if(cookieName == String(cookie[0]).replace(/\s/, "")){
			cookieValue = String(cookie[1]).replace(/\s/, "")
		}
	}
	if(cookieValue == null && cookieName == "_source_savings"){
		cookieValue = "V42Z7AZZZYNAZA";
	}
	return cookieValue;
}
function onSelectorPage(){
	path = document.location.pathname;
//	return (path == '/credit-card/before-you-start/index.html' || path == '/credit-card/before-you-start/' || path == '/credit-card/before-you-start');
	return (path == '/credit-card/before-you-start/index.html' || path == '/credit-card/before-you-start/' || path == '/credit-card/before-you-start' || path == '/welcome/calc/bt-calc-flyer.html' || path == '/welcome/calc/bt-calc-flyer-2.html' || path == '/welcome/calc/bt-calc-premium.html' || path == '/welcome/calc/bt-calc-naf.html' || path == '/welcome/calc/bt-calc-lowrate.html');
}
$(document).ready(function(){
	if(hasSourceCode()){
		$("a.maphf, a.mapf, a.mapnaf,a.mapl, a.mapsaving").each(function(idx, obj){
			if($(obj).hasClass("maphf")){
				$(obj).click(function(){setSourceCode("_source", "hf")});
			} else if($(obj).hasClass("mapf")){
				$(obj).click(function(){setSourceCode("_source", "f")});
			} else if($(obj).hasClass("mapl")){
				$(obj).click(function(){setSourceCode("_source", "lr")});
			} else if($(obj).hasClass("mapnaf")){
				$(obj).click(function(){setSourceCode("_source", "naf")});
			} else if($(obj).hasClass("mapsaving")){
				$(obj).click(function(){setSourceCode("_source", "savings")});
			}
		});
	}else{
		if(!onSelectorPage()){
			optionsExpires = { 'expires': -1, path: "/", domain: "." + document.domain };
//			no longer expire savings cookie
//			setCookie("_source_savings", null, optionsExpires);
			setCookie("_source_naf", null, optionsExpires);
			setCookie("_source_lr", null, optionsExpires);
			setCookie("_source_hf", null, optionsExpires);
			setCookie("_source_f", null, optionsExpires);
			
		}
	}
	
	
	
	if(getSourceCookie("_source_savings")){
		$("a.mapsaving").each(function(idx, obj){
			thisHref = $(obj).attr("href");
			requestParams = {};
			thisRequestParamsParser = thisHref.split("?");
			thisRequestParamsParser = (thisRequestParamsParser.length == 2) ? thisRequestParamsParser[1] : null;
			if(thisRequestParamsParser != null){
				thisRequestParamsParser = thisRequestParamsParser.split("&");
				for(i = 0; i < thisRequestParamsParser.length; i++){
					requestParams[thisRequestParamsParser[i][0]] = thisRequestParamsParser[i][1];
				}
			}
			if(requestParams["sourceCode"] && requestParams["sourceCode"] != ""){}else{
				$(obj).attr("href", thisHref + ((thisHref.indexOf('?') > 1) ? "&" : "?" ) + "sourceCode=" + getSourceCookie("_source_savings"));
			}
		});
	}
});

