
//08.12.2009-l
	var protocol = ("https:" == document.location.protocol) ? 'https' : 'http';
var serverURL = protocol + '://mymerchantguard.com/trackers/';

var cookieName= 'mgTGI98785615';
function startIt()	{
	s = document.getElementsByTagName("script");
	var tc = null;
	for (var i=0; i<s.length; i++) {
		var tcMatches = s[i].src.match(/master\.js\?.*tc=(.*)/);
		(tcMatches ? tc = tcMatches[1] : '');
	}
	
	script = document.createElement( 'script' );
	script.src = serverURL + 'master.php?tc=' + tc + '&tgi=' + readCookie(cookieName) + '&secure=' + (("https:" == document.location.protocol) ? 'true' : 'false');
	script.type = "text/javascript";
	document.getElementsByTagName( 'head' )[0].appendChild( script );
}
//Cookie manupulation functions
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
startIt();