4 $(".annoy-banner-on").each(function() {
6 var tag = 'annoyed' + $on.attr('data-target');
7 var $target = $($on.attr('data-target'));
8 var $off = $('.annoy-banner-off', $target);
10 $on.click(function(e) {
12 $target.slideDown('fast');
14 if (Modernizr.localstorage) localStorage.removeItem(tag);
15 _paq.push(['trackEvent', 'banner', 'banner-unhide', $target.attr('id')]);
18 $off.click(function() {
19 $target.slideUp('fast');
21 if (Modernizr.localstorage) localStorage[tag] = true;
22 _paq.push(['trackEvent', 'banner', 'banner-hide', $target.attr('id')]);
25 if (!localStorage[tag]) {
28 _paq.push(['trackEvent', 'banner', 'banner-show', $target.attr('id')]);
32 $(document).on('click', ".annoy-banner a", function() {
33 banner = $(this).closest('.annoy-banner');
34 _paq.push(['trackEvent', 'banner', 'banner-click', banner.attr('id')]);
36 $(document).on('click', ".dynamic-insert a", function() {
37 banner = $(this).closest('.dynamic-insert');
38 _paq.push(['trackEvent', 'dynamic-insert', 'dynamic-insert-click', 'insert-' + banner.attr('data-paragraphs') + '-pars-text-' + banner.attr('data-textid')]);