function saveCookie(dArea, dCountry, dCode) {
	clearCookie();
	setPre = new Date();
	setPre.setTime(setPre.getTime() + (365*1000*24*3600));
	tail = ";path=/;domain=" + location.hostname + ";expires="+ setPre.toGMTString();
	document.cookie = "area=" + dArea + tail;
	document.cookie = "country=" + dCountry + tail;
	document.cookie = "code=" + dCode + tail;
	return;
}

function loadCookie() {
	cData = "";
	cArea = "area=";
	cCountry = "country=";
	cCode = "code=";
	cCookie = document.cookie + ";";
	var arrData = {
		"area" : getCookie(cCookie, cArea),
		"country" : getCookie(cCookie, cCountry),
		"code" : getCookie(cCookie, cCode)
	}
	return arrData;
}

function getCookie(cCookie, dName) {
	str = cCookie.indexOf(dName);
	if(str != -1) {
		end = cCookie.indexOf(";",str);
		cData = unescape(cCookie.substring(str + dName.length, end));
	}
	return cData;
}

function clearCookie() {
	dTime = new Date();
	dTime.setYear(dTime.getYear() - 1);
	tail = ";path=/;domain=" + location.hostname + ";expires=" + dTime.toGMTString();
	document.cookie = "area=" + tail;
	document.cookie = "country=" + tail;
	document.cookie = "code=" + tail;
	return;
}

