// Cookieセット
// strName		: キー
// strValue		: 値
// iExp			: 有効期限
// strPath		: 保存ＵＲＬ
function SetCookieData(strName, strValue, iExp, strPath) {
	var strtmp = strName + "=" + strValue;
	if ( 0 < iExp ) {
		var expdate = new Date();
		expdate.setTime(expdate.getTime() + (365 * 24 * 60 * 60 * 1000 * iExp));
		strtmp = strtmp + ";expires=" + expdate.toGMTString();
	}
	(strPath != null ? (strtmp = strtmp + ";path=" + strPath) : (0));
	document.cookie = strtmp;
	return 0;
}

// Cookieゲット
// strName		: キー
function GetCookieValue(strName) {
	var	iIndexOf;
	if ( !document.cookie ) {
		return null;
	}
	iIndexOf = document.cookie.indexOf(strName, 0);
	if ( iIndexOf < 0 ) {
		return null;
	}
	var iValueLen;
	var strValue;
	strValue = document.cookie.substring(iIndexOf + strName.length + 1);
	iValueLen = strValue.indexOf(";", 0);
	(iValueLen < 0 ? (iValueLen = strValue.length) : (0));
	return unescape(strValue.substring(0, iValueLen));
}
