/*
WSS
	
	Web Analytics (Web Side Story) Implementation
	
	Required: hbx.js must be included (***must be included after this file) which gives us acces to the function necessary for creating the required global hbx object
	
	Usage: 
	
	var oWSS = new WSS(); - will setup the default values for required fields 
	
	WSS.SetInput("pn","Stocks Research"); - set a value for a given input (see mapping below)
	
	WSS.SetAcctNumFromEnvironment("Production"); - since we have to determine environment server side, this makes for slightly cleaner code 


	//Config Vars
	pndef = "Default Page Name
	ctdef = Default content Category
	
	//Action Settings
	fv = Form validation Minimum Elements or submit function name
	lt = Link Tracking
	dlf = Download filter
	dft = download file naming
	elf = exit link filter
	
	//Config vars
	seg = visitor segmentation
	fnl = funnels
	
	//Campaigns
	cmp = campaign ID
	cmpn = campaign ID in query
	dcmp = dynamic campaign id
	dcmpn = dynamic campaign id in query
	dcmpe = dynamic campaign expiration
	dcmpre = dynamic campaign response expiration
	hra = response attribute
	cmp = campaign id
	hqsr = response attribute in referral query
	hqsp = response attribute in query
	hlt = lead tracking
	gp = campaign goal
	gpn = campaign goal in query
	hcn = conversation attribute
	hcv = conversation value
	cp = legacy campaign
	cpd = campaign domain
	ci = customer ID
	hrf = custom referrer
	pec = error codes

*/

// non-editable section


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";

//end non-editable section

	
WSS = function() {
	
		try {
			
		//Set Default Vaules		
		
		// required page variables
		hbx.gn = "www.webschwab.com";
		hbx.acct = "Account Number not Provided";
		hbx.pn = "Page Name Not Provided"; 
		hbx.mlc = "customer_center/research_strategies";
		hbx.lt = "auto";
				
		// default page values
		hbx.ctdef = "full";
		hbx.pndef = "title"; 
		
		} catch(e){}

	
}

WSS.prototype.SetInput = function(sInputName, sInputValue) {
	
	try {

	hbx[sInputName] = sInputValue;
	
	} catch(e) {}
	
}

//a slightly cleaner way to update the account number which varies with environment

WSS.prototype.SetAcctNumFromEnvironment = function(sEnvironment) {
	
	try {

	sEnvironment = sEnvironment.toLowerCase();

	switch(sEnvironment) {
		
		case "development":
		case "acceptance":
		
			hbx.acct = "DM5803102JNS";

		break;
		case "production":
		
			hbx.acct = "DM551129EINS;DM551128F1SW";
		
		break;
		
	}
	
	} catch(e) {}

}





