var toki = {
	key: "",
	height: 0,
	cy: 0,
	p2: 0,
	img: null,
	start: function(key){
		toki._init(key);
	},
	_init: function(key){
		toki.img = document.createElement("img");
		toki.key = key;
		toki.height = document.documentElement.scrollHeight;
		toki._sc();
		if(document.all && document.documentElement) document.documentElement.onscroll = toki._sc;
		else if(document.documentElement) window.document.onscroll = toki._sc;
	},
	_sc: function(){
		if(toki.cy > document.documentElement.scrollTop) return;
		toki.cy = document.documentElement.scrollTop;
		var p = (document.documentElement.clientHeight + document.documentElement.scrollTop) / toki.height * 100;
		if(p != 100 && toki.p2 > 0 && (p - toki.p2) < 3) return;
		toki.p2 = p;
		toki.img.src = "/common/tokiv0.1.php?k=" + toki.key + "&p=" + p + "&r=" + ((new Date).getTime().toString() + Math.random().toString().substr(3, 4)).substr(9, 8);
	}
}


