function setCookie(sName,sValue,sDays){
	var today = new Date();
	var expire = new Date();
	if (sDays == null || sDays == 0)
		sDays = 365;
	expire.setTime(today.getTime() + 3600000*24*sDays);
	document.cookie = sName + "=" + escape(sValue) + ";path=/;domain=.lcrx.cn;expires=" + expire.toGMTString();
}

function getCookieOld(sName){
	var aCookie = document.cookie.split(";");
	for (var i = 0; i < aCookie.length; i++){
		var cCrumb = aCookie[i].split("=");
		if (sName == cCrumb[0]){
			return unescape(cCrumb[1]);
		}
	}
	return null;
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
  	endstr = document.cookie.length;
  	return unescape(document.cookie.substring(offset, endstr));
}

function getCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
    		i = document.cookie.indexOf(" ", i) + 1;
    		if (i == 0)
       			break;
  	}
	return "";
}