var portal = "";
function getAccount()
{	
	var h = window.location.hostname;
	var i = h.indexOf('.');
	var c = h.substring(0,i);
	var account = "";
	switch (c)
	{
		case "www": 
			afterwww = h.substring(i+1,i+7);
			switch(afterwww)
			{
			/*case "asme20": // for www.asme2007.com
				account = "ihsasme2007";
			break;*/
			case "global": // for www.global.ihs.com
				account = "ihsrollup,ihsglobal";
			break;
			case "ihsatp": //for www.ihsatp.com
				account = "ihsrollup,ihsatp";
				portal = "atp";
			break;
			case "ihsesdu": //for www.ihsesdu.com
				account = "ihsrollup,ihsesdu";
				portal = "esdu";				
			break;
			case "esdu": //for www.esdu.com
				account = "ihsrollup,ihsesdu";
				portal = "esdu";				
			break;				
			case "ihs.co": // It was just www.ihs.com
				account = "ihsrollup,ihsprod";
			break;
			default:
				account = "ihsrollupdev,ihsdev";
			break;
			}
		break;
		
		case"ihs":
			account = "ihsrollup,ihsprod";
			portal = "corporate";
		break;
		
		case"aec":
		case"aero":
		case"africa":
		case"arabic":
		case"auto":
		case"canada":
		case"cis":
		case"electronics":
		case"energy":
		case"engineers":
		case"france":
		case"germany":
		case"global":
		case"government":
		case"haystack":
		case"italia":		
		case"necis":
		case"mexico":
		case"msds":
		case"parts":
		case"petro":
		case"retail":		
		case"solutions":
		case"uk":
		case"public-safety":
			account = "ihsrollup,ihs"+c;
		break;
		
		case "aero-defense":
			account = "ihsrollup,ihsaerodefense";
			portal = "aerodefense";
		break;		
		case"china":
			account = "ihsrollup,ihschina2";
		break;
		case "engineers1":
			account = "ihsrollup,ihsengineers";
			portal = "engineers";
		break;
		case "esdu":
			account = "ihsrollup,ihsusaesdu";
			portal = "esdu";
		break;				
		case "foodreview":
			account = "ihsrollup,ihsafrica";
			portal = "africa";
		break;
		case "packagingreview":
			account = "ihsrollup,ihsafrica";
			portal = "africa";
		break;		
		case "newsletter":
			account = "ihsrollup,ihsengineers";
			portal = "engineers";
		break;
		case "partsearch":
			account = "ihsrollup,ihsparts";
			portal = "parts";
		break;		
		case "payment":
			account = "ihsrollup,ihsatp";
			portal = "atp";
		break;
		
        case "store":
            account = "ihsrollup,ihsstore";
            portal = "store";
        break;

        case "products":
             account = "ihsrollup,ihsproducts";
             portal = "products";
        break; 
		default:
			account = "ihsrollupdev,ihsdev";
		break;
	}
	return account;
}

var omnitureAccount=getAccount();

/* Initialize all the variables if they have not yet been defined*/
if (typeof(searchKeyword) == 'undefined')
	var searchKeyword = "";
if (typeof(totalSearchCount) == 'undefined')
	var totalSearchCount = ""; 
if (typeof(pageEvents) == 'undefined')
	var pageEvents = "";
if (typeof(productsIHS) == 'undefined')
	var productsIHS = "";
if (typeof(orderState) == 'undefined')
	var orderState = "";
if (typeof(orderZip) == 'undefined')
	var orderZip = "";
if (typeof(orderPurchaseID) == 'undefined')
	var orderPurchaseID = "";
if (typeof(customerIDIHS) == 'undefined')
	var customerIDIHS = "";
if 	(typeof(pageTypeIHS) == 'undefined')
	var pageTypeIHS = "";
if 	(typeof(shippingCountry) == 'undefined')
	var shippingCountry = "";
if 	(typeof(paymentType) == 'undefined')
	var paymentType = "";
if 	(typeof(findingMethod) == 'undefined')
	var findingMethod = "";


/* Initialize and set forms list. Allow dynamic additions */
SiteDefaultList = "register,membership,submit_order_form,OrderDetailsJSP";

if 	(typeof(IHSFormList) == 'undefined')
	var IHSFormList = SiteDefaultList;
else
	IHSFormList = SiteDefaultList+","+IHSFormList
	
/* Define the portal variable dynamically in case it has not been defined above*/
if (portal == ""){
	var subDomain= (window.location + "").match(/(www\.)?([^\/.]*)?(\.ihs\.com.*)/)[2];
	if (subDomain == "www" || subDomain == "ihs")
		portal = "corporate";
	else
		portal = subDomain;
}
