// populate the _gaq w/ account & domain but don't track a pageview
var _gaq;
function initGaq() {
	var ga_account = 'UA-218852-1';
	_gaq = _gaq || [];
	_gaq.push(['_setAccount', ga_account]);
	//_gaq.push(['_setDomainName', '.net-temps.com']);
	_gaq.push(['_setDomainName',document.location.host]);
	//return _gaq;
	window.ga_account = ga_account;
	window._gaq = _gaq;
}

// Get the default url that ga would track, this makes it easy to add on to
function defaultGAUrl() {
	var result ;
	if (document.location.search == "") {
		result = document.location.pathname + "?";
	}
	else {
		result = document.location.pathname + document.location.search;
	}
	return result;
}

// returns an associative array of query parameters & values
// taken from http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
// TODO: put this somewhere more general, it could be useful in other places
function getQueryStringHash(str) {
	var url = "" + str;
	var queryString = {};
		url.replace(
		    new RegExp("([^?=&]+)(=([^&]*))?", "g"),
		    function($0, $1, $2, $3) { queryString[$1] = $3; }
		);
	return queryString;
}


