/********************************************************************************/
/* SiteCatalyst code version: H.20.3.                                                                                                          */
/* Copyright 1997-2009 Omniture, Inc. More info available at                                                                      */
/* http://www.omniture.com                                                                                                                       */
/********************************************************************************/

// Setting the page name to the URL - it is all we have at this point
s.pageName = document.title
var TE_pageRe = new RegExp("^(.+) - Tyco Electronics$","ig");
 // check the page name to see if it ends with Tyco Electronics
if (TE_pageRe.test(s.pageName))
{
	// matched, so now replace s_pageName with just the value at the begining
	s.pageName=s.pageName.replace(TE_pageRe, "$1");
}

s.server=""
s.channel=""
s.pageType=""
s.prop1=""
s.prop2=""
s.prop3=""
s.prop4=""
s.prop5=""
/* Conversion Variables */
s.campaign=""
s.state=""
s.zip=""
s.events=""
s.products=""
s.purchaseID=""
s.eVar1=""
s.eVar2=""
s.eVar3=""
s.eVar4=""
s.eVar5=""

/************************** CONFIG SECTION **************************/
/* You may add or alter any code config here. */
s.charSet="UTF-8"
/* Conversion Config */
s.currencyCode="USD"
/* Link Tracking Config */
s.trackDownloadLinks=true
s.trackExternalLinks=true
s.trackInlineStats=true
s.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls,tar,gz,tif,tiff,tgz"
s.linkLeaveQueryString=false
s.linkTrackVars="None"
s.linkTrackEvents="None"

s.cookieDomainPeriods="2"

/* Used to determine whether user left a particular domain in our control to another domain in our control, 
   for example leaving tycoelectronics.com to go to elotouch.com domain */
var TE_baseHostName = new String(window.location.hostname);
var TE_hostNameArray
/* split the hostname into pieces, want to get the primary domain */
TE_hostNameArray = TE_baseHostName.split(".");

/* walk the hostname right to left and find the index of the first non-suffix part, i.e. not com, or co, etc.  The key is
that all suffixes are three or less characters, so we can stop checking for whether it is a suffix once the length is > than three, 
will collect the  entire name if every part of the hostname is  3 characters long or less*/
var firstIndex = 0;
for( i=TE_hostNameArray.length-1; i >= 0; i--){
	var tmpString = new String(TE_hostNameArray[i]);
	if( tmpString.length > 3){
		firstIndex = i;
		i=0;
	}
}

/* put the pieces of the hostname back together left to right  */
TE_baseHostName = "";
for( i=firstIndex; i < TE_hostNameArray.length; i++){
	TE_baseHostName = TE_baseHostName + TE_hostNameArray[i]
	if( i < TE_hostNameArray.length-1){
		TE_baseHostName = TE_baseHostName + '.'
	}

}
// add the shortened hostname to the s_linkInternalFilters so that when we go to pages in that same overall domain
// SiteCatalyst doesn't report it as an exit.
s.linkInternalFilters="javascript:,"+TE_baseHostName

/* Plugin Config */
s.usePlugins=true
function s_doPlugins(s) {
	/* Add calls to plugins here */
	s.campaign = s.getQueryParam('s_cid');
	/*Populate s.prop50 for campaign page pathing*/
	if(s.campaign !=null && s.campaign.length>0){
		s.prop50=s.pageName+":"+s.campaign
		/****BELOW IS NOT SITECATALYST LOGIC AND NEEDS TO BE TAKEN CARE DURING SC UPGRADE.****/
		/*This code writes the campaign ID to session cookie for RN*/
		document.cookie="s_cid="+s.campaign+";path=/;"+";domain=.tycoelectronics.com;";
	}
	else {
		s.prop50=s.pageName
	}
	
}
s.doPlugins = s_doPlugins;

