/* =====================================================================
 * ===============================sophus3===============================
 * logging script 'logging.js'

 * for Opel Europe
 
 * Issued on 04/11/2009
 * Copyright (c) Sophus Ltd All rights reserved. Patent Pending.
 * http://www.sophus3.com
 * =====================================================================*/
 
if (typeof tc_logging_active == 'undefined') tc_logging_active = true;
// If you want to switch off the tracking of the site use the following line instead
// tc_logging_active = false;

// adds the query string to page aliases
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);
		}
	}
}

tc_site_id = tc_get_site_id();
tc_server_url = "gm.touchclarity.com";
tc_log_path = "/static/global/js";

document.write("<scr"+"ipt language='JavaScript' type='text/javascript' src='"+tc_log_path+"/logging-code.js'></scr"+"ipt>");

// custom functions for Opel 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() == "ru") return 521;
	else if (domain.toLowerCase() == "de") return 61;
	else if (domain.toLowerCase() == "es") return 63;
	else if (domain.toLowerCase() == "fr") return 62;
	else if (domain.toLowerCase() == "it") return 64;
	else if (domain.toLowerCase() == "nl") return 85;
	else if (domain.toLowerCase() == "uk") return 23;
	else return 291;	// unknown site - set as test site
}

/*=================================end=================================*/