var w = window; var d = document; var pageId = 21483; var logURL = "http://blog05.analyzer.livedoor.jp/js/a.js"; var cookieName = "LDANA_" + pageId; var visit = 0; var ce = 0; var uu; var t; var n = 0; if(navigator.cookieEnabled) ce = 1; function genRandomStr(len) { var s ="0123456789abcdef"; var a = s.split(""); var str = ""; for(i=0;i 0) date.setTime(date.getTime() - skew); } function setCookie(key, val) { var expires = new Date(); fixDate(expires); expires.setTime(expires.getTime() + 14 * 24 * 60 * 60 * 1000); // 2weeks. var cookieStr = key + "=" + encodeURIComponent(val) + "; expires=" + expires.toGMTString(); document.cookie = cookieStr; } function getCookie (key) { var prefix = key + "="; var c = document.cookie; var sidx = c.indexOf(prefix); if (sidx == -1) return ""; var eidx = c.indexOf(";", sidx + prefix.length); if (eidx == -1) eidx = c.length; return decodeURIComponent(c.substring(sidx + prefix.length, eidx)); } function getUrl () { var url = d.referrer; if (w.top.location == d.location) { url = d.location; } return url; } function userTracking(){ var val = getCookie(cookieName); var now = Math.round((new Date()).getTime()/1000); if(val) { var values = val.split(','); uu = values[0]; t = values[1]; n = values[2]; if(now - t > 3600) visit = 1; } else { visit = 1; uu = genRandomStr(32); } n++; setCookie(cookieName, uu + "," + now + "," + n); } userTracking(); var qs="pid=" + pageId + "&r=" + encodeURIComponent(getReferrer()) + "&ss=" + getScreenSize() + "&cd=" + getColorDepth() + "&uu=" + uu + "&n=" + n + "&visit=" + visit + "&ce=" + ce + "&u=" + encodeURIComponent(getUrl()); var processURL = logURL + "?" + qs; document.write('');