(function() {
  var c=false,d;function e(a,b){g.prototype[a]=b};function g(a){this.r=a.analytics_tracker;this.u=a.frequency_to_run||1;this.b=a.experiment_id;this.q=a.variations;this.a=null;this.p=a.use_cookies;this.s=a.debug_enabled||c;this.t=a.debug_textarea_id;this.z=a.initHook;this.w=a.convertHook;this.g=c;this.e=[];this.i="gweb-experiment-"+this.b+" ";try{this.d=this.r}catch(b){this.d=null,this.g=c,this.c("Couldn't find a Google Analytics tracker.")}this.l()&&this.d?(this.c("Active variation: "+this.a),this.g=true,this.n(),this.m(),this.o(),this.h()):this.c("Not running experiment.")}
d=g.prototype;d.c=function(a){if(this.s&&(this.f=document.getElementById(this.t)))this.f.value+="* "+a+"\n",this.f.scrollTop=this.f.scrollHeight};d.m=function(){this.i+="gweb-variation-"+this.a;this.c("Setting Analytics variable: "+this.i);this.d._setVar(this.i)};d.n=function(){this.e=this.getElementsByClassName("gwebx-variation",document.body);for(var a in this.e)this.e[a].className.indexOf("gwebx-variation-"+this.a)==-1?this.j(this.e[a]):this.show(this.e[a])};
d.getElementsByClassName=function(a,b){for(var f=[],n=RegExp("\\b"+a+"\\b"),l=b.getElementsByTagName("*"),k=0,o=l.length;k<o;k++)n.test(l[k].className)&&f.push(l[k]);return f};d.show=function(a){a.style.display="block"};d.j=function(a){a.style.display="none"};d.l=function(){return this.k()?(this.a=this.a,true):this.u>Math.random()?(this.a=this.q[Math.floor(this.q.length*Math.random())],true):c};
d.k=function(){var a=RegExp("gwebx="+this.b+",([^&]*)"),a=a.exec(window.location.hash);if(a!=null){var b=a[1];this.h();return this.a=b}if(this.p){var a=document.cookie,f=a.indexOf("gwebx=");if(f!=-1){b=f+6;f=a.indexOf(";",b);if(f==-1)f=a.length;b=a.substring(b,f)}a=RegExp(this.b+",([^&]*)");a=a.exec(b);if(a!=null)return this.a=b=a[1],this.h(),this.a}return null};
d.h=function(){if(this.p){var a=new Date,b=location.href.substring(location.href.lastIndexOf("://")+3,location.href.length),b=b.substring(b.indexOf("/"),b.lastIndexOf("/")+1);a.setTime(a.getTime()+864E5);document.cookie="gwebx="+this.b+","+this.a+";path="+b+";expires="+a.toGMTString()+";"}};d.o=function(){this.g!=c&&(this.d._trackEvent("Gweb Experiment: "+this.b,"View: "+this.a),this.c("Tracking Analytics Event: Gweb Experiment: "+this.b+", View: "+this.a))};
d.v=function(){if(this.g!=c){var a=arguments;a.length==0?(this.c("Successful conversion."),this.c("Tracking Analytics Event: Gweb Experiment: "+this.b+", Success: "+this.a),this.d._trackEvent("Gweb Experiment: "+this.b,"Success: "+this.a)):(this.c("Successful conversion with label: "+a[0]),this.c("Tracking Analytics Event: Gweb Experiment: "+this.b+", Success: "+this.a+", "+a[0]),this.d._trackEvent("Gweb Experiment: "+this.b,"Success: "+this.a,a[0]))}};
var h=g,i="gweb.analytics.experiment".split("."),j=this;!(i[0]in j)&&j.execScript&&j.execScript("var "+i[0]);for(var m;i.length&&(m=i.shift());)!i.length&&h!==void 0?j[m]=h:j=j[m]?j[m]:j[m]={};e("logDebug",g.prototype.c);e("setAnalyticsVar",g.prototype.m);e("showVariationNodes",g.prototype.n);e("getElementsByClassName",g.prototype.getElementsByClassName);e("show",g.prototype.show);e("hide",g.prototype.j);e("runExperimentOrNot",g.prototype.l);e("pickExistingVariation",g.prototype.k);
e("setVariation",g.prototype.h);e("trackExperimentView",g.prototype.o);e("trackSuccess",g.prototype.v);
})();
