
// Ącounter.js
// Copyright (C) Takashi Utsunomiya
// http://uttsu.com/

	drawCounter();

function drawCounter()
{
	var a;
	var site_url = 'uttsu.com';
	var counter_url = 'http://uttsu.com/cgibin/uttsu/ac/';
	var b1 = new Date(), a1 = window.screen.height, a2 = window.screen.width, a3 = window.screen.colorDepth, a5 = b1.getTimezoneOffset(), a4 = top.document.referrer;

	if (location.protocol == 'http:') {
		if (location.hostname == site_url) {
			if (location.href == 'http://'+site_url+'/' || location.href == 'http://'+site_url+'/index.html') {
				document.write('<img src='+counter_url+'hana.cgi?wh='+a1+'&tz='+a5+'&ww='+a2+'&cd='+a3+'&ref='+a4+'>');
			} else {
				if (document.referrer.indexOf(site_url) == -1) {
					document.write('<img src='+counter_url+'hana.cgi?wh='+a1+'&tz='+a5+'&ww='+a2+'&cd='+a3+'&ref='+a4+'>');
				}
				a = location.pathname.substring(1);
				a = a.substring(0, a.indexOf('/'));
				if (a.length > 8) a = a.substring(0, 8);
				document.write('<img src='+counter_url+'hana_page.cgi?id='+a+'&type=main>');
			}
		}
	} else {
		document.write(location);
	}
}
