PageSourceSearch

https://www.johncow.com/leadbox-781.js

js johncow.com collected 2026-10-02 06:51:54 UTC 25,285 bytes, 853 lines download raw bytes

1/* eslint-disable */
2;
3(function(context) {
4
5  var Patches = {
6    String: {
7      reverse: function() {
8        return this.split("")
9          .reverse()
10          .join("");
11      }
12    },
13    Array: {
14      indexOf: function(obj, start) {
15        for (var i = start || 0; i < this.length; i++)
16          if (this[i] === obj)
17            return i;
18        return -1;
19      }
20    }
21  };
22
23  for (var key in Patches)(function() {
24    var patch = Patches[key];
25    var target = context[key];
26    if (patch && target) {
27      for (var method in patch) {
28        if (!(method in target)) {
29          target.prototype[method] = patch[method];
30        }
31      }
32    }
33  })();
34
35})(this);
36
37var safetyCheck = false;
38
39function showFancyLeadboxes() {
40  safetyCheck = true;
41  console.log('We can safely display timed/exit leadboxes.');
42}
43(function() {
44  var debugblock = window.location && String(window.location.hash) === '#debugblock';
45  if (debugblock) {
46    safetyCheck = false;
47    return;
48  }
49
50  var safetyUrl = 'http://my.leadpages.net/static/all/js/can-i-show.js';
51  var getSegment = function(url) {
52    var segments = url.split('/');
53    if (!~segments[0].indexOf('http')) {
54      safetyUrl = '//' + segments[0] + '/static/all/js/can-i-show.js';
55    } else {
56      safetyUrl = '//' + segments[2] + '/static/all/js/can-i-show.js';
57    }
58    return safetyUrl;
59  };
60  if (document.currentScript) {
61    safetyUrl = getSegment(document.currentScript.src);
62  } else {
63    var scripts = document.getElementsByTagName("script");
64    for (var i = 0; i < scripts.length; i++) {
65      var url = scripts[i].getAttribute('data-url');
66      var match = url && url.match(/(.+\/)leadbox\/([0-9a-fA-F]+%3A[0-9a-fA-F]+)\/([0-9]+)\/$/);
67      if (match) {
68        safetyUrl = getSegment(url);
69        break;
70      }
71    }
72  }
73
74  var script = document.createElement('script');
75  script.src = safetyUrl;
76  document.getElementsByTagName('head')[0].appendChild(script);
77})();
78
79;
80(function() {
81
82  if (window.LEADBOX) return;
83  else window.LEADBOX = {};
84
85  LEADBOX.debugging = window.location && String(window.location.hash) === '#debugging';
86
87  // Utilities //
88
89  function getSize(callback) {
90    var body = window.document.body,
91      doc = window.document.documentElement,
92      documentWidth = Math.max(body.scrollWidth, doc.scrollWidth,
93        body.offsetWidth, doc.offsetWidth,
94        doc.clientWidth),
95      documentHeight = Math.max(body.scrollHeight, doc.scrollHeight,
96        body.offsetHeight, doc.offsetHeight,
97        doc.clientHeight),
98      viewportWidth = window.innerWidth || doc.clientWidth ||
99      body.clientWidth,
100      viewportHeight = window.innerHeight || doc.clientWidth ||
101      body.clientWidth;
102
103    // FB.Canvas may be defined because the host page is using the FB
104    // JS API, but it will never trigger the callback because the page
105    // is not hosted inside Facebook. As such, we give it 100ms to
106    // trigger the callback, and if it doesn't, we'll just use the
107    // default (non-facebook) values
108    var workaround = window.setTimeout(function() {
109      workaround = null;
110      callback(documentWidth, documentHeight, viewportWidth,
111        viewportHeight);
112    }, 100);
113    if (typeof FB != "undefined" && FB.Canvas) {
114      FB.Canvas.getPageInfo(function(info) {
115        if (workaround == null)
116          return; // too late
117        window.clearTimeout(workaround);
118        workaround = null;
119
120        if (info.clientWidth - info.offsetLeft < viewportWidth)
121          viewportWidth = info.clientWidth - info.offsetLeft;
122        if (info.clientHeight - info.offsetTop < viewportHeight)
123          viewportHeight = info.clientHeight - info.offsetTop;
124        callback(documentWidth, documentHeight, viewportWidth,
125          viewportHeight);
126      });
127    }
128  }
129
130  function getScroll(callback) {
131    var doc = document.documentElement,
132      body = document.body,
133      left = doc && doc.scrollLeft || body && body.scrollLeft || 0,
134      top = doc && doc.scrollTop || body && body.scrollTop || 0;
135
136    // FB.Canvas may be defined because the host page is using the FB
137    // JS API, but it will never trigger the callback because the page
138    // is not hosted inside Facebook. As such, we give it 100ms to
139    // trigger the callback, and if it doesn't, we'll just use the
140    // default (non-facebook) values
141    var workaround = window.setTimeout(function() {
142      workaround = null;
143      callback(left, top, 0, 0);
144    }, 100);
145
146    if (typeof FB != "undefined" && FB.Canvas) {
147      FB.Canvas.getPageInfo(function(info) {
148        if (workaround == null)
149          return; // too late
150        window.clearTimeout(workaround);
151        workaround = null;
152
153        callback(left, top, info.scrollLeft, info.scrollTop);
154      });
155    }
156  }
157
158  function setScroll(left, top, fb_left, fb_top) {
159    window.scrollTo(left, top);
160    if (typeof FB != "undefined" && FB.Canvas) {
161      FB.Canvas.scrollTo(fb_left, fb_top);
162    }
163  }
164
165  function forEach(array, block, scope) {
166    var set = array.slice(0);
167    for (var i = 0, n = array.length; i < n; i++) {
168      if (false === block.call(scope, set[i], i)) return false;
169    }
170    return true;
171  }
172
173  function addEvent(object, type, handler) {
174    var method;
175    if (object && type && handler) {
176      method = object.addEventListener ? 'addEventListener' : object.attachEvent ? 'attachEvent' : '';
177      type = method == 'addEventListener' ? type : 'on' + type;
178      if (method) {
179        object[method](type, function(event) {
180          event = event ? event : window.event;
181          handler.apply(object, [event]);
182        });
183        return true;
184      }
185    }
186    return false;
187  }
188
189  function addInterval(block, delay) {
190    var interval = {
191      id: null,
192      loop: null,
193      delay: delay,
194      block: block
195    };
196    interval.loop = function() {
197      interval.block();
198      interval.id = setTimeout(interval.loop, interval.delay);
199      return interval;
200    };
201    return interval.loop();
202  }
203
204  function getIntersection(aStart, aEnd, bStart, bEnd) {
205
206    var i = {};
207
208    var aDelta = {
209      x: aEnd.x - aStart.x,
210      y: aEnd.y - aStart.y
211    };
212
213    var bDelta = {
214      x: bEnd.x - bStart.x,
215      y: bEnd.y - bStart.y
216    };
217
218    var s = (-aDelta.y * (aStart.x - bStart.x) + aDelta.x * (aStart.y - bStart.y)) / (-bDelta.x * aDelta.y + aDelta.x * bDelta.y);
219    var t = (bDelta.x * (aStart.y - bStart.y) - bDelta.y * (aStart.x - bStart.x)) / (-bDelta.x * aDelta.y + aDelta.x * bDelta.y);
220
221
222    if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
223      i.x = aStart.x + (t * aDelta.x);
224      i.y = aStart.y + (t * aDelta.y);
225      return i;
226    }
227
228    return null;
229  }
230
231  // Settings //
232
233  var activating = null;
234  var exitor = null;
235  var MouseTracker = (function(debugging) {
236
237    // get a handle on our environment
238
239    var left = navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) ? 1 : 0;
240
241    // define the button area location
242
243    var buttonWidth = 350;
244    var buttonHeight = 50;
245    var chromeHeight = 0;
246
247    // how far ahead to anticipate mouse movement
248    var seconds = 1 / 4;
249
250    // how sure to be they're going for the button
251    var sureness = 1; // (0+)
252
253    // account for user aim
254    var userVariance = 150;
255
256    var size = this.size = {
257      x: null,
258      y: null
259    };
260    var history = this.history = {
261      x: null,
262      y: null
263    };
264    var position = this.position = {
265      x: null,
266      y: null
267    };
268    var prediction = this.prediction = {
269      x: null,
270      y: null
271    };
272    var velocity = this.velocity = {
273      x: 0,
274      y: 0
275    };
276
277    var axis = {
278      'x': 'y',
279      'y': 'x'
280    };
281    var count = 0;
282    var delay = 100;
283    var sure = 0;
284    var ready = false;
285    var past = [];
286    var back = 3;
287
288    var canvas = document && document.documentElement ? document.documentElement : document.body;
289
290    if (debugging) {
291      document.documentElement.style.cursor = 'none';
292      document.body.style.cursor = 'none';
293    }
294
295    function updateSize(event) {
296      getSize(function(dw, dh, width, height) {
297        size.x = width;
298        size.y = height;
299      });
300    }
301
302    function clearPosition(event) {
303      position.x = null;
304      position.y = null;
305    }
306
307    function updatePosition(event) {
308      if (event) {
309        position.x = event.clientX;
310        position.y = event.clientY;
311      }
312
313      if (debugging) {
314        var markers = document.getElementsByTagName('i');
315        var marker = markers && markers[0] ? markers[0] : document.createElement('i');
316
317        document.body.appendChild(marker);
318        // if (!next.x && !next.y) document.body.removeChild(marker);
319
320        marker.style.display = 'block';
321        marker.style.position = 'fixed';
322        marker.style.background = '#000';
323        marker.style.width = '6px';
324        marker.style.height = '6px';
325        marker.style.marginLeft = '-3px';
326        marker.style.marginTop = '-3px';
327        marker.style.left = '' + position.x + 'px';
328        marker.style.top = '' + position.y + 'px';
329        marker.style.cursor = 'none';
330        marker.style.zIndex = 101;
331      }
332
333    }
334
335    function updateVector() {
336
337      var anticipation = seconds * (1000 / delay);
338      var projection = {
339        x: position.x,
340        y: position.y
341      };
342
343      for (var a in axis) {
344        if (position[a] !== null) {
345          velocity[a] = history[a] !== null ? position[a] - history[a] : 0;
346          prediction[a] = position[a] + (velocity[a] * anticipation);
347          history[a] = position[a];
348        } else {
349          history[a] = position[a] = prediction[a] = null;
350        }
351      }
352
353      past = [{
354        x: velocity.x,
355        y: velocity.y
356      }].concat(past.slice(0, back));
357
358      var i = 0;
359      var average = {
360        x: 0,
361        y: 0
362      };
363      forEach(past, function(value, key) {
364        if (key < back) {
365          average.x = average.x + value.x;
366          average.y = average.y + value.y;
367          i++;
368        }
369      });
370      average.x = Math.round(average.x / i) * anticipation;
371      average.y = Math.round(average.y / i) * anticipation;
372      var next = {
373        x: position.x + average.x,
374        y: position.y + average.y
375      };
376
377      // show the predicted placement on the page
378
379      if (debugging) {
380        var markers = document.getElementsByTagName('var');
381        var marker = markers && markers[0] ? markers[0] : document.createElement('var');
382
383        document.body.appendChild(marker);
384        if (!next.x && !next.y) document.body.removeChild(marker);
385
386        marker.style.display = 'block';
387        marker.style.position = 'fixed';
388        marker.style.background = '#AAA';
389        marker.style.width = '6px';
390        marker.style.height = '6px';
391        marker.style.marginLeft = '-3px';
392        marker.style.marginTop = '-3px';
393        marker.style.left = '' + next.x + 'px';
394        marker.style.top = '' + next.y + 'px';
395        marker.style.zIndex = 100;
396
397      }
398
399      // estimate if we are going for the close buttons
400
401      getSize(function(dw, dh, vw, vh) {
402
403        // left = false; // for debugging
404
405        var closeStart = {
406          x: left ? 0 - userVariance : vw - buttonWidth - userVariance,
407          y: -1
408        };
409        var closeEnd = {
410          x: left ? 0 + buttonWidth + userVariance : vw + userVariance,
411          y: -1
412        };
413
414        var intersect = getIntersection(position, next, closeStart, closeEnd);
415
416        if (intersect) {
417          sure++;
418          // console.log(sure, new Date)
419          if (sure > sureness && !velocity.x && !velocity.y) {
420            // if (window.LEADBOX.debugging && window.console && console.log) console.log('exit detected');
421            if (exitor && safetyCheck) {
422              window.LEADBOX.show(exitor);
423              exitor = null;
424            }
425          }
426        } else {
427          sure = 0;
428        }
429      });
430
431    };
432
433    canvas.style.minHeight = '100%';
434
435    // addEvent(canvas, 'mouseout', clearPosition); clearPosition();
436    // addEvent(window, 'mouseout', clearPosition); clearPosition();
437    addEvent(canvas, 'mousemove', updatePosition);
438    updatePosition();
439    addEvent(window, 'resize', updateSize);
440    updateSize();
441
442    addInterval(updateVector, 100);
443  });
444
445  var LeadBoxes = function() {
446
447    var leadboxes = {};
448    var background = document.createElement("div");
449
450    background.style.position = "absolute";
451    background.style.top = background.style.bottom =
452      background.style.left = background.style.right = "0";
453    background.style.zIndex = "2147483646";
454    background.style.background = "black";
455    background.style.width = "100%";
456    background.style.opacity = "0.5";
457    background.style.display = "none";
458    document.body.appendChild(background);
459
460    function init(id, url, stats, idOverride) {
461      var config = {};
462
463      if (leadboxes[id]) return; // leadbox already initialized
464
465      // We need to use this to track whether or not the LeadBox
466      // was actually loaded through JS execution or not. This
467      // is so we can prevent it from double tracking the view
468      // event.
469      if (url[url.length - 1] !== "&") {
470        url += "&";
471      }
472
473      url += "__fromjs=1";
474
475      if (typeof window.postMessage == "undefined" ||
476        /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
477        // mobile device or IE7-; redirect to form
478        leadboxes[id] = [url, stats, config];
479      } else {
480        // desktop; open iframe in popup window
481        leadboxes[id] = [document.createElement("iframe"), stats, config];
482        var parser = document.createElement("a");
483        parser.href = url;
484        if (/test/i.test(parser.hostname.split(".")[1])) {
485          parser.hostname = [
486            parser.hostname.split(".")[0],
487            "lpusercontenttest.com"
488          ].join(".");
489          url = parser.href;
490        }
491        leadboxes[id][0].src = url.replace("lp-in-iframe=0",
492          "lp-in-iframe=1");
493        leadboxes[id][0].style.position = "absolute";
494        leadboxes[id][0].style.left = "0";
495        leadboxes[id][0].style.top = "0";
496        leadboxes[id][0].style.width = "100%";
497        leadboxes[id][0].style.display = "none";
498        leadboxes[id][0].style.border = "none";
499        leadboxes[id][0].style.zIndex = "2147483647";
500
501        leadboxes[id][0].onload = function() {
502          if (window.LEADBOX.debugging) {
503            if (window.console && console.log) console.log('resetting leadbox', id);
504            leadboxes[id][0].contentWindow.postMessage({
505              handler: 'reset',
506              data: {
507                id: idOverride || id
508              }
509            }, '*');
510          }
511          var msg = JSON.stringify({
512            handler: 'visit',
513            visit: {
514              id: idOverride || id
515            }
516          })
517          leadboxes[id][0].contentWindow.postMessage(msg, '*');
518          leadboxes[id][0].onload = null;
519        };
520
521        document.body.appendChild(leadboxes[id][0]);
522
523        getSize(function(documentWidth, documentHeight, width, height) {
524          leadboxes[id][0].style.height = height + "px";
525        });
526      }
527    }
528
529    var active = null,
530      overflow = null;
531
532    // hides the most recently shown leadbox
533    function hide() {
534      if (!active) return;
535
536      // hide frame
537      leadboxes[active][0].style.display = "none";
538      background.style.display = "none";
539      active = null;
540
541      // restore scroll position and scrolling settings
542      document.body.style.overflow = overflow;
543      overflow = null;
544    }
545    background.onclick = hide;
546
547    // generates a v4 uuid
548    function uuid() {
549      return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
550        var r = ((new Date())
551          .getTime() + Math.random() * 16) % 16 | 0;
552        return (c == "x" ? r : (r & 0x7 | 0x8))
553          .toString(16);
554      });
555    }
556
557    // shows a leadbox by id; if another leadbox is currently shown, it is
558    // hidden before proceeding
559    function show(id, idOverride, cb) {
560      if (typeof idOverride === 'function') {
561        cb = idOverride;
562        idOverride = null;
563      }
564
565      // call analytics
566      var url = leadboxes[id][1] + "?",
567        data = {
568          "id": idOverride || id,
569          "uuid": uuid(),
570          "type": "view",
571          "served_by": "leadboxes"
572        };
573        try {
574          leadboxes[id][0].contentWindow.postMessage({
575            handler: 'display',
576            display: {
577              id: idOverride || id
578            }
579          }, '*');
580        } catch (e) {
581          // the show must go on
582        }
583
584      for (var key in data) {
585        if (data[key] !== undefined) {
586          url += encodeURIComponent(key) + "=" +
587            encodeURIComponent(data[key]) + "&";
588        }
589      }
590
591      var image = document.createElement("img");
592      if (typeof leadboxes[id][0] == "string") {
593        // Replace fromjs=1 with fromjs=0 in order to force
594        // view event tracking to happen on the backend in
595        // cases where we open the leadbox in a new tab. This
596        // is so that we track subsequent views as well should
597        // the user re-visit the page later.
598        var lbURL = leadboxes[id][0].replace("__fromjs=1", "__fromjs=0");
599
600        // Open this LeadBox in a new tab. This is the
601        // expected behavior on mobile devices.
602        window.open(lbURL, "_blank");
603      } else {
604        getScroll(function(left, top, fbLeft, fbTop) {
605          // hide previous leadbox, if any
606          hide();
607
608          // get scroll position and body overflow settings
609          overflow = document.body.style.overflow;
610
611          setScroll(left, top, fbLeft, fbTop);
612          document.body.style.overflow = "hidden";
613
614          // show leadbox and update active leadbox reference
615          leadboxes[id][0].style.top = (top + fbTop) + "px";
616          leadboxes[id][0].style.left = (left + fbLeft) + "px";
617          leadboxes[id][0].style.display = "block";
618          background.style.display = "block";
619          active = id;
620          if (cb) cb();
621
622          // call analytics handler
623          image.src = url;
624        });
625      }
626    }
627
628    // called when the leadbox should be resized
629    this.resize = function() {
630      getSize(function(documentWidth, documentHeight, width, height) {
631        background.style.height = documentHeight + "px";
632        for (var id in leadboxes) {
633          if (typeof(leadboxes[id][0]) == "string")
634            continue;
635          leadboxes[id][0].style.height = height + "px";
636        }
637      });
638    };
639
640    var onMessageHandler = function(event) {
641      if (event && event.data && event.data.handler) switch (event.data.handler) {
642        case 'visited':
643          // console.log('visited', event.data);
644          var id = event.data.visit.id;
645          var config = leadboxes[id][2] || {};
646          var visit = event.data.visit;
647
648          // console.log('visited ->', config, event.data.visit)
649
650          var show = true;
651          var day = 1000 * 60 * 60 * 24;
652          var last = Number(new Date(visit['display-date'] || 0));
653          var now = Number(new Date());
654
655
656
657          var visits = visit['visit-count'] || 0;
658
659          last = last ? last / day : 0;
660          now = now / day;
661
662          day = now - last;
663
664          if (config.time) {
665            var time = config.time;
666            var timeout = (time.seconds * 1000) || 0;
667
668            show = true;
669
670            if (time.views) show = show && !(visits % (time.views + 1));
671            if (time.days) show = show && time.days < day;
672            if (show) setTimeout(function() {
673              if (safetyCheck) {
674                window.LEADBOX.show(id);
675              }
676            }, timeout);
677          }
678          if (config.exit) {
679            var exit = config.exit;
680            show = true;
681            if (exit.days) show = show && exit.days < day;
682            if (show) exitor = id;
683            // console.log('exit', config.exit, new Date(visit['display-date']));
684          }
685          break;
686        case 'displayed':
687          break;
688      }
689      if (event.data == "close") hide();
690    };
691
692    // prep leadboxes
693    var scripts = document.getElementsByTagName("script");
694    var triggers = document.getElementsByTagName("a"),
695      callback = function(event) {
696        var id = this.getAttribute("data-leadbox");
697        var idOverride = this.getAttribute("data-leadbox-id");
698        if (id) {
699          if (event && event.preventDefault) event.preventDefault();
700          show(id, idOverride);
701        }
702      };
703
704    for (var i = 0; i < triggers.length; i++) {
705      try {
706        (function() {
707          var id;
708          var trigger = triggers[i];
709          var url = trigger.getAttribute("href");
710          var match = url.split("?")[0].match(/(.+\/)leadbox\/([0-9a-fA-F]+%3A[0-9a-fA-F]+)\/([0-9]+)\/$/);  // allow for "?uriparm=urival&etc=etc" suffix too
711
712          if (match) {
713
714            id = match[2] = decodeURIComponent(match[2]);
715            init(url, // form-id
716              url + // iframe url
717              ((url.indexOf("?") == -1) ? "?" : "&") + // query separator
718              "lp-in-iframe=0&" + // position fix
719              window.location.search.replace(/^\?/, ""), // prepopulation
720              match[1] + "forms/pixel/" + match[3] + "/",
721              id
722            ); // analytics url
723            trigger.setAttribute("data-leadbox", url);
724            trigger.setAttribute("data-leadbox-id", id);
725            trigger.onclick = callback;
726          }
727
728        })();
729      } catch (e) {
730        // show must go on
731      }
732    }
733
734    for (var i = 0; i < scripts.length; i++) {
735      (function(script) {
736        var id = script.getAttribute('data-leadbox');
737        var url = script.getAttribute('data-url');
738        var match = url && url.match(/(.+\/)leadbox\/([0-9a-fA-F]+%3A[0-9a-fA-F]+)\/([0-9]+)\/$/);
739        var config = script.getAttribute('data-config');
740        config = config && JSON && JSON.parse(unescape(config));
741
742        if (match) {
743          var formUrl = url + // iframe url
744            ((url.indexOf("?") == -1) ? "?" : "&") + // query separator
745            "lp-in-iframe=0&" + // position fix
746            window.location.search.replace(/^\?/, ""); // prepopulation
747          var statUrl = match[1] + "forms/pixel/" + match[3] + "/";
748
749          init(id, formUrl, statUrl);
750
751          if (config && config.type) {
752            // console.log(id, config, leadboxes[id]);
753            var settings = leadboxes[id][2] = leadboxes[id] ? leadboxes[id][2] : {};
754            settings[config.type] = config.settings;
755            // console.log(leadboxes[id]);
756          }
757
758        }
759
760      })(scripts[i]);
761    }
762
763    // setup leadbox close handlers
764    window.formFrameClosed = hide;
765
766    // setup leadbox window handlers
767    addEvent(window, 'message', onMessageHandler);
768
769    // start mouse tracking if exitor has been set
770    // console.log('MouseTracker', exitor, window.LEADBOX.debugging)
771    // setTimeout(function(){ new MouseTracker(window.LEADBOX.debugging) });
772    setTimeout(function() {
773      new MouseTracker()
774    });
775
776    // public controller
777    window.LEADBOX.reset = function(id) {
778      var key;
779      for (key in leadboxes) {};
780      if (leadboxes && leadboxes[key]) {
781        leadboxes[key][0].contentWindow.postMessage({
782          'handler': 'reset',
783          'data': {
784            id: id
785          }
786        }, '*');
787      }
788    };
789    window.LEADBOX.show = function(id) {
790      // console.log('show?', id)
791      if (id && activating !== id && active !== id) {
792        activating = id;
793        // console.log('post')
794        leadboxes[id][0].contentWindow.postMessage({
795          handler: 'display',
796          display: {
797            id: id
798          }
799        }, '*');
800        show(id, function() {
801          activating = null;
802          // console.log('shown.', id);
803        });
804      }
805    };
806    window.LEADBOX.hide = function() {
807      hide();
808    };
809
810    if (window.LEADBOX && window.LEADBOX.debugging) {
811      if (window.console && console.log) console.log('debugging detected, resetting active leadboxes');
812      // window.location.hash = 'debugged';
813    }
814
815  };
816
817  var load = function() {
818    if (!window.ae417310535411e38f960800200c9a66)
819      window.ae417310535411e38f960800200c9a66 = new LeadBoxes();
820    window.ae417310535411e38f960800200c9a66.resize();
821  };
822
823  // bind to 'load' and 'resize' (standards)
824  if (window.addEventListener) {
825    window.addEventListener("load", load);
826    window.addEventListener("resize", load);
827    // speed-up load where possible
828    document.addEventListener("DOMContentLoaded", load);
829  }
830  // tender love & care for internet explorer
831  else if (window.attachEvent) {
832    window.attachEvent("onload", load);
833    window.attachEvent("onresize", load);
834    // speed up load event
835    document.attachEvent("onreadystatechange", function() {
836      if (document.readyState === "complete")
837        load();
838    });
839  } else {
840    var oldLoad = window.onload,
841      oldResize = window.onresize;
842    window.onload = function() {
843      load();
844      if (typeof oldLoad == "function")
845        oldLoad();
846    };
847    window.onresize = function(e) {
848      load();
849      if (typeof oldResize == "function")
850        oldResize(e);
851    };
852  }
853})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.