function hbxStrip(a)
{
     a = a.split("|").join("");
     a = a.split("&").join("");
     a = a.split("'").join("");
     a = a.split("#").join("");
     a = a.split("$").join("");
     a = a.split("%").join("");
     a = a.split("^").join("");
     a = a.split("*").join("");
     a = a.split(":").join("");
     a = a.split("!").join("");
     a = a.split("<").join("");
     a = a.split(">").join("");
     a = a.split("~").join("");
     a = a.split(";").join("");
     a = a.split(" ").join("+");	
	 a = a.split("’").join(""); 
     return a;

}

var _hbEC=0,_hbE=new Array;function _hbEvent(a,b){b=_hbE[_hbEC++]=new Object();b._N=a;b._C=0;return b;}
var hbx=_hbEvent("pv");hbx.vpc="HBX0100u";hbx.gn="ehg-theheritagefoundation.hitbox.com";

var str = document.location.toString();
str = str.toLowerCase();


var number_1 = str.lastIndexOf('/') + 1 
//var number_2 = str.lastIndexOf('.')
//var number_3 = str.length

//var sFileName = str.substring(number_1, number_3) 
var sPNTitle = document.title;
var sCategory = str.substring(23, number_1);
var sDomain = (str.substring(0,24));

//for the heritage.org site.
if ((sDomain != 'http://new.heritage.org/') && (sDomain != 'http://www.heritage.org/')  && (sDomain != 'http://heritage.org/'))
{
	sCategory = "Other";
}

//Speciality Categories
if (sCategory == "")
{
	sCategory = "";
}
if (sCategory == "/research/")
{
	sCategory = "/Research";
}

else if (sCategory == "/Index/")
{
	sCategory = "/Features/Index";
	sPNTitle = sPNTitle.replace("Index of Economic Freedom - 2007","");
}

else if (sCategory == "/research/features/index/")
{
	sCategory = "/Features/Index";
	sPNTitle = sPNTitle.replace("Index of Economic Freedom - 2007","");
}

else if (sCategory == "/research/features/index/chapters/")
{
	sCategory = "/Features/Index";
	sPNTitle = sPNTitle.replace("Index of Economic Freedom - 2007","");
}

else if (sCategory == "/research/features/index/chapters/htm/")
{
	sCategory = "/Features/Index";
	sPNTitle = sPNTitle.replace("Index of Economic Freedom - 2007","");
}

else if (sCategory.substring(0,35) == "/research/features/budgetchartbook/")
{
	sCategory = "/Features/BudgetCB";
	sPNTitle = sPNTitle.replace("Budget Chart Book:","");
	sPNTitle = sPNTitle.replace("Federal Revenue Chart -","");
	sPNTitle = sPNTitle.replace("Taxes and Tax Rates Charts -","");
	sPNTitle = sPNTitle.replace("Federal Spending Chart -","");	
	sPNTitle = sPNTitle.replace("Revenue and Spending Chart -","");
	sPNTitle = sPNTitle.replace("Projected Spending Chart -","");
}
else if (sCategory.substring(0,24) == "/customcf/sendtoafriend/")
{
	sCategory = "SendToAFriend";
}
else if ((sCategory == "/research/education/schoolchoice/")  || (sCategory == "/research/education/schools/"))
{
	sCategory = "/Features/SchChoice";
	sPNTitle = sPNTitle.replace("School Choice: ","");
	sPNTitle = sPNTitle.replace("School Choice 2003 ","");
}

