(function(d, c) { var a = "cfcd208495d565ef66e7dff9f98764da"; c.reviveAsync = c.reviveAsync || {}; try { if (!c.reviveAsync.hasOwnProperty(a)) { js_jlad_f = c.reviveAsync[a] = { id: Object.keys(c.reviveAsync).length, name: "jlad", start: function() { var e = function() { try { if (!js_jlad_f.done) { d.removeEventListener("DOMContentLoaded", e, false); c.removeEventListener("load", e, false); js_jlad_f.done = true; js_jlad_f.apply(js_jlad_f.detect()) } } catch(g) { console.log(g) } }; if (d.readyState === "complete") { setTimeout(e) } else { d.addEventListener("DOMContentLoaded", e, false); c.addEventListener("load", e, false) } }, ajax: function(e, g) { var JSONP = document.createElement("script"); JSONP.type = "text/javascript"; JSONP.src = e + "?" + js_jlad_f.encode(g).join("&"); document.getElementsByTagName("head")[0].appendChild(JSONP); }, jsonpCallback:function(h){ js_jlad_f.spc(JSON.parse(h)) }, encode: function(m, n) { var e = [], h, i; for (h in m) { if (m.hasOwnProperty(h)) { var l = n ? n + "[" + h + "]": h; if ((/string|number|boolean/).test(typeof m[h])) { e.push(encodeURIComponent(l) + "=" + encodeURIComponent(m[h])) } else { var g = js_jlad_f.encode(m[h], l); for (i in g) { e.push(g[i]) } } } } return e }, apply: function(g) { if (g.sdk_id.length) { var e = "https://api-jlad.zhongsou.com/async/asyncpg"; g.sdk_id = g.sdk_id.join("|"); g.package_name = "api.jlad.shp.zhongsou.com"; if (d.referrer) { g.referer = d.referrer } js_jlad_f.ajax(e, g) } }, detect: function() { var o = d.querySelectorAll("ins[data-" + js_jlad_f.name + "-id='" + a + "']"); var n = { sdk_id: [], prefix: js_jlad_f.name + "-" + js_jlad_f.id + "-", guid: getCookie("guid"), dt:Date.parse( new Date())/1000, version:"1.0", screen:d.body.clientWidth }; for (var g = 0; g < o.length; g++) { var k = o[g]; if (k.hasAttribute("data-" + js_jlad_f.name + "-sdk_id")) { var l = new RegExp("^data-" + js_jlad_f.name + "-(.*)$"), e; for (var h = 0; h < k.attributes.length; h++) { if (e = k.attributes[h].name.match(l)) { if (e[1] == "sdk_id") { n.sdk_id[g] = k.attributes[h].value; k.id = n.prefix + g } else if(e[1] == "ad_format"){ n[e[1]] = k.attributes[h].value; k.id = n.prefix + g } else { if (e[1] != "id") { n[e[1]] = k.attributes[h].value } } } } } } if(n['platform']===""){ var agent = navigator.userAgent.toLowerCase(); if(agent.match("android")=='android'&&agent.indexOf('souyue') > -1){ for(var k in n){ if(k=="key_id"||k=="keyword"||k=="guest_id"||k=="article_id"||k=="adposition"||k=="platform"||k=="pfappname"){ n[k]=getValByKey(k); } } }else if(agent.match("iphone")=='iphone'&&agent.indexOf('souyue') > -1){ n['platform'] =platform; n['pfappname'] =pfappname; n['adposition'] =adposition; n['key_id'] =key_id; n['keyword'] =kw; n['guest_id'] =guest_id; n['article_id'] =article_id; } } return n }, createFrame: function(h) { var e = d.createElement("IFRAME"), g = e.style; e.scrolling = "no"; e.frameBorder = 0; e.width = h.width > 0 ? h.width: 0; e.height = h.height > 0 ? h.height: 0; g.border = 0; g.overflow = "hidden"; return e }, loadFrame: function(g, e) { var h = g.contentDocument || g.contentWindow.document; h.open(); h.writeln(""); h.writeln(""); h.writeln(''); h.writeln(''); h.writeln(e); h.writeln(""); h.writeln(""); h.close() }, spc: function(k) { for (var e in k) { if(e == "guid" && getCookie("guid") == ""){ setCookie("guid",k[e]); } if (k.hasOwnProperty(e)) { var o = k[e]; var n = d.getElementById(e); if (n) { var m = d.createElement("INS"); m.innerHTML = o.html; var g = m.getElementsByTagName("SCRIPT"); for (var l = 0; l < g.length; l++) { var q = document.createElement("SCRIPT"); var p = g[l].attributes; for (var h = 0; h < p.length; h++) { q[p[h].nodeName] = p[h].value } if (g[l].innerHTML) { q.text = g[l].innerHTML } g[l].parentNode.replaceChild(q, g[l]) } n.parentNode.replaceChild(m, n); slide(); /*if(e=='ad_format' && k[e]!=10){ slide(); }*/ } } } } }; js_jlad_f.start() } } catch(b) { if (console.log) { console.log(b) } } })(document, window); var jladJsonpCallback = function (result) { js_jlad_f.spc(result); } var setCookie = function(name,value) { var Days = 365; var exp = new Date(); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); }; var getCookie = function(name) { var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)) return unescape(arr[2]); else return ""; }; var slide = function() { var oSlide = document.getElementById("jlad_slide"); var oUl = oSlide.getElementsByTagName("ul"); var aLi = oUl[0].getElementsByTagName("li"); var baseWidth = aLi[0].offsetWidth; oUl[0].style.width = baseWidth * aLi.length + "px"; var iNow = 0; var curIndex = 0; var timeInterval = 2000; setInterval(change, timeInterval); function change() { if (curIndex == aLi.length - 1) { curIndex = 0; } else { curIndex += 1; } move(curIndex); } function move(index) { if (index > aLi.length - 1) { index = 0; iNow = index; } if (index < 0) { index = aLi.length - 1; iNow = index; } oUl[0].style.left = -index * baseWidth + "px"; } }; var getValByKey = function(key){ var agent = navigator.userAgent.toLowerCase(); if(agent.match("android")=='android'){ if(JavascriptInterface && JavascriptInterface.getValByKey){ return JavascriptInterface.getValByKey(key); } } else if(agent.match("iphone")=='iphone'){ var jsonStr = JSON.stringify({"category":"getValByKey"}); var hrefa = 'souyue.onclick://' + encodeURIComponent(jsonStr) location.href=hrefa; } else{ return ""; } }