function hasTrackedPageview(_gaq) {
	for (var elem in _gaq) {
		//document.writeln(String(_gaq[elem]).indexOf("track"));
		var curr = String(_gaq[elem]);
		if (curr.indexOf("_trackPageview") != -1) {
			//document.writeln("this document has tracked a pageview: " + String(_gaq[elem]));
			return true;
		} 	
	}  
	return false;
}

if (!window._gaq) { // if the gaq doesn't exist, initialize it and track the default pageview
     var ga_account = 'UA-218852-1';
     var _gaq = _gaq || [];
    _gaq.push(['_setAccount', ga_account]);
    //_gaq.push(['_setDomainName', ".net-temps.com"]);
    _gaq.push(['_setDomainName', window.location.host]);
    _gaq.push(['_trackPageview']);
     window._gaq = _gaq;
} else if (!hasTrackedPageview(window._gaq)) { // Only track a view if we haven't already
    window. _gaq.push(['_trackPageview']);
}
/*
if (window._gaq) {
	if (!hasTrackedPageview(window._gaq)) {
		_gaq.push(['_trackPageview']);
	}
	//traverseArr(window._gaq);
} else {
	//document.writeln("no gaq found");
	if(window.initGaq) { // check if the init_gaq method is defined, run it if so
		initGaq();
	}
	else { 
		var ga_account = 'UA-218852-1';
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', ga_account]);
		_gaq.push(['_setDomainName', ".net-temps.com"]);
		_gaq.push(['_trackPageview']);
		window._gaq = _gaq;
	}
	_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';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
 })();


