// domready https://github.com/ded/domready !function(a,ctx,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&typeof define.amd=="object"?define(b):ctx[a]=b()}("domready",this,function(a){function m(a){l=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k="readyState",l=/^loade|c/.test(e[k]);return e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d),m()},d),g&&e.attachEvent(j,c=function(){/^c/.test(e[k])&&(e.detachEvent(j,c),m())}),a=g?function(c){self!=top?l?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){l?a():b.push(a)}}); domready(function() { // jquery-cookie https://github.com/carhartl/jquery-cookie (function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){function n(e){return e}function r(e){return decodeURIComponent(e.replace(t," "))}function i(e){if(e.indexOf('"')===0){e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{return s.json?JSON.parse(e):e}catch(t){}}var t=/\+/g;var s=e.cookie=function(t,o,u){if(o!==undefined){u=e.extend({},s.defaults,u);if(typeof u.expires==="number"){var a=u.expires,f=u.expires=new Date;f.setDate(f.getDate()+a)}o=s.json?JSON.stringify(o):String(o);return document.cookie=[s.raw?t:encodeURIComponent(t),"=",s.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}var l=s.raw?n:r;var c=document.cookie.split("; ");var h=t?undefined:{};for(var p=0,d=c.length;p 0) { vers = tst.winner; analytics = false; } if (analytics) { this.fireAnalytics(tst, vers); } }, fireAnalytics: function(tst, vers) { var ga_dim = {}; if (typeof _gaq !== 'undefined') { _gaq.push(['_setCustomVar', tst.tstIndex, 'AB: ' + tst.test_name, tst.versNames[vers - 1], 2]); _gaq.push(['_trackEvent', 'AB Testing', 'Test View', tst.test_name + ' - ' + tst.versNames[vers - 1]]); } else if (typeof ga === 'function' && typeof ab.ga_dim !== 'undefined'){ ga('set', ab.ga_dim, tst.test_name + ' - ' + tst.versNames[vers - 1]); ga('send', 'event', 'AB Testing', 'Test View'); } } };