// Features
else if (sCategory == "/research/features/economywatch/")
{
	sCategory = "/Features/EcoWatch";
	sPNTitle = sPNTitle.replace("Economy Watch: ","");
}
else if (sCategory == "/research/features/familydatabase/")
{
	sCategory = "/Features/FSDB";
	sPNTitle = sPNTitle.replace("Heritage Foundation: ","");
	sPNTitle = sPNTitle.replace("Family Database: ","");
}
else if (sCategory == "/research/features/nationalsecurity/")
{
	sCategory = "/Features/NatlSec";
	sPNTitle = sPNTitle.replace("The Heritage Foundation: ","");
}
else if (sCategory == "/research/features/issues2004/")
{
	sCategory = "/Features/Issues";
	sPNTitle = sPNTitle.replace("Issues 2004-","");
	sPNTitle = sPNTitle.replace("Issues in Brief - ","");
}
else if (sCategory == "/research/features/issues/")
{
	sCategory = "/Features/Issues";
	sPNTitle = sPNTitle.replace("Issues 2006:","");
}
else if (sCategory == "/research/features/issues/issuearea/")
{
	sCategory = "/Features/Issues";
	sPNTitle = sPNTitle.replace("Issues 2006:","");
}
else if (sCategory == "/research/features/almanac/")
{
	sCategory = "/Features/Almanac";
	sPNTitle = sPNTitle.replace("The Founders' Almanac --- ","");
	sPNTitle = sPNTitle.replace(" --- The Heritage Foundation","");
	sPNTitle = sPNTitle.replace("'","");
}
else if (sCategory == "/research/features/appropriations/")
{
	sCategory = "/Features/Appropriations";
}
else if (sCategory == "/research/features/familyof4/")
{
	sCategory = "/Features/FamilyOf4";
}
else if (str == "http://www.heritage.org/Research/GovernmentReform/FedBook.cfm")
{
	sCategory = "/Features/FedGrantGuide";
}
else if (str == "http://www.heritage.org/Press/policywire.cfm")
{
	sCategory = "/Press/PolicyWire";
}
else if (sCategory == "/research/features/presidentsessay/")
{
	sCategory = "/Features/PresEssay";
}
else if (sCategory == "/research/features/mandate/2005/")
{
	sCategory = "/Features/Mandate";
	sPNTitle = sPNTitle.replace("Mandate for Leadership: ","");
}
else if (sCategory == "/research/features/regwatch/")
{
	sCategory = "/Features/RegWatch";
}
else if (sCategory == "/research/features/socialsecurity/")
{
	sCategory = "/Features/SocSecCalc";
}
else if (sCategory == "/research/features/taxcalculator/")
{
	sCategory = "/Features/TaxCalc";
}
else if (sCategory == "/research/features/socialsecurity/")
{
	sCategory = "/Features/PRACalc";	
}


//Research Categories
else if (sCategory == "/research/abstinence/")
	{
		sCategory = "/Research/Domestic/Abstinence";
	}
else if (sCategory == "/research/agriculture/")
	{
		sCategory = "/Research/Domestic/Agriculture";
	}
else if (sCategory == "/research/americanfoundingandhistory/")
	{
		sCategory = "/Research/Domestic/AmerFounding";
	}
else if (sCategory == "/research/crime/")
	{
		sCategory = "/Research/Domestic/Crime";
	}
else if (sCategory == "/research/economy/")
	{
		sCategory = "/Research/Domestic/Economy";
	}
else if (sCategory == "/research/education/")
	{
		sCategory = "/Research/Domestic/Education";
	}
else if (sCategory == "/research/energyandenvironment/")
	{
		sCategory = "/Research/Domestic/Energy";
	}
else if (sCategory == "/research/family/")
	{
		sCategory = "/Research/Domestic/Family";
	}
else if (sCategory == "/research/family/marriagedebate/")
	{
		sCategory = "/Research/Domestic/MarriageDebate";
	}
else if (sCategory == "/research/family/marriage50/")
	{
		sCategory = "/Research/Domestic/Marriage50States";
	}
else if (sCategory == "/research/family/marriage/")
	{
		sCategory = "/Research/Domestic/Marriage";
	}	
	
else if (sCategory == "/research/features/marriage/")
	{
		sCategory = "/Features/MarriageCharts";
	}
	
else if (sCategory == "/research/budget/")
	{
		sCategory = "/Research/Domestic/Budget";
	}
else if (sCategory == "/research/governmentreform/")
	{
		sCategory = "/Research/Domestic/GovReform";
	}
else if (sCategory == "/research/healthcare/")
	{
		sCategory = "/Research/Domestic/HealthCare";
	}
