//allabout 右カラム //allabout_gps 上部バナー 2010/4/1追加 var __affiliateIDs__ = {"cyzo":"_20100927_cyzo_31days__","allabout":"_20100401_allabout_31days__","allabout_gps":"_20100401_allaboutgps_31days__","bitcash":"_20100501_bitcash_31days__","menscyzo":"_20110315_menscyzo_31days__","allaboutriko":"_20100830_allaboutriko_31days__"}; function getAffiliate() { var cookieValue = document.cookie; if (cookieValue.indexOf("affiliatekey=") >= 0){ var from = cookieValue.indexOf("affiliatekey=")+13; var to = cookieValue.indexOf("__", from); return cookieValue.substring(from, to); } return null; } function setAffiliate(key, value) { var now = new Date(); // var strDate = now.getFullYear()+"/"+(now.getMonth()+1)+"/"+now.getDate()+" "+now.getHours()+":"+now.getMinutes()+"."+now.getSeconds(); var cookieValue = value+"("+_serverDate+")"; now.setTime(now.getTime()+1000*60*60*24*31); //31 days expireDay = now.toGMTString(); var cookieValue = key+"="+cookieValue+";expires="+expireDay+";path=/regist_complete.php"; document.cookie = cookieValue; } function isRedirectPathName(path) { if(path.indexOf("index.") >= 0){ return true; } if(path.lastIndexOf("/") == path.length-1) { return true; } return false; } if(document.URL.indexOf("?") > 0) { var url = document.URL; if(url.indexOf("affiliatekey=") >= 0) { var affiliateParam = url.substring(url.indexOf("affiliatekey=")+13); var pathName = location.pathname; if(affiliateParam.indexOf("&") > 0) { affiliateParam = affiliateParam.substring(0, affiliateParam.indexOf("&")); if(affiliateParam != null && affiliateParam.length > 0 && __affiliateIDs__[affiliateParam] != null) { setAffiliate("affiliatekey", __affiliateIDs__[affiliateParam]); if(__affiliateIDs__[affiliateParam].charAt(0) == "_" && isRedirectPathName(pathName)) { location.href="/over18.php"; } } }else{ affiliateParam = affiliateParam.substring(0); if(affiliateParam != null && affiliateParam.length > 0 && __affiliateIDs__[affiliateParam] != null) { setAffiliate("affiliatekey", __affiliateIDs__[affiliateParam]); if(__affiliateIDs__[affiliateParam].charAt(0) == "_" && isRedirectPathName(pathName)) { location.href="/over18.php"; } } } }else{ setAffiliate("defaultkey", "default"); } }else{ setAffiliate("defaultkey", "default"); }