var j=7, sExtraFolders = '', sLoc = document.location.href, sLoc = sLoc.substr(0, (sLoc.indexOf('#')!=-1)?sLoc.indexOf('#'):sLoc.length), sLoc = sLoc.substr(0, (sLoc.indexOf('?')!=-1)?sLoc.indexOf('?'):sLoc.length), aLoc = sLoc.split("/"), aLocAlt = sLoc.split("/");
switch (aLoc[3].toLowerCase()){
	case 'arabic':
		j = 5;
		aLoc[5] = 'emea';
		aLoc[6] = 'ara';
		switch (aLoc[4]){
			case '','index.htm'		: aLoc[3] = 'corporate';	aLoc[4] = 'europe';		break;
			case 'education'		: aLoc[3] = 'corporate';	aLoc[4] = 'education';	break;
			case 'intel'			: aLoc[3] = 'corporate';	aLoc[4] = 'europe';		break;
			case 'pressroom'		: aLoc[3] = 'corporate';	aLoc[4] = 'pressroom';	break;
			case 'resources'		: aLoc[3] = 'corporate';	aLoc[4] = 'resources';	break;
			case 'solutions'		: aLoc[3] = 'corporate';	aLoc[4] = 'solutions';	break;
			case 'techtrends'		: aLoc[3] = 'corporate';	aLoc[4] = 'techtrends';	break;
			case 'products'			: aLoc[3] = 'products';		aLoc[4] = 'services';	break;
			default					: aLoc[3] = 'corporate';	aLoc[4] = 'europe';		break;
		}
		break;
	case 'sites':
		j = 5;
		aLoc[5] = 'emea';
		aLoc[6] = aLoc[4];
		aLoc[3] = 'corporate';
		aLoc[4] = 'europe';
		break;
	default:
		break;
}
for(var i=j; i<aLocAlt.length-1; i++){ sExtraFolders = sExtraFolders + '|' + aLocAlt[i]; }
var wa_geo		= aLoc[5]; //GEO
var wa_language	= aLoc[6]; //language
var wa_reportSuites = "intelcorpemea"; // added by 6287 job
var wa_org1		= 'emea'; //corp
var wa_org2		= aLoc[3]; //sitename
var wa_org3		= aLoc[4]; //subsite
var wa_org4		= wa_geo; //GEO
var wa_temp_s1	= wa_language + sExtraFolders + '|' + ((aLocAlt[aLocAlt.length-1]!='')?aLocAlt[aLocAlt.length-1]:'index.htm'); // temp string used below
var wa_orgX		= wa_temp_s1.substr(0,80); //language | following folders | <filename.htm>, trimmed when exceding 80 characters
var wa_temp_s2	= sLoc.split(aLocAlt[0]+'/'+aLocAlt[1]+'/'+aLocAlt[2]+'/').join(''); // temp string used below
var wa_pageName = wa_temp_s2.substr(((wa_temp_s2.length>80)?wa_temp_s2.length-80:0), wa_temp_s2.length) + ((aLocAlt[aLocAlt.length-1]!='')?'':'index.htm'); // complete URL without http://www.intel.com/ and trimmed when exceding 80 characters


switch (aLoc[3].toLowerCase()){
	case 'business':
    wa_reportSuites = "intelemeabus" + wa_language + ",intelemeabus" + ",intelcorpemea";
    break;
  case 'corporate':
    if (wa_org3=="techtrends") {wa_reportSuites = "intelemeabus" + wa_language + ",intelemeabus" + ",intelcorpemea";}
    else {wa_reportSuites = "intelcorpemea" + wa_language + ",intelcorpemea";}
    break;
  default:
    break;
}
//alert('Variables passed:\n\nwa_geo = ' + wa_geo + '\nwa_language = ' + wa_language + '\nwa_reportSuites = ' + wa_reportSuites + '\nwa_org1 = ' + wa_org1 + '\nwa_org2 = ' + wa_org2 + '\nwa_org3 = ' + wa_org3 + '\nwa_org4 = ' + wa_org4 + '\nwa_orgX = ' + wa_orgX + '\nwa_pageName = ' + wa_pageName);

function get_campaign_var(){  
var cv1=(typeof wa_queryObj.ppc_cid == "undefined") ? "" : wa_queryObj.ppc_cid;
var cv2=(typeof wa_queryObj.cid == "undefined") ? "" : wa_queryObj.cid;
if (cv1){return cv1} else if (cv2){return cv2} else{return ""};
}

function sendAnalyticsEvent(accnt){	
accnt=accnt?accnt:wa_reportSuites;void(s_gs(accnt))
}

function sendLinkEvent(accnt,lnkname,type){	
accnt=accnt?accnt:wa_reportSuites;s_linkType=type?type:"o";s_lnk=true;
s_linkName=lnkname?lnkname:s_linkName?s_linkName:"Flash Link Event";
void(s_gs(accnt));
}

var wa_campaign=get_campaign_var();