function DoAnalytics()
{
    return (document.location.protocol != "file:")
}

function InitAnalytics(accountId)
{
    if (window._gaq === undefined)
    {
        window._gaq = [];
    }

    if (DoAnalytics() == true)
    {
        _gaq.push(['_setAccount', accountId]);
        _gaq.push(['_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);
    })();
}

function ProductClick(link)
{
    if (DoAnalytics() == true)
    {
        _gaq.push(['_trackEvent', link.target, document.title]);
    }
}
