/*! jquery.universal-analytics - v0.0.7 - 2014-03-01 * https://github.com/tomfuertes/jquery-universal-analytics * Copyright (c) 2014 Tom Fuertes; Licensed MIT */ !function(a){function b(){try{FB.Event.subscribe("edge.create",function(a){ga("send","social","facebook","like",a)}),FB.Event.subscribe("edge.remove",function(a){ga("send","social","facebook","unlike",a)}),FB.Event.subscribe("message.send",function(a){ga("send","social","facebook","send",a)})}catch(a){}}function c(){function a(a){if(a&&"tweet"===a.type||"click"===a.type){var b=a.type+("click"===a.type?"-"+a.region:"");ga("send","social","twitter",b)}}try{twttr.events.bind("click",a),twttr.events.bind("tweet",a)}catch(b){}}a.universalAnalytics=function(b){b=a.extend({},a.universalAnalytics.options,b);for(var c in b)b.hasOwnProperty(c)&&"function"==typeof a.universalAnalytics[c]&&a.universalAnalytics[c]()},a.universalAnalytics.options={trackLinks:!0,trackForms:!0,trackSocial:!0},a.universalAnalytics.trackLinks=function(){a(document).on("mousedown","a",function(){var b=a(this),c=(b.prop("href")||"").split("?")[0],d=c.split(".").pop();0===c.toLowerCase().indexOf("mailto:")&&ga("send","event","Mailto",c.substr(7)),-1!=="xls,xlsx,doc,docx,ppt,pptx,pdf,txt,zip,rar,7z,exe,wma,mov,avi,wmv,mp3,csv,tsv".split(",").indexOf(d)?ga("send","event","Download",d,c):"http:"!==this.protocol&&"https:"!==this.protocol||-1!==this.hostname.indexOf(document.location.hostname)||ga("send","event","Outbound",this.hostname,this.pathname)})},a.universalAnalytics.trackForms=function(){function b(){var b=a(this),c=b.is("form")?b[0]:a(this).closest("form")[0]||{};ga("send","event","Form Tracking","form ("+(c.name||c.id||"none")+")",(this.name||this.id||this.type||this.nodeName)+" ("+this.type+")")}a("input, select, textarea, hidden").one("change",b),a("form").one("submit",b)},a.universalAnalytics.trackFacebook=b,a.universalAnalytics.trackTwitter=c,a.universalAnalytics.trackSocial=function(d){a(window).load(function(){setTimeout(function(){b(),c()},d||5e3)})}}(jQuery);