function Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"="); 
	var len = start+name.length+1; 
	if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
	if (start == -1) return null; 
	var end = document.cookie.indexOf(";",len); 
	if (end == -1) end = document.cookie.length; 
	return unescape(document.cookie.substring(len,end)); 
}


function Set_Cookie(name,value,expires,path,domain,secure) { 
	var cookieString = name + "=" +escape(value) + 
	( (expires) ? ";expires=" + expires.toGMTString() : "") + 
	( (path) ? ";path=" + path : "") + 
	( (domain) ? ";domain=" + domain : "") + 
	( (secure) ? ";secure" : ""); 
	document.cookie = cookieString; 
}


function Delete_Cookie(name,path,domain) { 
	if (Get_Cookie(name)) document.cookie = name + "=" + 
	( (path) ? ";path=" + path : "") + 
	( (domain) ? ";domain=" + domain : "") + 
	";expires=Thu, 01-Jan-70 00:00:01 GMT"; 
}


if (document.cookie)
{
	if (!Get_Cookie('licznik'))
	{
		if (window.XMLHttpRequest)
		{
			http_request = new XMLHttpRequest();
			http_request.open('GET', '/stat.add/now', true);
			http_request.send(null);
		}
		else if (window.ActiveXObject)
		{
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			http_request.open('GET', '/stat.add/now', true);
			http_request.send(null);
		}
		else if (document.appendChild)
		{
			var obrazek = document.createElement("img");
			obrazek.src='/stat.add/now';
			obrazek.style.visibility='hidden';
			document.body.appendChild(obrazek);
		}
	}

	Delete_Cookie('licznik');
	var today = new Date(); 
	var cookie_expire_date = new Date(today.getTime() + (2*60*60*1000)); //2 godziny
	Set_Cookie('licznik',Math.random(),cookie_expire_date); 
}
else if (!document.cookie)
{

}