/*
 *  Gatling Analytics
 *
 *  Copyright (c) 2010 Knewton
 *  Dual licensed under:
 *      MIT: http://www.opensource.org/licenses/mit-license.php
 *      GPLv3: http://www.opensource.org/licenses/gpl-3.0.html
 */
"use strict";(function(g){var q={},j=/<\/?\w+((\s+(\w|\w[\w\-]*\w)(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i,k=document.location.protocol==="https:",e={},r=[],o={path:undefined,globals:undefined,loaded:undefined,prefix:undefined,securePrefix:undefined,image:undefined,trackerID:undefined,ready:g.noop,params:undefined,replacements:undefined},a={trackerID:"%evo-tracker-id%"},m=new Image(),l=document.write,p;function i(t,u,v){if(e[t]===undefined){e[t]=g.extend(true,{},o,u);e[t].replacements=g.extend({},a,v);var s={};if(e[t].globals!==undefined){g.each(e[t].globals,function(){s[this]=true})}e[t].globals=s}}function c(t){if(t.attr("src")===undefined){t.appendTo("body")}else{var u,s=[];g.each(r,function(){if(this.regex.test(t.attr("src"))){u=this.listener}else{s.push(this)}});r=s;g.getScript(t.attr("src"),u)}}function d(s){if(!p){l.call(document,s);return}if(j.test(s)){var t=g(s);if(t.is("script")){c(t)}else{g("script",t).each(function(){c(g(this))})}t.not("script").appendTo("body")}else{l.call(document,s)}}function h(t){var s=[];g.each(t,function(u,v){s.push(u+"="+v)});return s.length>0?("?"+s.join("&")):""}function b(t){var s={};g.each(t.params,function(u,v){if(t.globals[u]===true){window[u]=v}else{s[u]=v}});return s}function f(t){var u="http"+(k?"s":"")+"://",s={};if(t.securePrefix!==undefined&&k){u+=t.securePrefix}else{if(t.prefix!==undefined){u+=t.prefix}}u+=t.path||t.image;t.params=b(t);t.params=g.extend(t.params,{trackerID:t.trackerID});g.each(t.params,function(v,w){if(t.replacements[v]){u=u.replace(t.replacements[v],w)}else{s[v]=w}});u+=h(s);p=true;if(t.path!==undefined){g.getScript(u,function(){if(g.isFunction(t.loaded)){t.loaded(t)}else{t.ready(t)}})}else{if(t.image!==undefined){m.src=u;if(g.isFunction(t.loaded)){t.loaded(t)}}}}function n(t,x,v,w,s){if(e[t]===undefined){return false}var u=g.extend(true,{},e[t]);u.params=w||{};u.ready=g.isFunction(v)?v:g.noop||function(){};u.trackerID=x;u.loaded=s||u.loaded;f(u);return u}g.extend(q,{defineTracker:i,createTracker:n,load:function(s){var t=[];g.each(s,function(){t.push(n(this.type,this.id,this.listener,this.params,this.loaded))});return t},scriptListener:function(s,t){r.push({regex:s,listener:t});return q}});i("marin",{path:"tracker.marinsm.com/tracker/%evo-tracker-id%.js",loaded:function(){try{_marinTrack.trackPage()}catch(s){}}});i("ga",{path:"google-analytics.com/ga.js",prefix:"www.",securePrefix:"ssl.",loaded:function(s){s.ready(s,_gat._getTracker(s.trackerID))}});i("fastclick",{prefix:"media.",securePrefix:"secure.",image:"fastclick.net/w/tre"});i("hubspot",{path:"%evo-tracker-id%/salog.js.aspx",globals:["hs_ppa","hs_portalid","hs_salog_version"]});i("googleAdds",{path:"www.googleadservices.com/pagead/conversion.js",globals:["google_conversion_id","google_conversion_language","google_conversion_format","google_conversion_color","google_conversion_label","google_conversion_value"]});i("googleAddsNoScript",{image:"www.googleadservices.com/pagead/conversion/%google_converstion_id%/?label=%google_conversion_label%&amp;guid=ON&amp;script=0"},{google_conversion_id:"%google_converstion_id%",google_conversion_label:"%google_conversion_label%"});i("chartbeat",{securePrefix:"s3.amazonaws.com/",path:"static.chartbeat.com/js/chartbeat.js",globals:["_sf_async_config"]});i("linkshare",{image:"track.linksynergy.com/ep"});i("facebook",{path:"ah8.facebook.com/js/conversions/tracking.js"});i("tellapal",{path:"widgets.tellapal.com/sale.gif"});i("bing",{path:"0.r.msn.com/scripts/microsoft_adcenterconversion.js",globals:["microsoft_adcenterconversion_domainid","microsoft_adcenterconversion_cp"]});i("yieldmanager",{image:"ad.yieldmanager.com/pixel"});i("adbrite",{image:"bstats.adbrite.com/click/bstats.gif"});i("adready",{image:"adready.com/ce/%account%/%page%/"},{account:"%account%",page:"%page%"});g.gatling=q;g.urlParam=function(s){var t=new RegExp("[\\?&]"+s+"=([^&#]*)").exec(window.location.href);return g.isArray(t)?t[1]:undefined};document.write=d;document.writeln=d;window._sf_startpt=(new Date()).getTime();g(function(){window._sf_endpt=(new Date()).getTime();g("a.deferred-script-load").each(function(){g.getScript(g(this).attr("href"))})})}(jQuery));