else if (sCategory == "/research/immigration/")
	{
		sCategory = "/Research/Domestic/Immigration";
	}
else if (sCategory == "/research/labor/")
	{
		sCategory = "/Research/Domestic/Labor";
	}
else if (sCategory == "/research/legalissues/")
	{
		sCategory = "/Research/Domestic/LegalIssues";
	}
else if (sCategory == "/research/politicalphilosophy/")
	{
		sCategory = "/Research/Domestic/PolPhil";
	}
else if (sCategory == "/research/regulation/")
	{
		sCategory = "/Research/Domestic/Regulation";
	}
else if (sCategory == "/research/religion/")
	{
		sCategory = "/Research/Domestic/Religion";
	}
else if (sCategory == "/research/smartgrowth/")
	{
		sCategory = "/Research/Domestic/Transportation";
	}
else if (sCategory == "/research/socialsecurity/")
	{
		sCategory = "/Research/Domestic/SocialSecurity";
	}
else if (sCategory == "/research/taxes/")
	{
		sCategory = "/Research/Domestic/Taxes";
	}
else if (sCategory == "/research/urbanissues/")
	{
		sCategory = "/Research/Domestic/UrbanIssues";
	}
else if (sCategory == "/research/welfare/")
	{
		sCategory = "/Research/Domestic/Welfare";
	}
else if (sCategory == "/research/africa/")
	{
		sCategory = "/Research/Foreign/Africa";
	}
else if (sCategory == "/research/asiaandthepacific/")
	{
		sCategory = "/Research/Foreign/Asia";
	}
else if (sCategory == "/research/nationalsecurity/")
	{
		sCategory = "/Research/Foreign/Defense";
	}
else if (sCategory == "/research/europe/")
	{
		sCategory = "/Research/Foreign/Europe";
	}
else if (sCategory == "/research/homelanddefense/")
	{
		sCategory = "/Research/Foreign/HomelandDef";
	}
else if (sCategory == "/research/internationalorganizations/")
	{
		sCategory = "/Research/Foreign/IntlOrgs";
	}
else if (sCategory == "/research/latinamerica/")
	{
		sCategory = "/Research/Foreign/LatinAmer";
	}
else if (sCategory == "/research/middleeast/")
	{
		sCategory = "/Research/Foreign/MidEast";
	}
else if (sCategory == "/research/middleeast/iraq/")
	{
		sCategory = "/Research/Foreign/MidEast/Iraq";
	}
else if (sCategory == "/research/russiaandeurasia/")
	{
		sCategory = "/Research/Foreign/Eurasia";
	}
else if (sCategory == "/research/thought/")
	{
		sCategory = "/Research/Domestic/AmerPolThought";
	}
else if (sCategory == "/research/tradeandforeignaid/")
	{
		sCategory = "/Research/Foreign/Trade";
	}
//End Research categories
else if (sCategory == "/press/dailybriefing/")
{
	sCategory = "/Features/PolicyBlog";
}
else if (sCategory == "/press/commentary/")
{
	sCategory = "/Press/Commentary";
}
else if (sCategory == "/press/mediacenter/")
{
	sCategory = "/Press/Media Center";
}
else if (sCategory == "/press/carr/")
{
	sCategory = "/Press/CARR";
}
else if (sCategory == "/press/events/")
{
	sCategory = "/Press/Events";
}
else if (sCategory == "/about/")
{
	sCategory = "/About";
}
else if (sCategory == "/about/bookstore/")
{
	sCategory = "/About/Bookstore";
}
else if (sCategory == "/about/departments/")
{
	sCategory = "/About/Departments";
}
else if (sCategory == "/about/staff/")
{
	sCategory = "/About/Staff";
}
else if (sCategory == "/about/community/")
{
	sCategory = "/About/Community";
}
else if (sCategory == "/about/careers/")
{
	sCategory = "/About/Careers";
}
else if (sCategory == "/about/jobbank/")
{
	sCategory = "/About/Job Bank";
}
else if (sCategory == "/about/internships/")
{
	sCategory = "/About/Internships";
}

