var ShowAd = true ; if ((document.referrer.indexOf("360") != -1 || document.referrer.indexOf("265") != -1 || document.referrer.toLocaleLowerCase().indexOf("hao123") != -1 || document.referrer.toLocaleLowerCase().indexOf("qq") != -1 || document.referrer.indexOf("2345") != -1 || document.referrer.toLocaleLowerCase().indexOf("114la") != -1 || document.referrer.toLocaleLowerCase().indexOf("chinaz") != -1 || document.referrer.toLocaleLowerCase().indexOf("anquan") != -1) && getCookie("colseims") == "") { writeCookie2("colseims", "1"); ShowAd = false; } if (getCookie("colseims") != "") { ShowAd = false; } var advHelper = new AdvertHelper(ShowAd, 1, showAllAdvert); function showAllAdvert(json) { if(!json) return; advHelper.items = json; /* advHelper.setEachImg("logoAd", function(obj) { return ''; }); advHelper.setEachImg("logoAd2", function(obj) { return ''; }); advHelper.setEachImg("toperAd", function(obj) { return ''; }); advHelper.setTxt("toperText", function(obj) { //advHelper.setTxt("textAd", function(obj) { return '广告:' + obj.title + ""; }); advHelper.setEachImg("leftAd", function(obj) { return ''; }, "
"); advHelper.setEachImg("rightAd", function(obj) { return ''; }, "
"); advHelper.setEachImg("midAd1", function(obj) { return ''; }); advHelper.setEachImg("bottomAd", function(obj) { return ''; }); */ advHelper.setEachImg("toperAd2", function(obj) { $("#toperAd2").show(); return ''; }); advHelper.setEachImg("lqdel", function(obj) { return ''; }); advHelper.setEachImg("lqder", function(obj) { return ''; }); advHelper.setEachImg("lqdel2", function(obj) { return ''; }); advHelper.setEachImg("lqder2", function(obj) { return ''; }); if (typeof(Advert.supple) === "function") Advert.supple(); lqdellmove(); } (function(){ var myEfficientFn = debounce(lqdellmove, 100, false); if(window.attachEvent) window.attachEvent('onscroll',myEfficientFn); else window.addEventListener('scroll', myEfficientFn); })(); function Advert(matchcount, colspan) //文字广告 { this.topIndex = 0; this.line = -1; this.bottomIndex = 0; this.matchcount = matchcount; this.colspan = colspan; var adIndex = -1; var adinfo1 = advHelper.getItem("tr_ad", null); var bottomInfoAd1 = advHelper.getItem("tr_ad2", null); var adInfo1Length = adinfo1 == null ? 0 : adinfo1.length; //没有文字广告时不要空行,设置为0 var bottomInfoAd1Length = bottomInfoAd1 == null ? 2 : bottomInfoAd1.length; if (adinfo1 == null) { Advert.supple = function() { advHelper.setEachTxt("tr_ad", function(obj, i) { return showCotent(advHelper.link + obj.id, obj.title, i % 2 == 0 ? "blue" : "red"); }); advHelper.setEachTxt("tr_ad2", function(obj, i) { return showCotent(advHelper.link + obj.id, obj.title, i % 2 == 0 ? "blue" : "red"); }); } } else Advert.supple = undefined; var AdvertObj=this; function showAdvert(html, arr, firstName, index) { var txt=""; if (arr != null) { var obj = arr[index]; txt=showCotent(advHelper.link + obj.id, obj.title, index % 2 == 0 ? "blue" : "red"); }; html.push("" + txt + ""); } function showCotent(url, showtxt, fontColor) { return (typeof(url) == "undefined" ? "" : "广告:" + showtxt + ""); } this.Show = function(html, index) { this.line++; var ifShow=false; if (adIndex + 2 <= this.line) { if (this.topIndex < adInfo1Length) { adIndex = this.line; showAdvert(html, adinfo1, "tr_ad", this.topIndex); this.topIndex++; ifShow=true; } else if (bottomInfoAd1Length > this.bottomIndex) { var relativeMatchIndex = this.matchcount - (index - this.line); if (this.line >= relativeMatchIndex - 9 + 2 * this.bottomIndex) { adIndex = this.line; showAdvert(html, bottomInfoAd1, "tr_ad2", this.bottomIndex); this.bottomIndex++; ifShow=true; } } } } this.ShowRemain = function(html) { for (var i = this.topIndex; i < adInfo1Length; i++) { showAdvert(html, adinfo1, "tr_ad", i); } for (var i = this.bottomIndex; i < bottomInfoAd1Length; i++) { showAdvert(html, bottomInfoAd1, "tr_ad2", i); } } } function getSbAd1(width) { return advHelper.getEachImg("sbAd1", function(obj) { return ''; }); } function lqdellmove() { function _doTop(mlayer, top) { var ifFixed=typeof top!=="undefined"||mlayer.parentNode.getBoundingClientRect().top<0; mlayer.style.top=(ifFixed?top:0)+ "px"; mlayer.style.position=(ifFixed?"fixed":"relative"); } if (!document.ns) { var top = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; _doTop(document.getElementById("lqdel")); _doTop(document.getElementById("lqder")); _doTop(document.getElementById("lqdel2"),195); _doTop(document.getElementById("lqder2"),195); } } function debounce(fun,t,immediate) { var timeout; return function(event) { var that = this, arg = arguments; var later = function() { timeout = null; if(!immediate) fun.apply(that,arguments); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later,t); if(callNow) { fun.apply(that,arguments); } } };