function getContType(portal)
{	

	if (typeof(IHSContentType) == 'undefined')
	{
		switch (portal)
		{
			case "corporate" :
				return "corporate";
			break
			case "store" : 
			case "global" :
			case "atp":
			case "esdu":
				return "support";
			break;
			default :
				var pathseparated = s.split(window.location.pathname,"/");
				var defaultContentType = ((pathseparated.length > 2)?pathseparated[1].toLowerCase():"frontdoor");
				return ((defaultContentType == "document" || defaultContentType == "abstracts") ? "collections" : defaultContentType);
			break;			
		}
	}
	else
		return (IHSContentType)
}

function getChannel(portal)
{
	switch (portal)
	{
		case "corporate" :
			var pathseparated = s.split(window.location.pathname,"/");
			return ((pathseparated.length > 2)?pathseparated[1].toLowerCase():"frontdoor");
		break
		case "store" : case "global" : case "atp" : case "esdu" :
			return "store";
		break;
		case "canada": case "china" : case "uk" : case "france": case "germany" : case "mexico" : case "italia" : case "cis":
			return "regional";
		break;
		default :
			return "industries";
		break;
	}
}

/* You may give each page an identifying name, server, and channel on
the next lines. */
if (portal == "store")
	s.pageName= "store:"+document.title // use document title for store
else
	s.pageName="" // Set using plugin for all others
s.server=""  // Leave null. It would duplicate portal name
s.channel=getChannel(portal) //Channel
s.pageType=pageTypeIHS  // Only set to errorPages on error
s.prop1=getContType(portal) //Content type
s.prop2=portal		   //Portal name. Set using code in s_local.js
s.prop3=s.prop2+":"+s.prop1 //Portal Name:Content Type
s.prop4="" //Leave empty. Set via a VISTA rule.

s.prop6=searchKeyword //Searched keyword. The js variable only exists in search pages
s.prop7=totalSearchCount //# of results found for the search. The js variable only exists in search pages

/* E-commerce Variables */
s.campaign="" //Set via plugin
/* The following variables are only set in the stores*/
s.state=orderState
s.zip=orderZip
s.purchaseID=orderPurchaseID

// This variable is set for search, page viewing, and checkout process
s.products=productsIHS

s.events=pageEvents    // This should be set page by page depending on the events triggered

s.eVar1=s.prop1 //Content Type
s.eVar2=s.prop2 //Portal Name
s.eVar3=s.prop3 //Portal Name : Content type
s.eVar4="" //Set with a VISTA Rule
s.eVar6=s.prop6 
s.eVar7=s.prop7

s.eVar14=findingMethod
s.eVar17=orderPurchaseID
s.eVar18=customerIDIHS
s.eVar19=shippingCountry
s.eVar20=paymentType

/* Hierarchy Variables */
s.hier1="" //Leave empty

/************* 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')+'\!-'+'-')

/*********************** FORM ANALYSIS SECTION **********************/
/*if ((typeof(FAEventType) != 'undefined') && (typeof(FAPageName) != 'undefined') && (typeof(FAFormName) != 'undefined')) {
	if (typeof(FAElementError) != 'undefined')
		s.sendFormEvent(FAEventType, FAPageName, FAFormName, FAElementError);
	else
		s.sendFormEvent(FAEventType, FAPageName, FAFormName);
}*/
