function setExpire (months) {
	expireDate = new Date;
	expireDate.setMonth(expireDate.getMonth() + months);
	return expireDate.toGMTString();
}

function bakeCookie (name, value, months) {
	/* first put all the ingredients in the dough: */
	var dough = name + "=" + escape(value) ;
	dough += ";expires=" + setExpire(months);
	/* then put the dough in the oven to make coookies */
	document.cookie = dough;
}

function getCookie (name) {
	var crumb = "";
	/*initializes string as empty, and it will stay empty unless the value is found in the cookie */
	if (document.cookie != "") {
		/*if the cookie is not empty, then parse the cookie*/
		/*split the cookie string into an array*/
		cookieCrumbs = new Array();
		cookieCrumbs = document.cookie.split("; ");
		/*loop through the separated cookies, look for the name and return its value*/
		for (i=0; i<cookieCrumbs.length; i++) {
/*split cookieCrumbs on the equal sign, and check the zero element against the name*/
			if (name == cookieCrumbs[i].split("=")[0]) {
				crumb = unescape(cookieCrumbs[i].split("=")[1]);
				break;
			} //endif
		} //endfor 
	} //endif
/*don't need an else, because crumb will only change from the empty string if the cookie is found*/
	return crumb;
} //endfunction
