function getCookie(name) {
	var results = document.cookie.match(name + '=(.*?)(;|$)');
	if (results) {
		return unescape(results[1]);
	}
	return null;
}
Gets the value of the specified cookie.

name	Name of the desired cookie.

Returns a string containing value of specified cookie,
	 or null if cookie does not exist.