//Set the number of days before your cookie should expire 
 
var ExpireDays = 90; 
 
//Do not change anything below this line q
 
    str = document.location.search; 
    qstr = qstr.substring(1,qstr.length) 
 
    function SetCookie(cookieName,cookieValue,nDays) 
    { 
        var today = new Date(); 
        var expire = new Date(); 
        if (nDays==null || nDays==0) nDays=1; 
        expire.setTime(today.getTime() + 3600000*24*nDays); 
        document.cookie = cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString()+";domain=.sanrio.com;path=/"; 
    } 
 
thevars = qstr.split("&"); 

    for(i=0;i<thevars.length;i++) 
    { 
        cookiecase = the vars[i].split("=");
        switch(cookiecase[0]) 
        { 
            case "e": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("EmailAddr",e,ExpireDays); 
                break; 
            case "j": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("JobID",j,ExpireDays); 
                break; 
            case "l": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("ListID",l,ExpireDays); 
                break
            case "jb": 
                thevars[i] = thevars[i].replace("=","='")+"'";
                eval(thevars[i]); 
                SetCookie("BatchID",jb,ExpireDays); 
                break; 
            case "u": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("UrlID",u,ExpireDays); 
                break; 
            case "mid": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("MemberID",mid,ExpireDays); 
                break; 
            default:
                break; 
        } 
    }
