/*** 
	TO ENABLE PAYMENT ESTIMATOR
	1) Uncomment block of code below.  Block is indicated by comment, "uncomment following to enable payment estimator"
	2) Comment out last line of code.  Indicated by comment, "comment out following line to enable payment estimator"

***/

/* urls where app can be found */
// concat "gaps" put in urls so that global search/replace won't mess with'em - kn Jan11/08
var urlItl = "http://paymentestimator.autodata.preprod" + ".gm.ca/GMCanadaPaymentEstimator/paymentEstimatorContainer.html?";
var urlPreprod = "http://paymentestimator.autodata.preprod" + ".gm.ca/GMCanadaPaymentEstimator/paymentEstimatorContainer.html?";
var urlBase = "http://paymentestimator.autodata" + ".gm.ca/GMCanadaPaymentEstimator/paymentEstimatorContainer.html?"; // live



urlBase = (location.href.indexOf('itl.')>-1) ? urlItl: urlBase;
urlBase = (location.href.indexOf('preprod.')>-1) ? urlPreprod: urlBase;

function copy(arr){
	var newArr = new Array()
	for (var item in arr){
		newArr[item] = arr[item];
	}
	return newArr;
}

/*** Payment Estimator configuration options ***/
var estimatorConfig=new Array();
// data refers to the key in the data (in common-external) url is the querystring name piece of it.


/*  uncomment following to enable payment estimator*/
estimatorConfig["keys"]=new Array();
estimatorConfig["keys"][0]=new Array();
estimatorConfig["keys"][0]["url"]="brandName";
estimatorConfig["keys"][0]["data"]="division parameter";
estimatorConfig["keys"][1]=new Array();
estimatorConfig["keys"][1]["url"]="model";
estimatorConfig["keys"][1]["data"]="model code";
estimatorConfig["keys"][2]=new Array();
estimatorConfig["keys"][2]["url"]="package";
estimatorConfig["keys"][2]["data"]="package code";
estimatorConfig["keys"][3]=new Array();
estimatorConfig["keys"][3]["url"]="msrp";
estimatorConfig["keys"][3]["data"]="";
estimatorConfig["keys"][4]=new Array();
estimatorConfig["keys"][4]["url"]="returnToURL";
estimatorConfig["keys"][4]["data"]="returnToURL";
estimatorConfig["keys"][5]=new Array();
estimatorConfig["keys"][5]["url"]="returnToName";
estimatorConfig["keys"][5]["data"]="returnToName";
estimatorConfig["keys"][6]=new Array();
estimatorConfig["keys"][6]["url"]="brand";
estimatorConfig["keys"][6]["data"]="compare brand";

// static pieces are just name/vals for other bits that need to get passed
estimatorConfig["static pieces"]=new Array();
estimatorConfig["static pieces"]["lang"]=(location.href.indexOf('fr_CA')>-1 || location.href.indexOf('/french_lw/')>-1)?"fr":"en";
estimatorConfig["static pieces"]["year"]="2009";

//estimatorConfig["static pieces"]["returnToURL"]="2007";

estimatorConfig["base url"]=urlBase;


/* comment out following line to enable payment estimator 
estimatorConfig["base url"]="/english/financing/payment_estimator.html";*/


