
/* s.channel を設定 */
function setChannel() {
  var channels = new Array(
    "^/en/$", "Top(en)",
    "^/en/IKMlIndex.aspx$", "Top(en)",
    "^/en/ap/srch/", "Srch(en)",
    "^/en/dg/featured/seasonal/", "Special(en,Seas)",
    "^/en/dg/featured/", "Special(en,Full)",
    "^/en/ap/info/UssW11601.aspx", "Guide(en)",
    "^/en/ap/info/", "Info(en)",
    "^/cn/$", "Top(cn)",
    "^/cn/IKMlIndex.aspx$", "Top(cn)",
    "^/cn/ap/srch/", "Srch(cn)",
    "^/cn/dg/featured/seasonal/", "Special(cn,Seas)",
    "^/cn/dg/featured/", "Special(cn,Full)",
    "^/cn/ap/info/UssW11601.aspx", "Guide(cn)",
    "^/cn/ap/info/", "Info(cn)",
    "^/tc/$", "Top(tc)",
    "^/tc/IKMlIndex.aspx$", "Top(tc)",
    "^/tc/ap/srch/", "Srch(tc)",
    "^/tc/dg/featured/seasonal/", "Special(tc,Seas)",
    "^/tc/dg/featured/", "Special(tc,Full)",
    "^/tc/ap/info/UssW11601.aspx", "Guide(tc)",
    "^/tc/ap/info/", "Info(tc)"
  )
  var pathnm=location.pathname;
  var rex;
  for (i=0;i+1<channels.length;i+=2) {
    rex = new RegExp(channels[i], "i")
    if (pathnm.match(rex)) return(channels[i+1])
  }
  return("");
}

function getDomain(strURI) {
  var strDomain = strURI.replace(/https?:\/\/([^/?]*).*/, '$1');
  if (strDomain == 'www.ikyu.com') {
    return(strURI.replace(/https?:\/\/([^/]*(\/en|\/biz|))\/.*/, '$1'));
  } else {
    return(strDomain);
  }
}

if (document.referrer != "") {
  var strDomain = getDomain(document.referrer);
  if (getDomain(window.location.href) != strDomain) s_omni.eVar43 = strDomain;
}

if (!s_omni.channel) s_omni.channel = setChannel();
if (window.location.href.replace(/https?:\/\/([^/?]*).*/, '$1') == 'www.ikyu.com') {
  s_omni.t()
}


