var _gaq = _gaq || [];

var pushGoogleAnalytics = function(key, val) {

    if (typeof val != "undefined" && val != null) {
        _gaq.push([key, val]);
    } else {
        _gaq.push([key]);
    }
};

var trackPageview = function(pageview)
{
	pushGoogleAnalytics("_trackPageview", pageview);
};


if (typeof __googleAnalyticsAccount == "undefined" || __googleAnalyticsAccount == "" || __googleAnalyticsAccount == "null") {
    alert("Google analytics: account NOT SET!\nCheck your properties.");
} else {
    pushGoogleAnalytics("_setAccount", __googleAnalyticsAccount);
}

pushGoogleAnalytics("_gat._anonymizeIp");
pushGoogleAnalytics("_trackPageLoadTime");

if (typeof __googleAnalyticsDomain != "undefined" && __googleAnalyticsDomain != "") {
	pushGoogleAnalytics("_setDomainName", __googleAnalyticsDomain);
}

if (typeof __googleAnalyticsPush != "undefined" && __googleAnalyticsPush != "") {
    pushGoogleAnalytics(__googleAnalyticsPush);
}

if (typeof __googleAnalyticsPageview != "undefined" && __googleAnalyticsPageview != "") {
	pushGoogleAnalytics("_trackPageview", __googleAnalyticsPageview);
}

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

	if (__googleAnalyticsDebug === 'true') {
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/u/ga_debug.js';	
    } else {
        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);
})();

