// JavaScript Document

	window.setInterval("call()", 100000);
	
	function call(){
		today = new Date();
		var rand=Math.random()*9000000;
		var id = getCookie('idls', null, null);
		var timestamp = today.getDate()+''+(today.getMonth()+1)+''+today.getFullYear()+'_'+today.getHours()+''+today.getMinutes()+''+today.getSeconds()+''+today.getMilliseconds();
		if (id ==null || id=='' || id==0){
			setCookie('idls', 'livestats_'+timestamp+"_"+rand, 365, null, null, null);
		}
		id = getCookie('idls', null, null);
		urlChiamante = window.location.href;
try {
urlChiamante="http://"+window.location.hostname+window.location.pathname;
} catch(ex){}
		url = "http://livestats.matrix.it/live/generic.gif?url="+ urlChiamante +"&timestamp="+timestamp +"&id="+id;
		getImage(url);
	}
	
	function getImage(url) {
		image = new Image(1, 1);
		image.onLoad = function () { };
		image.src = url;
		//alert(image.src);
	}
	
	function setCookie(cookieName, value, daysToExpire, path, domain, secure) {
		var expiryDate;

		if (daysToExpire) {
			// time is in milliseconds
			expiryDate = new Date();
			// there are 1000 * 60 * 60 * 24 milliseconds in a day (i.e., 86400000 or 8.64e7)
			expiryDate.setTime(expiryDate.getTime() + daysToExpire * 8.64e7);
		}

		document.cookie = cookieName + '=' + escape(value) +
							  (daysToExpire ? ';expires=' + expiryDate.toGMTString() : '') +
							  ';path=' + (path ? path : '/') +
							  (domain ? ';domain=' + domain : '') +
							  (secure ? ';secure' : '');
	}

	/*
	 * Get cookie value
	 */
	function getCookie(cookieName, path, domain) {
		var cookiePattern = new RegExp('(^|;)[ ]*' + cookieName + '=([^;]*)' +
				(path ? '(;[ ]*expires=[^;]*)?;[ ]*path=' + path.replace('/', '\\/') + '' : '') +
				(domain ? ';[ ]*domain=' + domain + '(;|$)' : '')),

			cookieMatch = cookiePattern.exec(document.cookie);

		return cookieMatch ? unescape(cookieMatch[2]) : 0;
	}
call();
