/* Sophus3 logging request. http://www.sophus3.com
 * Site identifier code for Lancia
 * Copyright (c) Sophus Ltd All rights reserved. Patent Pending.
 *
 * Change the value of tc_logging_active to switch off logging on the site.
 * HitsIntoLeads extended Version
 * Additional Websites (PT and AT)
 * Issued on 05/11/2007
 */

if (typeof tc_logging_active == 'undefined') tc_logging_active = true;

/* New Custom Code to append the 'usePair' parameters only to the tc_page_alias if found */
if (typeof tc_page_alias != 'undefined') {
	if (location.search != null && location.search.length > 1) {
		if (tc_page_alias.indexOf('?') == -1) {
			tc_page_alias = tc_page_alias + location.search;
		} else {
			tc_page_alias = tc_page_alias + "&" + location.search.substring(1);
		}
	}
}
/* END */

tc_site_id = tc_get_site_id();
tc_netmining_url = tc_get_netmining_url(tc_site_id);
tc_server_url = "fiat.touchclarity.com";
tc_log_path = "/LANCIA_ITALIA/touchclarity";
document.write("<scr"+"ipt language='JavaScript' type='text/javascript' src='"+tc_log_path+"/logging-code.js'></scr"+"ipt>");

if (tc_netmining_url != null) document.write("<scr"+"ipt language='JavaScript' type='text/javascript' defer='defer' src='"+tc_netmining_url+"'></scr"+"ipt>\n");

// custom functions for Lancia Portal sites
function tc_get_site_id() {
	var domain = document.location.hostname;
	domain = domain.toLowerCase();
	domain = domain.substring(domain.lastIndexOf(".")+1);
	if (domain.toLowerCase() == "de") tc_site_id = 81;
	else if (domain.toLowerCase() == "fr") tc_site_id = 82;
	else if (domain.toLowerCase() == "it") tc_site_id = 83;
	else if (domain.toLowerCase() == "es") tc_site_id = 84;
	else if (domain.toLowerCase() == "com") tc_site_id = 121;
	else if (domain.toLowerCase() == "be") tc_site_id = 494;
	else if (domain.toLowerCase() == "ch") tc_site_id = 495;
	else if (domain.toLowerCase() == "pl") tc_site_id = 496;
	else if (domain.toLowerCase() == "nl") tc_site_id = 497;
	else if (domain.toLowerCase() == "pt") tc_site_id = 561;
	else if (domain.toLowerCase() == "at") tc_site_id = 560;
	else tc_site_id = 121;  // Lancia Global
	return tc_site_id;
}

// custom functions for Lancia Portal sites
function tc_get_netmining_url(site) {
	if (site == 83) return "http://it.lancia.netmining.com/";
	else return null;
}


