// Prototype.js needs to be included whereever this file is included (for ajax)

// Generic logger class for feature impact tracking requirements
/*
 * origin - unique page id
 * bPreference - whether this is a preference log or not  
 * p1Name - parameter Name one
 * p1Value - parameter Value one
 * p2Name - parameter Name two
 * p2Value - parameter Value two
 */
var myAjax = null;

function FILogger(origin, bPreference, p1Name, p1Value, p2Name, p2Value) {
	var fiAction = top.domainManager.constructUrl('portal',false) + "/FILogging.do";
        var urlParams = "?origin=" + origin;
	// If this is a preference logging, log name and value
	if (bPreference) {
		urlParams += "&prefName=" + p1Name;
		if (p1Value) {
			urlParams += "&prefValue=on";
		} else {
			urlParams += "&prefValue=off";
		}
	} else {
		// otherwise just log name and value
		if (p1Name) {
			urlParams += "&" + p1Name + "=" + p1Value;
		}
		if (p2Name) {
			urlParams += "&" + p2Name + "=" + p2Value;
		}
	}
	
        if (myAjax == null) {
        	myAjax = new JSONRequest(dummyProc, 1, dummyProc);
	}
	myAjax.get(fiAction + urlParams);
}

function dummyProc() {
// we just need to send the request
}

/*
Current page ids logged by request processing log by way of origin field
TIG 		Tournament Interface Groups page
TIK			Tournament Interface Knockout page
TIO			Tournament Interface Outright page
TIT			Tournament Interface Teams page
TTS			Tournament Interface Team Specials page
TIW			Tournament Interface Wallchart page
TNB			Tournament Navigation Bar
HFL         Standard Home Page Fastlinks
RVM         Standard Home Page Recently Viewed Markets
HIPT		Standard Home Page In Play Today
HCS			Standard Home Page Closing Soon
LHM			Left Hand Menu
NHR			Next Horse Race
MM_LHM		My Markets Menu
FMM			Featured Markets Menu
VWC			Vanity url : /worldcup
VST			Vanity url : /worldcup/<team name>
VSG			Vanity url : /worldcup/<group name>
VSK			Vanity url : /worldcup/knockout
VSW			Vanity url : /worldcup/firstround
VSO			Vanity url : /worldcup/outright
VTS			Vanity url : /worldcup/<team name>/specials

Current page ids logged by Feature Impact Logger
TIG_BS 		Tournament Betting Slip on Groups page
TIK_BS		Tournament Betting Slip on Knockout page
TIO_BS		Tournament Betting Slip on Outright page
TIT_BS		Tournament Betting Slip on Teams page
TTS_BS		Tournament Betting Slip on Team Specials page
TIW_BS		Tournament Betting Slip on Wallchart page
AMM			Add to My Markets
RMM			Remove from My Markets
TIG_BH		Betting Help on Groups page
TIK_BH		Betting Help on Knockout page
TIO_BH		Betting Help on Outright page
TIT_BH		Betting Help on Team page
TTS_BH		Betting Help on Team Specials page
TIW_BH		Betting Help on Wallchart page
MV_NWS		News tab in Market View
MV_FRM		Form tab in Market View
MV_PVW		Preview tab in Market View
MV_FUM		Forum tab in Market View
MVP			Market View Preferences
TIG_P		Tournament Interface Groups - Preferences
TIK_P		Tournament Interface Knockout - Preferences
TIO_P		Tournament Interface Outright - Preferences
TIT_P		Tournament Interface Teams - Preferences
TTS_P		Tournament Interface Team Specials - Preferences
TIW_P		Tournament Interface Wallchart - Preferences
TI_NWS		News tab in Tournament interface, team page
TI_INF		Information tab in Tournament interface, team page
TI_RTG		Road To Germany in Tournament interface, team page
HLS			Header Language Selector
WCD_EN		World Cup Demo - English
WCD_DE		World Cup Demo - German
WCP			World Cup Promo
WPL			World Cup Promotion Left
WPR			World Cup Promotion Right 

Current preferences logged by Feature Impact Logger
content
navigationBar
showHelp

Current parameters logged by Feature Impact Logger
pi.localeId
pi.regionId
mi
prefName
prefValue
fName
*/