document.write(`
`); var KJTBHK ={ $(str){return document.querySelector(str);}, init(str){ var that = this; var dom = this.$(str); dom.addEventListener("click",function(e){ var el = e.target; if(el.tagName != "LI"||el.className=="cur")return; var ind = that.index(el); var nodes = dom.querySelectorAll("li"); for(var item of nodes){ item.removeAttribute("style"); item.removeAttribute("class"); } el.className="cur"; nodes = dom.querySelectorAll("div"); for(var item of nodes){ if(item.getAttribute("class")=="cur") that.leave(item); item.removeAttribute("style"); item.removeAttribute("class"); } var node = that.getEl(dom,ind,"DIV"); node.className="cur"; that.cur(dom,el,node); }); var node = that.getEl(dom.querySelector("UL"),0,"LI"); node.click(); [[document,"DOMContentLoaded"],[window,"resize"]].forEach((item,index,self)=>{ var removeEl=(id)=>{ try{ var ifr = document.getElementById(id); ifr.parentNode.removeChild(ifr); }catch(e){} }; var insert = (id,str)=>{ var dom = document.createElement("style"); dom.id = id; dom.innerHTML = str; document.head.appendChild(dom); } item[0].addEventListener(item[1],function(){ removeEl("KJ-IFRAMEHK-css"); var w = window.screen.availWidth; if(w<=600 && w>500){ insert("KJ-IFRAMEHK-css",".KJ-IFRAMEHK{height:170px;}"); }else if(w<=500 && w>450){ insert("KJ-IFRAMEHK-css",".KJ-IFRAMEHK{height:150px;}"); }else if(w<=450 && w>350){ insert("KJ-IFRAMEHK-css",".KJ-IFRAMEHK{height:140px;}"); }else if(w<=350){ insert("KJ-IFRAMEHK-css",".KJ-IFRAMEHK{height:130px;}"); } },false); }); }, cur(dom,el,node){ var that = this; var data = el.getAttribute('data-opt'); data = JSON.parse(data.replace(/'/g,"\"")); el.style.color = data["color"]; el.style.borderColor = data["color"]; node.style.borderColor = data["color"]; var tid = node.getAttribute("_tid"); if(tid){ clearTimeout(parseInt(tid)); node.removeAttribute("_tid"); return; } node.innerHTML = ` `; }, leave(item){ var that = this; function remove(el){ this.id = setTimeout(()=>{ if(!el.getAttribute("_tid")) return; el.removeAttribute("_tid"); el.innerHTML=""; },1000*10); el.setAttribute("_tid",this.id); } new remove(item); }, index(el,tag){ var node = el.parentNode.childNodes; var index = -1; for(var item of node){ (tag) ? (tag==item.tagName) && index++ : index++; if (item===el) return index; } return index; }, getEl(el,index,tag){ var i = -1; for(var item of el.childNodes){ (tag) ? (tag==item.tagName) && i++ : i++; if(index==i) return item; } } }; KJTBHK.init(".KJ-TabBoxHK");