var ShowAd = true ; var advHelper = new AdvertHelper(ShowAd, 5, showAllAdvert); function showAllAdvert(json) { if(!json) return; advHelper.items = json; /* advHelper.setEachImg("left_ad", function(obj) { return ''; },"
"); advHelper.setEachImg("right_ad", function(obj) { return ''; },"
"); advHelper.setTxt("toperBaskText", function(obj) { return '广告:' + obj.title + ""; }); advHelper.setEachImg("mid_ad", function(obj) { return ''; }); advHelper.setEachImg("logoAd", function(obj) { return ''; }); advHelper.setEachImg("logoAd2", function(obj) { return ''; }); advHelper.setEachImg("toperAd", function(obj) { return ''; }); */ advHelper.setEachImg("toperAd2", function(obj) { return ''; }); advHelper.setEachImg("lqdel", function(obj) { return ''; }); advHelper.setEachImg("lqder", function(obj) { return ''; }); lqdellmove(); advHelper.setEachImg("lqdel2", function(obj) { return ''; }); advHelper.setEachImg("lqder2", function(obj) { return ''; }); lqdellmove2(); if (typeof(Advert.supple) === "function") Advert.supple(); } function Advert(){ //文字广告 //var textAdStr="textAd"; var textAdStr="tr_ad"; var textAd = advHelper.getItem(textAdStr, null); if (textAd == null) { Advert.supple = function() { advHelper.setEachTxt(textAdStr, function(obj, i) { return showCotent(obj, i % 2 == 0 ? "blue" : "red"); }); } } else Advert.supple = undefined; var length = textAd == null ? 7 : textAd.length; var AdvertObj = this; this.topIndex = 0; this.Show = function(num) { this.topIndex++; var index = num - 1; return showAdvert(index); } function showAdvert(index) { var retVal = ""; if (index < length) { if (textAd !== null) retVal = showCotent(textAd[index], index % 2 == 0 ? "blue" : "red"); return "
" + retVal + "
"; } return ""; } this.ShowRemain = function(html) { for (var i = this.topIndex; i < length; i++) { html.push(showAdvert(i)); } } function showCotent(adObj, fontColor) { var url=advHelper.link + adObj.id; var showtxt=adObj.title; return "
广告:" + showtxt + "
"; } } function showText(num) { if (textAd == null) { if(typeof(showText.supple)!=="function") { showText.supple = function() { advHelper.setEachTxt("tr_ad", function(obj, i) { return showCotent(obj, i % 2 == 0 ? "blue" : "red"); }); } } } else showText.supple = undefined; var index=num-1; var retVal =""; var length = textAd == null ? 5 : textAd.length; if(index"+retVal+""; } return ""; function showCotent(adObj, fontColor) { var url=advHelper.link + adObj.id; var showtxt=adObj.title; return "
广告:" + showtxt + "
"; } } 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"); } function lqdellmove(){ if(!document.ns){ _doTop(document.getElementById("lqdel")); _doTop(document.getElementById("lqder")); setTimeout("lqdellmove();",200); } } var isIE = !!window.ActiveXObject; var isIE6 = isIE && !window.XMLHttpRequest; //两边浮动广告 function lqdellmove2() { if (!document.ns) { _doTop(document.getElementById("lqdel2"),195); _doTop(document.getElementById("lqder2"),195); setTimeout("lqdellmove2();", 200); } }