//Other Special Cases
else if (str == "http://www.heritage.org/research/features/abmstudy.cfm")
{
	sCategory = "/Features/Ballistic";
}
else if (str == "http://www.heritage.org/Research/Middleeast/iranbriefingroom.cfm")
{
	sCategory = "/Features/IranBriefingRoom";
}
else if (str == "http://www.socialsecurityreform.org/index.cfm")
{
	sCategory = "/HeritageRelatedSite/SocialSecurityReform";
}
else if (str == "http://www.myheritagemedia.org/gallery2.asp")
{
	sCategory = "/HeritageRelatedSite/MyHeritageMedia";
}
else if (str == "http://blog.nationalsecurity.org")
{
	sCategory = "/HeritageRelatedSite/NationalSecurityBlog";
}

// Final
else 
{
	sCategory = "/Other";
}

//for the blogs.
var sBlogDomain = (str.substring(0,31));

if (sBlogDomain == 'http://policy.heritageblogs.org')
{
	sCategory ="/Features/blogs/policy";
}

else if (sBlogDomain == 'http://linked.heritageblogs.org')
{
	sCategory ="/Features/blogs/linked";
}

sPNTitle = hbxStrip(sPNTitle);

//BEGIN EDITABLE SECTION
//CONFIGURATION VARIABLES
hbx.acct="DM550914DEVR";//ACCOUNT NUMBER(S)
//hbx.pn= sFileName;//PAGE NAME(S)
hbx.pn=sPNTitle;
hbx.mlc=sCategory;//MULTI-LEVEL CONTENT CATEGORY
// hbx.pndef=hbxStrip(document.title);//DEFAULT PAGE NAME
hbx.pndef="title"; // Changed value of hbx.pndef per request from HBX engineers. TO 
hbx.ctdef="full";//DEFAULT CONTENT CATEGORY

//OPTIONAL PAGE VARIABLES
//ACTION SETTINGS
hbx.fv="";//FORM VALIDATION MINIMUM ELEMENTS OR SUBMIT FUNCTION NAME
hbx.lt="auto";//LINK TRACKING
hbx.dlf="n";//DOWNLOAD FILTER
hbx.dft="n";//DOWNLOAD FILE NAMING
hbx.elf="n";//EXIT LINK FILTER

//SEGMENTS AND FUNNELS
hbx.seg="";//VISITOR SEGMENTATION
hbx.fnl="";//FUNNELS

//CAMPAIGNS
hbx.cmp="";//CAMPAIGN ID
hbx.cmpn="";//CAMPAIGN ID IN QUERY
hbx.dcmp="";//DYNAMIC CAMPAIGN ID
hbx.dcmpn="";//DYNAMIC CAMPAIGN ID IN QUERY
hbx.dcmpe="";//DYNAMIC CAMPAIGN EXPIRATION
hbx.dcmpre="";//DYNAMIC CAMPAIGN RESPONSE EXPIRATION
hbx.hra="";//RESPONSE ATTRIBUTE
hbx.hqsr="";//RESPONSE ATTRIBUTE IN REFERRAL QUERY
hbx.hqsp="";//RESPONSE ATTRIBUTE IN QUERY
hbx.hlt="";//LEAD TRACKING
hbx.hla="";//LEAD ATTRIBUTE
hbx.gp="";//CAMPAIGN GOAL
hbx.gpn="";//CAMPAIGN GOAL IN QUERY
hbx.hcn="";//CONVERSION ATTRIBUTE
hbx.hcv="";//CONVERSION VALUE
hbx.cp="null";//LEGACY CAMPAIGN
hbx.cpd="";//CAMPAIGN DOMAIN

//CUSTOM VARIABLES
hbx.ci="";//CUSTOMER ID
hbx.hc1="";//CUSTOM 1
hbx.hc2="";//CUSTOM 2
hbx.hc3="";//CUSTOM 3
hbx.hc4="";//CUSTOM 4
hbx.hrf="";//CUSTOM REFERRER
hbx.pec="";//ERROR CODES
