jQuery321(function($) { $(document).ready(function() { var allwidth = $(window).width(); var allheight = $('body').height(); var allbl=0; var lasttop=0; var pcnt=0; var pminh = 70; var ab_start_top = 70; var stepads=0; var ab_step_ads_min=500; var allbl_max=100; var ctm=''; var uscode='tKnuTJoglUi'; var abll=1; var ab=0; var deltatop=0; var lastpw=0; //setTimeout('jQuery321(window).scroll();', 1000); // if (!stepads && allheight > 0) { stepads=Math.max(Math.min(Math.round(allheight*0.6 / allbl_max), 500), ab_step_ads_min); } var blocks=[]; blocks.push([window.location.href, document.referrer, screen.width, screen.height, !!('ontouchstart' in window), encodeURIComponent(document.title.substring(0,250)), ab, ctm]); var llblock=[]; $('div').each(function(i,e) { var c=$(this).attr("class"); if (c) { var r = c.match(/(\w{11})\-([\w0-9\-\_]+)/i); if (r) { var pos = $(this).offset(); var ucode=r[1]; var blockname=r[2]; // blocks.push([ucode, blockname, 0, pos.top, $(this).parent().width()]); $(this).attr("data-width", $(this).parent().width()); } } }); // // $('p,h1,h2,h3,img,ul,ol').each(function(i){ var lastph=0; var tag=$(this)[0].tagName; var par=$(this).parent()[0].tagName; var w=$(this).width(); var h=$(this).height(); var pos = $(this).offset(); var top2=pos.top+h/2+deltatop; if (w > 200) lastph=w; if (tag=='IMG' && h==1) { deltatop+=Math.round(lastph*0.7); w=lastph; } // if (top2 >= ab_start_top && w > allwidth*0.3 && (top2 > lasttop + stepads || tag=='H1') && par!='BLOCKQUOTE' && par!='FORM' && $(this).is(":visible") && allbl < allbl_max) { if (h > pminh || tag.match(/^H/) && tag.length > 30 || tag=='IMG') { pcnt = pcnt + 1; var blockname='p'+pcnt; var code='
'; //var code='{%'+blockname+'%}'; if (tag=='H1' || tag=='IMG' || tag=='OL' || tag=='UL' || tag == 'SJDIV' ) { if ($(this).parent().height() < 2000) { // if ($(this).parent().parent().height() > 2000) $(this).parent().after(code); } else { $(this).after(code); } } else $(this).before(code); var newadd=$('.'+uscode+'-'+blockname); if (typeof $(newadd) != 'undefined' && typeof $(newadd).offset() != 'undefined') { var parent_width=$(newadd).parent().width(); $('.'+uscode+'-'+blockname).attr("data-width", parent_width); blocks.push([uscode, blockname, 1, $(newadd).offset().top, parent_width]); } // allbl=allbl + 1; lasttop=top2+100; if (tag=='IMG') lasttop+=Math.round(stepads*1.5); } } }); $.ajax({ type: "POST", url: "//log24.ru/tKnuTJoglUi.js?pn=1&p="+encodeURIComponent(window.location), data: "b="+encodeURIComponent(window.btoa(unescape(encodeURIComponent( JSON.stringify(blocks) )))), context:this, success: function (data){ // var out=data.out; if (data.footer) $('body').append(data.footer); $.each(out,function(index,html){ if (html!=null && typeof $('.'+index).offset() != 'undefined') { // var pls=data.pls[index]; // // if (abll && typeof pls !='undefined') { var vtop=$('.'+index).offset().top; llblock.push([vtop,index,html,pls]); // } else { $('.'+index).html(html); } $('.'+index).click(function(e){ jsclick(index, 'div', pls); }); //$('.'+index).iframeTracker({ blurCallback: function(e){ jsclick(index, 'iframe', pls); } }); } }); setTimeout('jQuery321(window).scroll();', 100); } }); // crutch if (typeof jQuery == 'undefined') jQuery=$.noConflict(true); // $(window).scroll(function() { var ttop=$(window).scrollTop()+$(window).height(); var tstep = 400; for(var i = 0; i < llblock.length; i += 1) { if (typeof llblock[i] == "undefined") continue; else var nowblock=llblock[i]; // ближайший блок if (ttop < 2000) tstep = 800; else tstep = 400; // if (ttop+tstep > nowblock[0]) { $('.'+nowblock[1]).append(nowblock[2]+''); // llblock.splice(i,1); i=-1; } } }); function jsclick(classname, type, pls) { var parentOffset = $('.'+classname).offset(); var relX = Math.round(window.event.clientX - parentOffset.left); var relY = Math.round(window.event.clientY - (parentOffset.top - $(window).scrollTop())); var solt=''; var addarr=[blocks[0], pls]; var gmt_offset = new Date().getTimezoneOffset(); // $.ajax({ type: "GET", url: "//log24.ru/tKnuTJoglUi.js?clc=?&p="+encodeURIComponent(window.location)+"&cn="+encodeURIComponent(classname)+"&b="+encodeURIComponent(window.btoa(unescape(encodeURIComponent( JSON.stringify(addarr) ))))+"&tp="+type+"&rx="+relX+"&ry="+relY+"&d="+Date.now()+"&l="+(typeof pollanguage != "undefined" ? pollanguage : '')+"&o="+gmt_offset, dataType: 'json', success: function (data){ } }); } }); });