function checkName(username)
{
	if(username == "Anonymous" ||
	   username == "")
	{
		if(confirm("You haven't entered a name, would you like to do that now?"))
		{
			document.comments.username.focus();
			return false;
		}
	}
	else
	{
		var c_set = true;
		var c_val = readCookie("username");
		if(c_val == "" ||
		   c_val != username)
			c_set = confirm("Would you like to remember this name in a cookie for future visits to the website?");
		if(c_set)
			setCookie("username",username,31);
	}
	return true;
}
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/";
}

function readCookie(c_name) {
	var nameEQ = c_name + "=";
	var c_list = document.cookie.split(';');
	var c;
	for(var vCounter=0;vCounter < c_list.length;vCounter++)
	{
		//get the cookie
		c_info = c_list[vCounter];
		//trim leading spaces
		while (c_info.charAt(0)==' ')
			c_info = c_info.substring(1,c.length);
		//if the cookie is the one we're looking for, return the value
		if (c_info.indexOf(nameEQ) == 0)
			return c_info.substring(nameEQ.length,c_info.length);
	}
	//not found
	return "";
}
