function checkCookies() {
	var CookieEnabled = (navigator.cookieenabled) ? true : false;
	if (typeof(navigator.cookieenabled) == "undefined" && !CookieEnabled) {
		document.cookie = "testcookie";
		CookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
	}

	return CookieEnabled;
}

function detectFlash() {
	var flashversion = 0;
	if (navigator.plugins && navigator.plugins.length) {
		x = navigator.plugins["Shockwave Flash"];
		if (x && x.description) {
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	} else {
		for (var i=9; i>0; i--) {
			try {
				var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				flashversion = i;
				break;
			}
			catch (e) { false; }
		}
	}
	return flashversion;
}

function editoStat() {
	var url = '?date='+(new Date()).getTime();
	if (screen)
	{
		var s = screen;
		if (s.width) url += '&screen='+s.width+'x'+s.height;
		if (s.colorDepth) url += '&bits='+s.colorDepth;
	}
	url += '&flash='+detectFlash();
	if (navigator.javaEnabled()) url += '&java=1';
	if(typeof(window.top.document.referrer) != 'undefined')
	{
		url += '&ref='+escape(window.top.document.referrer).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27');
	}
	url += '&url='+escape(window.top.location.href).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27');
	
	return url;
}

if (checkCookies()) {
	var statImage = new Image(1,1);
	statImage.src = '/stat/'+editoStat();
	//document.write(statImage.src);
}