//====================函数过程=================== //读取Cookies值 function getCookie(cookieName) { var cookieString =document.cookie; var start = cookieString.indexOf(cookieName + '='); // 加上等号的原因是避免在某些 Cookie 的值里有 // 与 cookieName 一样的字符串。 if (start == -1) // 找不到 return null; start += cookieName.length + 1; var end = cookieString.indexOf(';', start); if (end == -1) return unescape(cookieString.substring(start)); return unescape(cookieString.substring(start, end)); } //写入Cookie PostCookie("Softview=Yes"); function PostCookie(cookieName) { var expdate = new Date(); expdate.setTime(expdate.getTime() + 604800000); document.cookie=cookieName+";expires="+expdate.toGMTString()+";path = /;"; } Array.prototype.in_trim_array=function(e){ for(i=0;i0 || e.indexOf(this[i])>0) return true; } return false;} //双向包含 //用于产生随机轮转广告 i 随机个数 function GetRandom(i) { var dt = new Date(); var hr = dt.getSeconds(); hr = hr%i; return hr; } //广告控制按钮 function ie6fixed(element){ if(element.currentStyle && element.currentStyle.position == 'absolute'){ if(document.attachEvent){ var fixedTop = function(){ element.style.top = document.documentElement.scrollTop + 'px'; }; window.attachEvent('onscroll',fixedTop); } } } function adControl(){ var div = document.createElement('div'), cls = isHideAD ? 'show_ad' : 'hide_ad', header = document.getElementById('head') ; div.id = "ad_control"; div.className = cls; document.body.insertBefore(div,header) ie6fixed(div); div.onclick = function(){ if(isHideAD){ PostCookie("adhide=false"); this.className = "hide_ad"; isHideAD = false; } else { PostCookie("adhide=true"); this.className = "show_ad"; isHideAD = true; removeAds(); } } } var scrollTo = function(target){ var targetOffset = $(target).offset().top; $('html,body').animate({ scrollTop: targetOffset }, 300); } function removeAds(){ var next = document.getElementById('last_child'), ads = [], aid = ['show_all_970'], sad = null; while( next = next.nextSibling ){ if( next.nodeType == 1 && next.tagName == 'DIV' ){ if( /fixed|absolute/.test( next.style.position) && next.className.indexOf("highslide") < 0) ads.push(next); } } for(var i=0; i< aid.length; i++){ sad = document.getElementById(aid[i]); sad && ads.push(sad); } for(var i=0; i< ads.length; i++){ ads[i].parentNode.removeChild(ads[i]); } } //==================================================== /* PageClass 网页参数 1、首页 2、下载列表 3、下载页 11、文章列表 10、文章信息页 12、 20、专题 21、K页面 22、库首页 23、库列表 */ if(PageClass==null) { var PageClass=0; } //是否显示广告 if( "undefined" == typeof(_pageinfo)) { var commendid="0",_pageinfo = 0 }else { var commendid=_pageinfo.commendid; if(commendid !=null){ commendid = commendid.replace(" ","")} else {commendid=""}; } var arrCommId = commendid.split(",") var isHideAD =true ; if ($.inArray("9",arrCommId)>=0){ isHideAD=false; $("[data='viewAds']").hide(); //去掉不必要的广告 $(".maindown4").unbind();//取消跳转的事件 // console.log("1"); } /* var isHideAD = getCookie('adhide') == 'true' ? true : false; PageClass == 3 && adControl(); document.write('
'); */ if ((PageClass!=1) && isHideAD) { // 富媒体------- /show/all.js ------------- /skin/new2015/js/new.js ----------- //document.write("