/* Second section of Google Analytics tracking code. Should be placed right before </body> tag 
 * Added by Josh 2/9/2010
 */
// Check if top snippet has been called/included, do it here if not
/*if (!ga_account) {
	var ga_account = 'UA-218852-1';
	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', ga_account]);
	_gaq.push(['_setDomainName', ".net-temps.com"]);
	_gaq.push(['_trackPageview']);
} else {
	
}
*/

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;
}

function traverseArr(arr) {
	for (var outer in arr) {
		document.writeln("Value of outer is " + outer);
		document.writeln(";<br/> value of arr[outer] is ".concat(arr[outer]));
		document.writeln("type is " + typeof(arr[outer]));
		for (var inner in outer) {
			document.writeln("<br/>;value of inner is: ".concat(inner));
			document.writeln(" type is" + typeof(inner));
			document.writeln("<br/> value of outer[inner] is: ".concat(outer[inner]));
			document.writeln(" type is " + typeof(outer[inner]));
		}
	}
}

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
		init_gaq;
	}
	else { 
		var ga_account = 'UA-218852-1';
		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', ga_account]);
		_gaq.push(['_setDomainName', ".net-temps.com"]);
		_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);
 })();

