//check site for Beacom Tracking
var BeaconTrackSite,pos,numPos,everythingAfterUrl;
BeaconTrackSite = document.URL;

if(BeaconTrackSite.indexOf(encodeURI(WEBSITE_CO_GLOBEINVESTOR_DB)) > -1 || 
BeaconTrackSite.indexOf(encodeURI(WEBSITE_CO_GLOBEINVESTOR)) > -1 || 
BeaconTrackSite.indexOf(encodeURI(WEBSITE_TGAM_SECURE)) > -1 || 
BeaconTrackSite.indexOf(encodeURI(WEBSITE_TGAM)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_FINANCE)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_FINANCE_FUND)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_FINANCE_PORTFOLIO)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_ROB)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_TGAM_SECURE)) > -1 || 
BeaconTrackSite.indexOf(encodeURI(WEBSITE_TGAM)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_IMAGES)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_CARS)) > -1 ||
BeaconTrackSite.indexOf(encodeURI(WEBSITE_SPORTS)) > -1)
{
	if(BeaconTrackSite.indexOf("https://") > -1){
		numPos = "8";
		pos = BeaconTrackSite.indexOf("https://");
	}else{
		numPos = "7";
		pos = BeaconTrackSite.indexOf("http://");
	}
	//console.log(numPos);
	//console.log(pos);
	
	everythingAfterUrl = BeaconTrackSite.substring(pos+numPos,BeaconTrackSite.length);	
	document.write("<img id='img1' height='1' width='1'>");document.getElementById("img1").src="http://beacon.scorecardresearch.com/scripts/beacon.dll?C1=2&C2=3005664&C3=3005664&C4=" + everythingAfterUrl + " &C5=&C6=&C7=" + escape(window.location.href) + "&C8=" + escape(document.title) + "&C9=" + escape(document.referrer) + "&rn=" + Math.floor(Math.random()*99999999);

	//console.log("Beacon Tracking");
}else{
	//console.log("Nothing");
}