/* Touch Clarity logging request - http://www.touchclarity.com - 
 * Copyright (c) Touch Clarity Ltd 2001-2005. All rights reserved. Patent Pending.
 * Change the value of tc_logging_active to switch off logging on the site.
 */

if (typeof tc_logging_active == 'undefined') 
	tc_logging_active = true;

// required configuration parameters
tc_site_id = 406;
tc_server_url = "barclays.touchclarity.com";
tc_log_path = "/BBB/A/Content/Files";
if (typeof tc_page_alias == 'undefined' && (tc_find('/brccontrol') || tc_find('/brcscontrol') || tc_find('/brcucontrol')))
	tc_page_alias = tc_make_alias();
document.write("<scr"+"ipt language='JavaScript' type='text/javascript' src='"+tc_log_path+"/logging-code.js'></scr"+"ipt>\n");


function tc_find(str) {
	return window.location.pathname.indexOf(str) > -1;
}

function tc_make_alias() {
	var id = tc_get_param("value");
	if (isNaN(id))
		tc_page_alias = id;
	else 
	{
		var loc = window.location;
		tc_page_alias = loc.href.substring(0,loc.href.indexOf("?"));
		tc_page_alias += "/page-" + id + loc.search;
	}
	return tc_page_alias;
}

function tc_get_param(param) {
	var query = window.location.search.substring(1);
	var startPos = query.toLowerCase().indexOf(param.toLowerCase()+"="); 
	if (startPos> -1) { 
		startPos = startPos + param.length + 1; 
		var endPos = query.indexOf("&",startPos); 
		if (endPos == -1) endPos = query.length; 
		return unescape(query.substring(startPos,endPos)).toLowerCase(); 
	} 
	return ""; 
} 


