////////////////////////////////////////////////////
//
// ANALYTICS_FOOTER.JS
//
// This page defines javascript for the google
// analytics call. 
// 
//
// Created 12/05/2009 by Chris Jones
//
////////////////////////////////////////////////////

function callAnalytics(){
	
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	gaJsHost = gaJsHost + "google-analytics.com/ga.js";
	
	var script = document.createElement("script"); 
	script.setAttribute('src', gaJsHost); 
	script.setAttribute("type", "text/javascript"); 
	document.documentElement.firstChild.appendChild(script); 
	
	callAnalyticsLoop();

}

function callAnalyticsLoop(){
	if (typeof(_gat) == 'object'){
		if (hndl != undefined){
			window.clearTimeout(hndl);
		}
		try {
			var pageTracker = _gat._getTracker("UA-12529759-1");
			pageTracker._trackPageview();
		} catch(err) {
		}
	} else {
		var hndl = window.setTimeout("callAnalyticsLoop()", 100);
	}
}