// Loading Google Analytics into the Urchin file.  Google Analytics hits the Urchin software, so this should cover both.

/*Original way
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cscript type='text/javascript'%3E"));
document.write('try { var pageTracker = _gat._getTracker("UA-16235961-1");pageTracker._setDomainName("none");pageTracker._setAllowLinker(true);pageTracker._setLocalRemoteServerMode();pageTracker._trackPageview();}catch (err) { }');
document.write(unescape("%3C/script%3E"));
*/

/*jQuery way, smooth and easy

(function() {
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    gaJsHost = gaJsHost + "google-analytics.com/ga.js";

    $.getScript(gaJsHost, function(){
      
        try {
            var pageTracker = _gat._getTracker('UA-16235961-1');
                //pageTracker._setDomainName('stage'+'.dot.state.nc.us');
                pageTracker._setDomainName('none');
                pageTracker._setAllowLinker(true);
                //pageTracker._setAllowHash(false);
                //pageTracker._setLocalGifPath('__utm.gif');
                pageTracker._setLocalRemoteServerMode();
                pageTracker._trackPageview();
        }catch (err){}
      
    });
})();
*/

/*
    Google way --
    looks like they're inserting before the 1st script tag, 
    luckily we have one of those, "default.js"
*/
var _gaq = _gaq || [];
    _gaq.push(
        ['_setAccount', 'UA-16235961-1'],
        ['_setDomainName', 'none'],
        ['_setAllowLinker', true],
        ['_setLocalRemoteServerMode'],
        ['_trackPageview']
    );
  
(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


