clickio

plateandpetalglendale.com layout rotation script

Jun 23rd, 2021 (edited)
1,177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.37 KB | None | 0 0
  1. <script>(function(){function E(a){var c=null,b=F("ClickioRotator");b&&e(a[b])&&(!e(a[b].condition)||a[b].condition())&&(c=""+b);if(!c){var d=0;l(a,function(a,b){if(e(b.condition)&&b.condition()||!e(b.condition))a=b.weight,d+=""===a?0:parseInt(a,10)});if(0<d){var m=Math.floor(Math.random()*(Math.round(d)-1+1))+1,g=0;l(a,function(a,b){if(e(b.condition)&&b.condition()||!e(b.condition))if(g+=parseInt(b.weight,10),g>=m)return c=a,!1})}}return c}function y(a,c,b,d){d=d||!1;if(!e(a)||!e(a.ownerDocument))return!1;
  2. var m=a.ownerDocument;if(!G(a,a.ownerDocument.defaultView))return!1;if(c){var g=[];if(b||d){b=a.firstChild;var f=n("div",m);for(f.innerHTML=c;f.firstChild;)p(f.firstChild)?g.push(f.firstChild):r(f.firstChild.childNodes,function(a){p(f.firstChild.childNodes[a])&&g.push(f.firstChild.childNodes[a])}),d?a.insertBefore(f.firstChild,b):a.appendChild(f.firstChild)}else a.innerHTML=c,r(a.childNodes,function(b){p(a.childNodes[b])?g.push(a.childNodes[b]):r(a.childNodes[b].childNodes,function(c){p(a.childNodes[b].childNodes[c])&&
  3. g.push(a.childNodes[b].childNodes[c])})});g.length&&l(g,function(b){var c=g[b].parentNode;c?c.removeChild(g[b]):c=a;b=g[b];var d=m;d=d||k;c=c||H;var f=n("script",d);f.type="text/javascript";if(e(b.src)&&b.src)f.src=b.src,f.className=b.className;else{var h=b.text||b.textContent||b.innerHTML||"";f.className=b.className;f.appendChild(d.createTextNode(h))}c.appendChild(f)})}}function F(a,c){var b=z(q.location.search),d=null;e(b[a])?d=b[a]:(b=z(q.location.hash),e(b[a])?d=b[a]:d=c||null);return d}function A(){e(k.body)&&
  4. k.body||setTimeout(A,10)}function B(a,c){return e(c)?(c=Math.pow(10,c),Math.round(a*c)/c):Math.round(a)}function I(a){a=a||10;if(10<a){for(var c="",b=10;0<a;)c+=Math.round(Math.pow(36,b+1)-Math.random()*Math.pow(36,b)).toString(36).slice(1),a-=b,a<b&&(b=a);return c}return Math.round(Math.pow(36,a+1)-Math.random()*Math.pow(36,a)).toString(36).slice(1)}function e(a){return"undefined"!=typeof a}function C(a,c){c=e(c)?c:!1;return e(a)?a:c}function D(a,c,b){b=b||k;return c?b.getElementsByTagName(a):b.getElementsByTagName(a)[0]}
  5. function l(a,c){for(var b in a)if(a.hasOwnProperty(b)&&"length"!==b&&!1===c.call(a[b],b,a[b]))break}function r(a,c){for(var b=0;b<a.length&&(!a.hasOwnProperty(b)||"length"===b||!1!==c.call(a[b],b,a[b]));b++);}function z(a){if(!e(t[a])){a=a.split("+").join(" ");for(var c={},b=("?"===a[0]||"#"===a[0]?a.substr(1):a).split("&"),d=0;d<b.length;d++){var m=b[d].split("=");c[decodeURIComponent(m[0])]=decodeURIComponent(m[1]||"")}t[a]=c}return t[a]}function n(a,c){c=c||k;return c.createElement(a)}function u(a,
  6. c){if(null==a||"object"!==typeof a)return a;if(void 0==c)c=[];else{var b,d=c.length;for(b=0;b<d;b++)if(a===c[b])return a}c.push(a);if("function"==typeof a.clone)return a.clone(!0);if("[object Array]"==Object.prototype.toString.call(a)){d=a.slice();for(b=d.length;b--;)d[b]=u(d[b],c);return d}if(a instanceof Date)return new Date(a.getTime());if(a instanceof RegExp)return new RegExp(a);if(a.nodeType&&"function"==typeof a.cloneNode)return a.cloneNode(!0);b=Object.getPrototypeOf?Object.getPrototypeOf(a):
  7. a.__proto__;b||(b=a.constructor.prototype);d=v(b);for(var e in a)d[e]=u(a[e],c);return d}function G(a,c){c=c||q;return e(a)?a instanceof c.HTMLElement:!1}function p(a){return e(a)&&a.nodeName&&"script"===a.nodeName.toLowerCase()&&(!a.type||"text/javascript"===a.type.toLowerCase())}var k=document,q=window,H=function(a){a=a||k;var c=a.documentElement,b=D("head",!1,a);if(b)return b;for(b=c.firstChild;b&&"#text"==b.nodeName.toLowerCase();)b=b.nextSibling;if(b&&"#text"!=b.nodeName.toLowerCase())return b;
  8. a=n("head",a);c.appendChild(a);return a}();A();var t={},v=Object.create;"function"!==typeof v&&(v=function(a){function c(){}c.prototype=a;return new c});var w=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},x=!1;"complete"!==k.readyState&&(x=!0,k.addEventListener("readystatechange",function(){"complete"==k.readyState&&(x=!1)},!1));q.ClickioRotator=function(a){a=u(a);var c=E(a),b=I(15)+((new Date).getTime()%1E7*100+B(99*Math.random()));return c?(e(a[c].head)&&
  9. y(D("head"),a[c].head,!0),{getSession:function(){return b},getChosenVariantId:function(){return c},install:function(){var a=null,b=null;2==arguments.length?(b=arguments[0],a=arguments[1]):a=arguments[0];a&&e(a[c])&&(w(a[c])||(a[c]=[[a[c]]]),l(a[c],function(d){d=a[c][d];w(d)||(d=[d]);var e=C(d[0]),h=C(d[1]);!h&&e&&(h=e,e="html");w(h)||(h=[h]);if("track"==e)l(h,function(a){n("img").src=h[a]+"&_lxrnd_="+((new Date).getTime()%1E7*100+B(99*Math.random()))});else if(x&&!b)l(h,function(a){k.write(h[a])});
  10. else if(b){var g=k.querySelector(b);g&&l(h,function(a){y(g,h[a],!0)})}}))}}):null}})();
  11. (function(w, d){   
  12.     (w.__lxGc__=w.__lxGc__||{'s':{},'b':0}).cmd=w.__lxGc__.cmd||[];    
  13.     var sid = '_221276';   
  14.     var config = {
  15.        'layout 1':   {
  16.            'weight': 50,
  17.            'adunits': {
  18.                 'd_dwnld_bottom_728': '_678197',
  19.                 'd_dwnld_middle_728': '_678192',
  20.                 'd_dwnld_sidebar_336': '_678201',
  21.                 'd_dwnld_top_728': '_678188',
  22.                 'd_unit_bottom_728': '_678184',
  23.                 'd_unit_middle_300': '_678206',
  24.                 'd_unit_middle_728': '_678183',
  25.                 'd_unit_sidebar1_336': '_678180',
  26.                 'd_unit_sidebar2_336': '_678204',
  27.                 'd_unit_top_336': '_678178',
  28.                 'm_dwnld_bottom_320': '_678203',
  29.                 'm_dwnld_middle_300': '_678198',
  30.                 'm_dwnld_top_300': '_678194',
  31.                 'm_unit_bottom_320': '_678190',
  32.                 'm_unit_middle_300': '_678398',
  33.                 'm_unit_top_320': '_678176'            
  34.            }
  35.        },
  36.        'layout 2':   {
  37.            'weight': 50,
  38.            'adunits': {
  39.                 'd_dwnld_middle_728': '_671866',
  40.                 'd_dwnld_sidebar_336': '_671864',
  41.                 'd_dwnld_top_728': '_671870',
  42.                 'd_unit_middle_728': '_671868',
  43.                 'd_unit_sidebar1_336': '_671874',
  44.                 'd_unit_top_336': '_671872',
  45.                 'm_dwnld_middle_300': '_671878',
  46.                 'm_dwnld_top_300': '_671876',
  47.                 'm_unit_top_320': '_671882'
  48.            }
  49.        },
  50.    };
  51.    var layoutRotator = new ClickioRotator(config);
  52.    var v = layoutRotator.getChosenVariantId();
  53.    Object.keys(config[v].adunits).forEach(function(k){
  54.         __lxGc__.cmd.push(function(){
  55.            __lxGc__.display(k, sid, config[v].adunits[k]);
  56.        });
  57.    });
  58. })(window, document);
  59. </script>
Add Comment
Please, Sign In to add comment