// $Header: /home/cvsroot3/vogue_apache/docs/js/s10060/count0.js,v 1.1 2009/03/05 05:48:33 pvstaff Exp $
function ANT_getCookie(key) {
	if (typeof(document.cookie) == "undefined") return "undefined";
	if (!document.cookie) return "undefined";
	var v = " " + document.cookie + ";";
	var sk = " " + key + "=";
	var ck = ";" + key + "=";
	var klen = sk.length;
	var ks = v.indexOf(sk);
	if (ks < 0) {
		klen = ck.length;
		ks = v.indexOf(ck);
	}
	if (ks < 0) return "undefined";
	var vs = ks + klen;
	var ve = v.indexOf(";",vs);
	return unescape(v.substring(vs,ve));
}
function ANT_setCookie(key, val, tmp) {
	tmp = key + "=" + escape(val) + "; ";
	exp = new Date();
	exp.setTime(exp.getTime() + 1000*60*60*24*1);
	tmp += "expires=" + exp.toGMTString();
	document.cookie = tmp;
}
function ANT_setCookie2(key, val, tmp) {
	tmp = key + "=" + escape(val) + "; ";
	document.cookie = tmp;
}
function ANT_clearCookie(key) {
	document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}
function ANT_CommonValue(beacon_kind) {
	var referer = "CurrentReferrer=" + escape(document.referrer);
	var cururl = "CurrentUrl=" + escape(document.URL);
	var filecookieok = "FileCookieOk=";
	var memcookieok = "MemCookieOk=";
	var now = new Date();
	var uniquekey = "UniqueKey=" + now.getTime();
	var retvalue = "";
	ANT_setCookie("filecookie","filecheck");
	if (ANT_getCookie("filecookie") == "filecheck") {
		filecookieok += "true";
	} else {
		filecookieok += "false";
	}
	ANT_clearCookie("filecookie");
	ANT_setCookie2("memcookie","memcheck");
	if (ANT_getCookie("memcookie") == "memcheck") {
		memcookieok += "true";
	} else {
		memcookieok += "false";
	}
	var protocol_str;
	if ( location.href.indexOf("https://",0) == 0 ){
		protocol_str = "https://";
	}else{
		protocol_str = "http://";
	}
	retvalue = protocol_str + "s10060.tracking.home.ne.jp/sites/" + beacon_kind + "/?";
	retvalue += filecookieok+"&"+memcookieok+"&"+cururl+"&"+referer+"&"+uniquekey;
	return retvalue;
}
function ANT_PageBeacon() {
	var commonvalue = ANT_CommonValue("page");
	var display = "DisplayResolution=" + screen.width + "x" + screen.height + "x" + screen.colorDepth;
	document.write('<span style="position:absolute; left:0px; top=0px">');
	document.write("<img src='"+commonvalue+"&"+display);
	document.write("' width=1 height=1>");
	document.write('</span>');
}
function ANT_ClickBeacon(areacode) {
	var imgsrc = ANT_CommonValue("click");
	imgsrc += "&AreaCode="+areacode;
	BeaconImage = new Image();
	BeaconImage.src = imgsrc;
	BeaconImage.height = 1;
	BeaconImage.width = 1;
}
function ANT_DownloadBeacon(downloadcode) {
	var imgsrc = ANT_CommonValue("download");
	imgsrc += "&DownloadCode="+downloadcode;
	BeaconImage = new Image();
	BeaconImage.src = imgsrc;
	BeaconImage.height = 1;
	BeaconImage.width = 1;
}

ANT_PageBeacon();


