var contSwitch = false;
//set the font size according to the user's preference, called by setFontSize() or user click
function chgFontSz(i) {
	i = parseInt(i);
	var bodyID = document.getElementsByTagName("body")[0];
	
	switch(i) {
		case 1:
			bodyID.style.fontSize="12px";
			document.getElementById('nav-wrapper').style.fontSize="12px";
			break;
		case 2:
			bodyID.style.fontSize="13px";
			document.getElementById('nav-wrapper').style.fontSize="12px";
			break;
		case 3:
			bodyID.style.fontSize="14px";
			document.getElementById('nav-wrapper').style.fontSize="12px";
			break;
	}
	createCookie("richmondfontsize", i, 30);
	return false
}

//saves the font size preference to a cookie, expires in one year

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0)  return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
