The following is the regular method I use to get cookies, including single value and multi-value:
/************************************************
Parameter description:
sMainName Cookie name
sSubName Cookie subkey name, leave blank to indicate single value Cookie
************************ ****************************/
function GetCookie(sMainName, sSubName)
{
var re = new RegExp(sMainName (sSubName ? "=" sSubName : "") "= (.*?);", "i");
return re.test(unescape(document.cookie)) ? RegExp["$1"] : "";
}