/****************************************************************/
/*     reset the s_account dynamically                                                                         */
/*                                                                                                                            */
/****************************************************************/
s.dynamicAccountSelection=true;
s.dynamicAccountList="tycoeglobal,tycotycoejapan=www.tycoelectronics.com/japan;"+
"tycoeglobal,tycoecatalog=ebzasp01.tycoelectronics.com/catalog/ToolingXrefWeb,www.tycoelectronics.com/catalog/ToolingXrefWeb;"+
"tycoeglobal,tycoecatalog=catalog.tycoelectronics.com,www.tycoelectronics.com/catalog;"+
"tycoeglobal,tycoecatalog=ecommas.tycoelectronics.com/commerce/DocumentDelivery,www.tycoelectronics.com/commerce/DocumentDelivery;"+
"tycoeglobal,tycoecatalog=ecommas.tycoelectronics.com/commerce/pcr,www.tycoelectronics.com/commerce/pcr;"+
"tycoeglobal,tycoecatalog=ecommas.tycoelectronics.com/commerce/alt,www.tycoelectronics.com/commerce/alt;"+
"tycoeglobal,tycoecommerce,tycopcn=ecommas.tycoelectronics.com/commerce/pcnws,www.tycoelectronics.com/commerce/pcnws;"+
"tycoeglobal,tycoecommerce=ecommerce.tycoelectronics.com/commerce,ecommas.tycoelectronics.com/commerce,www.tycoelectronics.com/commerce;"+
"tycoeglobal=search.tycoelectronics.com;"+
"tycoeglobal,tycoaerospace=www.tycoelectronics.com/industry/aerospace;"+
"tycoeglobal,tycomedical=www.tycoelectronics.com/industry/medical;"+
"tycoeglobal,tycoautomotive=www.tycoelectronics.com/automotive;"+
"tycoeglobal,tycolighting=www.tycoelectronics.com/lighting;"+
"tycoeglobal,tycoemain=www.tycoelectronics.com;"+
"tycoeglobal,tycoerelays=relays.tycoelectronics.com;"+
"tycoeglobal,tycoemicrodotconnectors=www.microdotconnectors.com;"+
"tycoeglobal,tycoetooling=tooling.tycoelectronics.com;"+
"tycoeglobal,tycoecircuitprotection=www.circuitprotection.com;"+
"tycoeglobal,tycoecorcom=www.cor.com,www.corcom.com;"+
"tycoeglobal,tycoeidentification=identification.tycoelectronics.com;"+
"tycoeglobal,tycoeenergy=energy.tycoelectronics.com;"+
"tycoeglobal,tycoalternativeenergy=www.tycoelectronics.com/solar,www.tycoelectronics.com/wind;"+
"tycoeglobal,tycoeraychem=raychem.tycoelectronics.com,www.raychem.com;"+
"tycoeglobal,tycoepassives=passives.tycoelectronics.com;"+
"tycoeglobal,tycoeampnetconnect=www.ampnetconnect.com;"+
"tycoeglobal,tycoeloar=elotouch.com.ar;"+
"tycoeglobal,tycoelobr=elotouch.com.br;"+
"tycoeglobal,tycoelomain=www.elotouch.com;"+
"tycoeglobal,tycoelocorner=corner.elotouch.com;"+
"tycoeglobal,tycoelode=elotouch.de;"+
"tycoeglobal,tycoeloexpress=elotouchexpress.com;"+
"tycoeglobal,tycoeloexpressbe=elotouchexpress.be;"+
"tycoeglobal,tycoelofr=elotouch.fr;"+
"tycoeglobal,tycoelogaming=elogaming.com;"+
"tycoeglobal,tycoelouk=elotouch.co.uk;"+
"tycoeglobal,tycoelojp=www.tps.co.jp;"+
"tycoeglobal,tycoapptool=www.applicationtooling.com;"+
"tycoeglobal,tycocomacc=www.comacc.co.uk;"+
"tycoeglobal,tycoesupplier=supplierportal.tycoelectronics.com,supplier.tycoelectronics.com,ecommerce.tycoelectronics.com/supplier;"+
"tycoeglobal,tycomacomwireless=www.macom-wireless.com;"+
"tycoeglobal,tycotelecomosp=www.telecomosp.com;"+
"tycoeglobal,tycoecommchannelxraychem=raychem-cx.tycoelectronics.com;"+
"tycoeglobal,tycoecommchannelxgicus=gic-us-cx.tycoelectronics.com;"+
"tycoeglobal,tycoecommchannelxgiccx=gic-cx.tycoelectronics.com;"+
"tycoeglobal,tycotops=tops.us.tycoelectronics.com;"+
"tycoeglobal,tycorts=requesttracking.us.tycoelectronics.com;"+
"devtyco=dev,topstest,requesttrackingtest,muruganp;"+
"devtyco=qa;"+
"tycoeglobal=."

s.dynamicAccountMatch=window.location.host+window.location.pathname;

/************************** End SiteCatalyst *************************/
