(function() { if ( document.addEventListener ) { document.addEventListener("DOMContentLoaded", function() { erKokOrigin(); }); } else if ( document.attachEvent ) { document.attachEvent("onreadystatechange", function() { erKokOrigin(); }); } }()); var erKokOrigin = function() { var trg = document.getElementById('erKokOrigin'); send('page/?', function(ret) { if(ret == false || (ret && ret.getElementsByTagName('status')[0].firstChild.nodeValue == 'false')) { var t = '', iid = '', v = '', s = '', fns = '', d = document.createTreeWalker(document, NodeFilter.SHOW_COMMENT, null, null), e; while(e = d.nextNode()) { s = e.data.trim(); if(s.indexOf('erKokDMM') === 0) { t = 1; iid = s.slice(s.search(':') + 1); break; } else if(s.indexOf('erKokMGS') === 0) { t = 2; iid = s.slice(s.search(':') + 1); break; } } if(t == '') { var r = []; [].forEach.call(document.getElementsByClassName('erKokLink'), function(d) { [].forEach.call(document.getElementsByTagName('A'), function(e) { if(r = e.href.match(/dmm\.co\.jp\/(?:.*)?cid=(.*)?\//i)) { t = 1; iid = r[1]; fns = 1; } if(r = e.href.match(/www\.mgstage\.com\/product\/product_detail\/(.*)?\//i)) { t = 2; iid = r[1]; fns = 1; } }); }); } d = document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT, function(node){ if(node.tagName == "A" || node.tagName == "IFRAME"){ return NodeFilter.FILTER_ACCEPT; } else { return NodeFilter.FILTER_SKIP; } }); var regex = /xvideos\.|video\.fc2\.com|xhamster\.com|redtube\.com|tube8\.com|pornhub\.com|dailymotion\.com|dai\.ly|tokyo-porn-tube\.com|hardsextube\.com|gotporn\.com|spankwire\.com|ero-video\.net|drtuber\.com|thisav\.com|youjizz\.com|pipii\.tv|tokyo-tube\.com|spankbang\.com|empflix\.com|javynow\.com|tubecup\.com|txxx\.com|upornia\.com|xtube\.com|youporn\.com|cliphunter\.com|slutload\.com|hdzog\.com|vjav\.com|share-videos\.se|vporn\.com|aozora-doga\.com|alotporn\.com|tokyomotion\.net|hotmovs\.com/; while(e = d.nextNode()) { s = e.tagName == "A"? e.href: e.src; if(regex.test(s) == true) { v = s; break; } } send('sm/?v=' + encodeURIComponent(v) + '&t=' + t + '&title=' + encodeURIComponent(document.title) + '&iid=' + encodeURIComponent(iid) + '&fns=' + fns, function(ret) { output(ret, trg); }); } else { output(ret, trg); } }); function send(p, callback) { if (window.XMLHttpRequest) { var xhr = new XMLHttpRequest(); var uaw = matchMedia('(max-width: 798px)').matches? 8: 8; var u = location.href; if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); } if(document.querySelector("link[rel='canonical']") && document.querySelector("link[rel='canonical']").href != window.location.origin + '/') { u = document.querySelector("link[rel='canonical']").href; } xhr.open("GET", "https://kok.eroterest.net/origin/" + p + "&n=" + uaw + "&pch=1&u=" + encodeURIComponent(u), true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.send(null); xhr.onload = function(e) { if (this.status == 200) { callback(xhr.responseXML.documentElement); } } } return false; } function output(ret, trg) { trg.style.width = '100%'; trg.style.fontSize = '10px'; if(ret.getElementsByTagName('forceNoShow')[0]) { return; } var m = document.createElement('h4'); m.setAttribute('class', 'erKokMidashi'); m.style.cssText = 'background:#ffff99; color:#e60012; font-size:1.5em; font-weight:bold; padding:10px; border-radius:5px; border:0;'; trg.appendChild(m); var item = ret.getElementsByTagName('item'); if(ret.getElementsByTagName('items')[0]) { var str = ret.getElementsByTagName('midashi')[0].firstChild && ret.getElementsByTagName('midashi')[0].firstChild.nodeValue? ret.getElementsByTagName('midashi')[0].firstChild.nodeValue: '関連作品'; m.appendChild(document.createTextNode(str)); var w = document.createElement('div'); w.setAttribute('class', 'erKokItemWrapper'); var loopNum = matchMedia('(max-width: 798px)').matches? 2: 4; for(g=0; g