/* Sophus3 logging request. http://www.sophus3.com
 * Site identifier code for Fiat
 * 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 Countries
 * Issued on 05/01/2008
 */

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 = "/FIAT_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 Fiat Portal sites
function tc_get_site_id() {
	var domain = document.location.hostname;
	domain = domain.toLowerCase();
	domain = domain.substring((domain.lastIndexOf(".")+1), domain.length);
	if (domain.toLowerCase() == "de") tc_site_id = 76;
	else if (domain.toLowerCase() == "es") tc_site_id = 78;
	else if (domain.toLowerCase() == "fr") tc_site_id = 77;
	else if (domain.toLowerCase() == "com") tc_site_id = 484;
	else if (domain.toLowerCase() == "it") tc_site_id = 79;
	else if (domain.toLowerCase() == "nl") tc_site_id = 374;
	else if (domain.toLowerCase() == "pl") tc_site_id = 470;
	else if (domain.toLowerCase() == "uk") tc_site_id = 75;
	else if (domain.toLowerCase() == "pt") tc_site_id = 558;
	else if (domain.toLowerCase() == "ie") tc_site_id = 556;
	else if (domain.toLowerCase() == "dk") tc_site_id = 554;
	else if (domain.toLowerCase() == "be") tc_site_id = 553;
	else if (domain.toLowerCase() == "lu ") tc_site_id = 557;
	else if (domain.toLowerCase() == "hu") tc_site_id = 555;
	else tc_site_id = 484;  // Fiat Global
	return tc_site_id;
}

// custom functions for Fiat Portal sites
function tc_get_netmining_url(site) {
	if (site == 76) return "http://de.fiat.netmining.com/";
	else if (site == 79) return "http://it.fiat.netmining.com/";
	else if (site == 78) return "http://es.fiat.netmining.com/";
	else return null;
}