
	function createCookie(name, value, days){
		if(days){
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else{
			expires = "";
		}

		document.cookie = name + "=" + value + expires + "; path=/";
	}

	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;
	}

	var xmlhttp = false;

	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e){
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(ee){
			xmlhttp = false;
		}
	}

	if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
		try{
			xmlhttp = new XMLHttpRequest();
		}
		catch(e){
			xmlhttp = false;
		}
	}

	if(!xmlhttp && window.createRequest){
		try{
			xmlhttp = window.createRequest();
		}
		catch(e){
			xmlhttp = false;
		}
	}

	if(xmlhttp){
		var cookie = readCookie(_sid);

		if(!cookie){
			cookie = new Date().getTime();
			createCookie(_sid, cookie);
		}

		var params = "";
		params += "?sid=" + _sid;
		params += "&su=" + escape(document.URL);
		params += "&sr=" + escape(document.referrer);
		params += "&st=" + document.getElementsByTagName('title').item(0).innerHTML;
		params += "&vid=" + cookie;

		xmlhttp.open("GET", "http://cms.hydraportal.pl/spy.php" + params, true);
		xmlhttp.setRequestHeader("Accept-Charset", "utf-8");
		xmlhttp.send(null);
	}

