// JavaScript Document
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end));
    }
  }
  return cookieValue;
}

function writeCookie(name, cookieValue, hours)
{

  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(cookieValue) + expire+"; path=/;";
	return cookieValue;
}

function BrowserInfo()
{
	var ie4 = document.all;
	var ns4 = document.layers;
	var ns6 = document.getElementById && !document.all; 

//	this.name = navigator.appName;
//	this.codename = navigator.appCodeName;
//	this.version = navigator.appVersion.substring(0,4);
//	this.platform = navigator.platform;
//	this.javaEnabled = navigator.javaEnabled();
//	this.cookieEnabled = navigator.cookieEnabled;
	this.language = (ie4) ? navigator.browserLanguage:navigator.language;
}
function ScreenInfo()
{
	this.screenWidth = (screen) ? screen.width:"";
	this.screenHeight = (screen) ? screen.height:"";
	this.colorDepth =  (screen) ? screen.colorDepth:"";
}
function DocumentInfo()
{
	this.referrer = (document.referrer) ? new String(top.document.referrer):"";
	this.title = (document.title) ? new String(document.title): "";
	this.location = location.pathname;
	this.hostname = location.hostname;
}
b = new BrowserInfo();
d = new DocumentInfo();
s = new ScreenInfo();

var rand = Math.random()+"";
var a = rand * 100000000000000000;
var now = (new Date()).getTime();
var id = now.toString()+a;

cookieUser = (readCookie("user1")=="")?writeCookie("user1",id,26280):readCookie("user1");
cookieVisit = (readCookie("visit1")=="")?writeCookie("visit1",id,0.5):readCookie("visit1");
cookieView = id;

var counter = new Image();
counter.src='/stats/index.php?u='+cookieUser+'&v1='+cookieVisit+'&v2='+cookieView+'&hostname='+d.hostname+'&title='+d.title+'&ref='+escape(d.referrer.substring(0,299))+'&lang='+b.language+'&location='+escape(d.location.substring(0,299))+'&screen='+s.screenWidth+'x'+s.screenHeight+'&colors='+s.colorDepth;
//document.write('<img src=http://stat.maestria.serwery.pl/index.php?u='+cookieUser+'&v1='+cookieVisit+'&v2='+cookieView+'&hostname='+d.hostname+'&title='+escape(d.title)+'&ref='+escape(d.referrer.substring(0,299))+'&lang='+b.language+'&location='+escape(location.pathname.substring(0,299))+'&screen='+s.screenWidth+'x'+s.screenHeight+'&colors='+s.colorDepth+'>');