var AnalyticsLoader = Class.extend({ interval: 420, init: function(){ var obj = this; var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); var script = $(''); $('head').append(script); setTimeout(function(){ obj.checkLoad(); }, this.interval); }, checkLoad: function(){ var obj = this; setTimeout((window['_gat']) ? function(){ obj.startup(); } : function(){ obj.checkLoad(); }, this.interval); }, startup: function(){ $(this).trigger('load'); } });