function BannerInParagraph(bn) { var cp=pgContent ? pgContent.children() : 0, ix = cp.length - parseInt(cp.length / 3) + 1; if (ix >= 8) { cp.eq(ix).after(bn); return bn; } bn.remove(); return false; } function BannerInReadPage(bn) { var cp=pgContent ? pgContent.children() : [], ix = 2;//parseInt(cp.length / 3) + 1; var dd1 = $('
'),dd2=$(''); for (var i = 0; i < cp.length; i++) { (i <= ix ? dd1 : dd2).append(cp.eq(i).clone()); } if (cp != pgContent) { cp.remove(); } else { cp.clear(); } hasInpg = 1; pgContent.append(dd1); pgContent.append(bn); pgContent.append(dd2); return bn; } function BannerInRead(bn) { var cp=pgContent ? pgContent.children() : 0, ix = 2;//parseInt(cp.length / 3) + 1; if (!hasInpg) {// && ix >= 3) { cp.eq(ix).after(bn); return bn; } bn.remove(); return false; } function BannerInView(bn) { var cp=pgContent ? pgContent.children() : 0, ix = parseInt(cp.length / 3) + 1; if (ix < 4) { ix = cp.length - 2; } if (ix >= 3) { cp.eq(ix).after(bn); return bn; } bn.remove(); return false; } function BannerPopup(bn) { var rem = $(''); rem.click(function(e){e.preventDefault();bn.remove();}); bn.append(rem); setTimeout(function(){bn.addClass('show');}, 5000); return bn; } function BannerFullscreen(bn) { var rem = $(''); rem.click(function(e){e.preventDefault();bn.remove();}); bn.append(rem); setTimeout(function(){bn.addClass('show');}, 5000); return bn; } var hasInpg = 0; var pgContent = (function(ct){ ct = $(ct); if (!ct || !ct.length) return 0; if (ct.children().length < 2 && ct.children()[0].nodeName == 'DIV'){ return ct.children().eq(0); } if (ct.children().length < 3 && ct.children()[0].nodeName == 'FIGURE' && ct.children()[1].nodeName == 'DIV'){ return ct.children().eq(1); } return ct; })('#postContent'); function LoadBanners(banners,funcs,ref){ var pos=$((ref||(Detect.isMob()?'.admob':'.adweb'))+'.banner'), cp = pgContent ? pgContent.children() : 0; var reject=window['_ad_skip_code']||''; $.each(banners, function(i,b){ if(!b.code||reject.indexOf(','+b.pos+',')>-1)return true; if(b.type==='method'){ if(funcs&&funcs[b.code]){funcs[b.code]();} return true; } if(b.type==='repos'){ var skip=b.size; if (skip && skip.substring(skip.length - 1)==='s') { skip = parseInt(skip.replace('s', '')); if (!CookieTimeout('_FullScreenBanner', skip)) return true; } if (b.pos == 'inpara' && ((cp.length * 2 / 3) + 2 < 8)) { return true; } if (b.pos == 'inread' && hasInpg) { return true; } if (b.pos == 'inpage') { hasInpg == 1; } var scr='