/*  ============== ユーザーインサイト =================== */

/* api */
var load_ratio = 5;
var rand = Math.floor(Math.random()*load_ratio) ;

if("https:" != document.location.protocol && rand == 0) {
	document.write("<img src='http://l.nakanohito.jp/lg/bc/log.php?u=1008&h=5392&guid=ON&url="+escape(parent.document.URL)+"&ref="+escape(parent.document.referrer)+"&eflg=1' border='0' width='1' height='1' alt='' />");
}

/* tag */
var user_id = 1008;
var load_ratio = 20;
var domain = "hotpepper.jp";
var uiJsHost = (("https:" == document.location.protocol) ? "https://s." : "http://b.");

var expires = new Date();  expires.setDate(expires.getDate() + 14);
function vesicomyid_setcookie(key,value,domain) { var tmp = key + "=" + encodeURI(value) + ";domain=." + domain + ";expires=" + expires.toUTCString() + ";"; document.cookie = tmp; }
function vesicomyid_getcookie(key) { var tmp = document.cookie + ";"; var len = tmp.length; var x=0; while (x<len) { var y = tmp.indexOf(";",x); var tmp2 = tmp.substring(x,y);  while (tmp2.substring(0,1) == ' ') { tmp2 = tmp2.substring(1,tmp2.length); } var x3 = tmp2.indexOf("="); if (tmp2.substring(0,x3) == key) { return decodeURI(tmp2.substring(x3 + 1 , tmp2.length )); } x = y + 1; } return ""; }
var flag_load = false;
var flag_continue = vesicomyid_getcookie('vesicomyid_continue');
if ( flag_continue == "true") {
 flag_load = true;
} else if ( flag_continue == "false" ) {
 flag_load = false;
} else {
 var r = Math.floor(Math.random()*load_ratio);
 if (r == 0) {
   vesicomyid_setcookie('vesicomyid_continue',"true",domain);
   flag_load = true;
 } else {
   vesicomyid_setcookie('vesicomyid_continue',"false",domain);
   flag_load = false;
 }
}
if (flag_load) {
 document.write('<span id="id_bivalves"></span>');
 document.write(unescape("%3Cscript src='" + uiJsHost + "nakanohito.jp/bc/bivalves.js' charset='utf-8' type='text/javascript'%3E%3C/script%3E"));
 var uiLimit = 3000, uiInterval = 50, uiTime = 0;
 var uiLoadedId = setInterval(function(){
   if ((typeof(Vesicomyid) != "undefined") &&
      (typeof(Vesicomyid.Bivalves) != "undefined") &&
      (typeof(Vesicomyid.Bivalves.Loaded) == "function") ) {
     clearInterval(uiLoadedId);
     try {
       var lb = new Vesicomyid.Bivalves(user_id);
       lb.retarded = true;
       lb.ratio = load_ratio;
       lb.init();
     }
     catch (err) {
     }
   }
   else
     if ((uiTime += uiInterval) > uiLimit) {
       clearInterval(uiLoadedId);
     }
 }, uiInterval);
}

