//<!--COPYRIGHT 1997-2004 WEBSIDESTORY,INC. ALL RIGHTS RESERVED. U.S.PATENT No.6,393,479B1 & 6,766,370. INFO:http://websidestory.com/privacy-->
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
Version 20090709 : 
- Tidying of tracking of untagged Sky.com links (esp Join Sky link on www.sky.com home page)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

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="HBX0103u";hbx.gn="peach.bskyb.com";

//CONFIGURATION VARIABLES
var hbx_isLandingPage;

if(location.hostname.indexOf('packages.sky.com')>=0||location.hostname.indexOf('payments.sky.com')>=0)
	hbx.acct="DM570124APZE;DM53022723AE;DM53111942ZM";//Packages, .COM & Global Roll-up.
else
	hbx.acct="DM53061677FD";// TEST account

if(location.hostname.indexOf('localhost')>-1)
	hbx.acct="DMDUMMY"; // for local testing
	
// SETTING PAGE NAME EQUAL TO FILE NAME (more reliable than Page Title)
var filename = location.pathname.substring(location.pathname.lastIndexOf('\/')+1,location.pathname.lastIndexOf('.'));
if(location.pathname.lastIndexOf('.') == -1)
	hbx.pn = "Home";
else{
	if(filename!=undefined){
		if(filename.length == 0 || filename == "/")
			hbx.pn = "Home";
		else
			hbx.pn = filename.toLowerCase();
	}
}
if(hbx.pn == "default" || hbx.pn == "index" || hbx.pn == "home"){
	hbx.pn = "Home";
}
var hitbox_winLoc = window.location.pathname;
if(hitbox_winLoc.indexOf('.')>0)
	hitbox_lastStr = hitbox_winLoc.substring(0,hitbox_winLoc.lastIndexOf('/',hitbox_winLoc.indexOf('.')));
	
else
	hitbox_lastStr = hitbox_winLoc;

if(hbx_isLandingPage!=undefined && hbx_isLandingPage==true){
	hbx.mlc="/portal/site/skycom/package/landingpages"+hitbox_lastStr;//MULTI-LEVEL CONTENT CATEGORY
	}
else{
	hbx.mlc="/portal/site/skycom/package"+hitbox_lastStr;//MULTI-LEVEL CONTENT CATEGORY
	}
//alert(hbx.mlc);
hbx.pndef="title";//DEFAULT PAGE NAME
hbx.ctdef="full";//DEFAULT CONTENT CATEGORY
//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

hbx.cp="null";//LEGACY CAMPAIGN


	
		
	/* adding campaign code if user came from sky.com and no campaign code was appended to link */
	if(document.referrer && document.referrer.indexOf('www.sky.com')>-1 && (!location.search || location.search.toLowerCase().indexOf(getCmpStr())<0)){
		var skyhp = new RegExp("www.sky.com$|www.sky.com/$|www.sky.com/\\?","i");
		var pkghp = new RegExp("packages.sky.com$|packages.sky.com/$|packages.sky.com/\\?","i");
		var pkgpacks = new RegExp("packages.sky.com/packs/","i");
		var skynonhp = new RegExp("www.sky.com/.+","i");
		var endofref = document.referrer.replace(/http:\/\/www.sky.com\//,'').replace(/https:\/\/www.sky.com\//,'').replace(/portal\/site\//,'').replace(/\//g,'_');
		endofref = endofref.indexOf('?')<0?endofref:endofref.substring(0,endofref.indexOf('?'));
		if(endofref.length>30)
			endofref=endofref.substring(endofref.length-30,endofref.length);

		/* Join Sky link from sky.com home page to packages home page */
		if(skyhp.test(document.referrer) && pkghp.test(document.location))
			hbx.cmp='ILC-SkyCOM_productsGetSky';
		/* Image link from sky.com home page to packages/packs pages */
		else if(skyhp.test(document.referrer) && pkgpacks.test(document.location))
			hbx.cmp='ILC-SkyCOM_productsGetSkyImg';
		/* any other links from sky.com to packages site (that don't have campaign tracking on already) */
		else if(!skyhp.test(document.referrer) && skynonhp.test(document.referrer))
			hbx.dcmp='ILC-SkyCOM_ref_'+endofref;
	}
		
	

