function get_cookie(cookie_name) {

	var allcookies = document.cookie;
	var pos = allcookies.indexOf(cookie_name + '=');

	if ( pos != -1 ) {
		var start = pos + cookie_name.length + 1;
		var end = allcookies.indexOf(";", start);
		if (end == -1) end = allcookies.length;
		var value = decodeURIComponent(allcookies.substring(start, end));
		return value;
	}

}