
	function GO(elemid)
	{
		var elem;

		if(typeof elemid == 'object')
		{
			elem=elemid;
		}
		else
		{
			if(document.getElementById)
			{
				elem=document.getElementById(elemid);
			}
			else if(document.all)
			{
				elem=document.all(elemid);
			}
			else if(document.layers)
			{
				elem=document.all[elemid];
			}
		}

		return elem;
	}



	function CCS(elemid, css_style, css_value, gett)
	{
		var elem;

		elem=GO(elemid);

		if(!elem)
		{
			if(gett) return Array(false, false);
			return false;
		}

		if(gett) return Array(true, elem.style[css_style]);


		if(elem.style)
		{
			elem.style[css_style]=css_value;
		}

		return true;
	}



	var CCB;

	function CCBD()
	{
		if(GO('top').style.filter != undefined)
		{
			CCB='ie';
		}
		else if(GO('top').style.opacity != undefined)
		{
			CCB='moz';
		}
		else
		{
			CCB='other';
		}
	}



	function CCO(elemid, val)
	{
		if(!CCB) CCBD();

		if(CCB != 'other')
		{
			if(typeof elemid != 'object')
			{
				elemid=GO(elemid);
			}

			if(CCB == 'ie')
			{
				elemid.style.filter='alpha(opacity=' + val + ')';
			}
			else
			{
				elemid.style.opacity=val / 100;
			}
		}
	}



	window.onload=Counter;

	function Counter()
	{
		var elem=GO('counterimg');

		if(elem)
		{
			var wwx=0,wwy=0;

			if (typeof(window.innerWidth) == 'number')
			{
				wwx=window.innerWidth;
				wwy=window.innerHeight;
			}
			else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
			{
				wwx=document.documentElement.clientWidth;
				wwy=document.documentElement.clientHeight;
			}
			else if (document.body && (document.body.clientWidth || document.body.clientHeight))
			{
				wwx=document.body.clientWidth;
				wwy=document.body.clientHeight;
			}

			var referer=escape(top.document.referrer);
			var url=escape(document.location);
			var sid;

			sid=referer.indexOf('sid=');
			if(sid)
			{
				referer=referer.slice(0, sid) + referer.slice(sid + 37, 999);
			}

			sid=url.indexOf('sid=');
			if(sid)
			{
				url=url.slice(0, sid) + url.slice(sid + 37, 999);
			}

			elem.src='http://hitx.waudit.cz/h.php?id=7778&js=1&x='+screen.width+'&y='+screen.height+'&bit=' +screen.colorDepth+'&wx='+wwx+'&wy='+wwy+'&ref=' + referer + '&url=' + url + '&t='+escape(document.title);
		}
	}



	function Trim(string)
	{
		return string.replace(/^\s*((?:[\S\s]*\S)?)\s*$/, '$1');
	}



	/**
	*
	*  URL encode / decode
	*  http://www.webtoolkit.info/
	*
	**/

	var Url = {

		// public method for url encoding
		encode : function (string) {
			return escape(this._utf8_encode(string));
		},

		// public method for url decoding
		decode : function (string) {
			return this._utf8_decode(unescape(string));
		},

		// private method for UTF-8 encoding
		_utf8_encode : function (string) {
			string = string.replace(/\r\n/g,"\n");
			var utftext = "";

			for (var n = 0; n < string.length; n++) {

				var c = string.charCodeAt(n);

				if (c < 128) {
					utftext += String.fromCharCode(c);
				}
				else if((c > 127) && (c < 2048)) {
					utftext += String.fromCharCode((c >> 6) | 192);
					utftext += String.fromCharCode((c & 63) | 128);
				}
				else {
					utftext += String.fromCharCode((c >> 12) | 224);
					utftext += String.fromCharCode(((c >> 6) & 63) | 128);
					utftext += String.fromCharCode((c & 63) | 128);
				}

			}

			return utftext;
		},

		// private method for UTF-8 decoding
		_utf8_decode : function (utftext) {
			var string = "";
			var i = 0;
			var c = c1 = c2 = 0;

			while ( i < utftext.length ) {

				c = utftext.charCodeAt(i);

				if (c < 128) {
					string += String.fromCharCode(c);
					i++;
				}
				else if((c > 191) && (c < 224)) {
					c2 = utftext.charCodeAt(i+1);
					string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
					i += 2;
				}
				else {
					c2 = utftext.charCodeAt(i+1);
					c3 = utftext.charCodeAt(i+2);
					string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
					i += 3;
				}

			}

			return string;
		}

	}