function setCookie( c_name, value, exdays ) {
	var exdate = new Date();
	exdate.setDate( exdate.getDate() + exdays );
	var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie = c_name + "=" + c_value;

	var date_value = escape( exdate.toDateString() ) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie = "aldTracking-expire=" + date_value;
}

function getCookie( c_name ) {
	var i, x, y, ARRcookies=document.cookie.split(";");
	for ( i = 0; i < ARRcookies.length; i++ ) {
		x = ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y = ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x = x.replace(/^\s+|\s+$/g,"");
		if ( x == c_name ) {
			return unescape(y);
		}
	}
	return null;
}

function blockAnalytics( turnOn ) {
	var days = turnOn ? 365 : -1;
	_gaq.push(['_setCustomVar', 1, 'no-analytics', 'aldevron', 1]);
	_gaq.push(['_trackPageview']);
	setCookie( 'no-analytics', 'aldevron', days);
	location.reload(true);
}
