var omni_preloadFlag = true;
var omni_URL_ID=self.location.href;
var url_split = omni_URL_ID.split("?");
var url_first = url_split[0].split("/");
var omni_cntryCode = url_split[1].split("=");
var omni_ctryCd=omni_cntryCode[1];
var omni_pageID=url_first[url_first.length-1];
//alert("length "+ url_first.length);

if (omni_ctryCd.length >1)
{
	omni_ctryCd = omni_ctryCd.split("&");
	omni_ctryCd=omni_ctryCd[0];
}


if (url_first.length >11)
{
	var omni_brandCd=url_first[url_first.length-4];
}
else
{
	var omni_brandCd=url_first[url_first.length-3];
}
//alert(omni_brandCd);
//Set the current Environment here / Values are: "DEV" - ITL, "PRO" - Production
var env="PRO";

/*Brand and Report Suite ID related Information*/

//Country Class for creating Country and Report Suite ID pair Arrays
function country_Class(keey,vaalue)
{
  this.keey=keey;
  this.vaalue=vaalue;
}

//Brand to Reporst-Suite ID mapping
var omni_country_List = new Array();
omni_country_List[0]=new country_Class("BH","bah");
omni_country_List[1]=new country_Class("JO","jor");
omni_country_List[2]=new country_Class("KW","kwt");
omni_country_List[3]=new country_Class("LB","leb");
omni_country_List[4]=new country_Class("OM","omn");
omni_country_List[5]=new country_Class("QA","qat");
omni_country_List[6]=new country_Class("SA","ksa");
omni_country_List[7]=new country_Class("SY","syr");
omni_country_List[8]=new country_Class("AE","uae");
omni_country_List[9]=new country_Class("IQ","iraq");
omni_country_List[10]=new country_Class("EG","egypt");
//Country Class for creating Country and Report Suite ID pair Arrays
function brand_Class(keey,vaalue1,vaalue2)
{
  this.keey=keey;
  this.vaalue1=vaalue1;
  this.vaalue2=vaalue2;
}

var omni_brand_List = new Array();
//omni_brand_List[0]=new brand_Class("999","corporate","corporatedev");
omni_brand_List[0]=new brand_Class("999","gmcorp","gmcorpdev");
omni_brand_List[1]=new brand_Class("018","Hummer","Hummerdev");
omni_brand_List[2]=new brand_Class("001","Chevy","Chevydev");
omni_brand_List[3]=new brand_Class("012","GMC","GMCdev");
omni_brand_List[4]=new brand_Class("015","SAAB","SAABdev");
omni_brand_List[5]=new brand_Class("019","Opel","Opeldev");
omni_brand_List[6]=new brand_Class("006","Cadillac","Cadillacdev");
//omni_brand_List[7]=new brand_Class("999","GMCorp","gmcorpdev");

var reportSuiteID="";

if(location.href.indexOf("/999/")>0) 
{
	
for(i=0;i<omni_brand_List.length;i++)
{
	if(env=="PRO")
	{
		if(omni_brandCd==omni_brand_List[i].keey)
			reportSuiteID=omni_brand_List[i].vaalue1;
	}
	if(env=="DEV")
	{
		if(omni_brandCd==omni_brand_List[i].keey)
			reportSuiteID=omni_brand_List[i].vaalue2;
	}
}

for(i=0;i<omni_country_List.length;i++)
{
	if(omni_ctryCd==omni_country_List[i].keey)
		//reportSuiteID=reportSuiteID+omni_country_List[i].vaalue;
		reportSuiteID="gmme"+omni_country_List[i].vaalue+"corporate";
}
}
else {
for(i=0;i<omni_country_List.length;i++)
{
	if(omni_ctryCd==omni_country_List[i].keey)
		reportSuiteID="gmme"+omni_country_List[i].vaalue;
}

for(i=0;i<omni_brand_List.length;i++)
{
	if(env=="PRO")
	{
		if(omni_brandCd==omni_brand_List[i].keey)
			reportSuiteID=reportSuiteID+omni_brand_List[i].vaalue1;
	}
	if(env=="DEV")
	{
		if(omni_brandCd==omni_brand_List[i].keey)
			reportSuiteID=reportSuiteID+omni_brand_List[i].vaalue2;
	}
}

}
//alert("from sitecat reportSuiteID is ="+reportSuiteID)

//document.write("Environment:"+env+"<br>")
//document.write("Brand Code:"+omni_brandCd+"<br>")
//document.write("Country Code :"+omni_ctryCd+"<br>")
//document.write("Report Suite ID:"+reportSuiteID)
//alert(reportSuiteID);
/* You may give each page an identifying name, server, and channel on
the next lines. */
s.pageName=omni_pageID
//alert(s.pageName)
s.server=""
s.channel=""
s.pageType=""
if(omni_langCd == "en")
{
	s.prop1=omni_langCd
	s.prop2=""
}
else
{
	s.prop1=""
	s.prop2=omni_langCd
}
//alert("prop1= "+s.prop1)
//alert("prop2= "+s.prop2)
s.prop3=""
s.prop4=""
s.prop5=""
/* E-commerce Variables */
s.campaign=""
s.state=""
s.zip=""
s.events=""
s.products=""
s.purchaseID=""
s.eVar1=""
s.eVar2=""
s.eVar3=""
s.eVar4=""
s.eVar5=""

/* --------- */

var refe="";
var pdcmp="";
var location1=self.location.href;

var params=location1.substring(location1.indexOf("?")+1);


if( params!=null)
{
	 params=unescape(params);

	if(params.indexOf("referrer")>=0 &&  params.indexOf("pdcmp")>=0){

		refe= params.substring( params.indexOf("referrer")+9, params.indexOf("pdcmp")-1);
		if(params.substring( params.indexOf("pdcmp")+6).length>0){
			 pdcmp=self.location.host+"?"+"pdcmp="+params.substring( params.indexOf("pdcmp")+6);
		}	

	}
}


s.referrer=refe;
s.pageURL=pdcmp;


/* --------- */



var s_account=reportSuiteID;
//alert("from sitecat reportSuiteID is = "+reportSuiteID)
s.linkInternalFilters="javascript:,."

/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)
<!--
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//-->
<!-- End SiteCatalyst code version: H.2. -->

function sendPropToOmniture(propNumber, propValue){
	var s=s_gi(s_account);
	s.linkTrackVars="prop"+propNumber.toString();
	s["prop"+propNumber] = propValue;
	s.tl(this, 'o', 'Prop');
}// fun. sendEventToOmniute