﻿// this variable is used to disable behaviour that won't work in a development / test environment
var isDebugging = false;

// this code is required by google to keep the analytics tracking enabled.  Google interrogates the page for this 
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10585663-2']);
_gaq.push(['_setVar', getSilverlightVersion()]);
//_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);
})();

// This is the core code that tracks events from Silverlight.  Tracking pageviews only is not very meaningful as there is only one page.  
// Using events allows granular tracking of user actions
function trackPageEvent(category, action, label, value) {
    try {
        _gaq.push(['_trackEvent', category, action, label, value]);
    }
    catch (err) { }
}

//this function is called when a new silverlight "page" is opened. 
function trackPageView() {
    try {
        _gaq.push(['_trackPageview']);
    }
    catch (err) { }
}

var userLocation = "AU";
// The silverlight application relies on this method being available and calls it on startup
function getUserLocation() {
    try {
        return userLocation;
    }
    catch (err) { return ""; }
}

