/******************************************
* AWD JS Library
* Set: Google Analytics 2009 version
* Author: Matthew Camp
* Created: 20th April 2009
* Last Updated: 20th March
*
/******************************************
* INITIATE GLOBAL VARIABLES AND ADD EVENT LISTENERS
*******************************************/
var siteCode = "UA-8080098-9";
AddOnloadEvent(startAnalytics);

/******************************************
* GOOGLE FUNCTIONS
*******************************************/
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"));

function startAnalytics() {
	var pageTracker = _gat._getTracker(siteCode);
	pageTracker._initData();
	pageTracker._trackPageview();
}

/******************************************
* REMOVE ALL FUNCTIONS BELOW IF USING GLOBAL FUNCTIONS FILE
*******************************************/
// allows to attach multiple onload event with multiple js scripts
function AddOnloadEvent(fnc){
	if(typeof window.addEventListener != "undefined"){
		window.addEventListener( "load", fnc, false );
	}
	else if(typeof window.attachEvent != "undefined"){
		window.attachEvent("onload", fnc);
	}
	else{
		if(window.onload != null){
			var oldOnload = window.onload;
			window.onload = function(e){
				oldOnload(e);
				window[fnc]();
			}
		}
		else{
			window.onload = fnc;
		}
	}
}
