if(typeof loadScript!='function')
{
	function loadScript(scriptURL,callBack,delay)
	{
		if(typeof delay=='undefined'){var delay=10}
		if(typeof callBack=='undefined'){var callBack=false}
		
		var s=document.createElement('script');
		s.setAttribute('type','text/javascript');
		s.setAttribute('src',scriptURL);
	 
		if(callBack)
		{
			
			//test for onreadystatechange to trigger callback (IE)
			s.onreadystatechange = function ()
			{
				if (s.readyState == 'loaded' || s.readyState == 'complete')
				{
					window.setTimeout(callBack,delay);
				}
			}                            

			// test for onload to trigger callback
			s.onload=function()
			{
				window.setTimeout(callBack,delay)
			}
		}
		
		document.body.appendChild(s);
		delete s
	}
}
/* Google analytics */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

function getUA()
{
	var UA='nun';
	if(document.URL.match('its.uq.edu.au/servicestatus')){UA='UA-716947-4'};
	if(document.URL.match('its.uq.edu.au/helpdesk')){UA='UA-716947-3'};
	if(document.URL.match('uqconnect.net/helpdesk')){UA='UA-716947-2'};
	if(document.URL.match('uqconnect.net/webmail')){UA='UA-716947-5'};
	return UA
}

if(document.URL.match('uqconnect.net/webmail')||document.URL.match('uqconnect.net/helpdesk')||document.URL.match('its.uq.edu.au/helpdesk')||document.URL.match('its.uq.edu.au/servicestatus'))
{
	
	loadScript(gaJsHost+ "google-analytics.com/ga.js",
		function()
		{
			loadScript('/helpdesk/urchin.helper.js',
				function()
				{
					try {
						var pageTracker = _gat._getTracker(getUA());
						pageTracker._initData();
						pageTracker._trackPageview();
		
						GAHelper = new GADownload(pageTracker);
						GAHelper.trackDownload = "zip|rar|dmg|msi|pdf|exe|gz|file|mobileconfig";
						GAHelper.trackLinks();
					} catch (e) { var gaerror = e ; console.log(e) }
				}, 10 );
		}, 100 );
}