﻿/**
 * Google Analytics (Urchin) insertion
 *
 * This script provides a fast method for including the Urchin analytics javascript into a web page.
 * It is executed on post page load using a DOM insertion, and will include the correct Urchin URL 
 * (http|https) depending on the current protocol being used.
 *
 * Programmed by Adam Burmister (adam.burmister@gmail.com)
 * Based on http://www.zachleat.com/web/2007/11/01/speed-up-google-analytics-with-dynamic-includes/
 *
 * This work is licensed under a Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/)
*/
(function() {
    setTimeout(function() {
          var node = document.createElement("script");
          node.type = 'text/javascript';
          if(document.location.protocol == 'https:') {
            node.src = 'https://ssl.google-analytics.com/urchin.js';
          } else {
            node.src = 'http://www.google-analytics.com/urchin.js';
          }
          document.getElementsByTagName("head")[0].appendChild(node);
          var init = setInterval(function()
          {
              if(typeof urchinTracker != 'undefined') {
                  _uacct = "UA-85729-4";
                  _udn="kentdil.com";
                  if(typeof _urchinUrl != 'undefined'){
                    urchinTracker(_urchinUrl); // set the _urchinUrl var to track a custom URL
                  } else {
                    urchinTracker();
                  }
                  clearInterval(init);
              }
          }, 100);
      }, 0); // Execute immediately on load
})();

