// settings
var gDomain="statse.webtrendslive.com";
var gDoms="construction.com,platts.com,aviationweek.com";

// site settings
var wt_business_unit = "mhc";
var wt_site = "mwst";

// get page href
var host_href = window.location.href.toLowerCase();

// set site id
//[if] ? [Prod site] : [QA site]
var gDcsId = (host_href.indexOf("http://midwest")==0 || host_href.indexOf("https://midwest")==0 ||
	host_href.indexOf("http://www.midwest")==0 || host_href.indexOf("https://www.midwest")==0) ? 
	"dcs2ovlss100008qtuuwr0iny_2l5r" : "dcs56zyxi00000spued8e5l9r_7v6m";

var DCS=new Object();
var WT=new Object();
var DCSext=new Object();

// Code section for Set the First-Party Cookie domain
//var gFpcDom="@@FPC Cookie TOP LEVEL DOMAIN (beginning with a '.'@@";
var gFpc="WT_FPC";
var gConvert=true;
if ((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
	document.write("<SCR"+"IPT TYPE='text/javascript' SRC='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+"/"+gDcsId+"/wtid.js"+"'><\/SCR"+"IPT>");
}

// customized web-trends code section
var wt_href_items = host_href.split("/");
var wt_page_name = wt_href_items[wt_href_items.length-1];
wt_page_name = (wt_page_name==null || wt_page_name=='') ? "default" : wt_page_name;
var wt_content_group = (wt_href_items.length > 4) ? wt_href_items[3] : "none";
var wt_content_sub_group = (wt_href_items.length > 5) ? wt_href_items[4] : "none";

// for home page
if((wt_page_name == "default" | wt_page_name == "default.asp") & wt_content_group == "none") { wt_content_group = "homepage"; }

// create DCSext.wt_uri variable
DCSext.wt_uri = window.location.pathname;

// create WT.cg_n variable
WT.cg_n = wt_business_unit + "_" + wt_site + "|" + wt_content_group;

// create WT.cg_s variable
WT.cg_s = wt_content_sub_group

// create WT.ti variable (bu|site|content group|detail)
//WT.ti= wt_business_unit + "|" + wt_site + "|" + wt_content_group + "|" + wt_content_sub_group  + "|" + wt_page_name;
WT.ti= wt_business_unit + "|" + wt_site + "|";

// if user signed in: create WT.seg_1, DCS.dcsaut, WT.dcsvid variables
if (typeof(window['sso_id']) != "undefined") {
	WT.seg_1='registered';
	DCS.dcsaut=sso_id;
	WT.dcsvid=sso_id;
}

// if user signed in: create WT.seg_3 variable
if (typeof(window['sso_firm_type']) != "undefined") {
	WT.seg_3 = sso_firm_type;
}

// if user signed in: create WT.seg_4 variable
if (typeof(window['sso_industry_role']) != "undefined") {
	WT.seg_4 = sso_industry_role;
}