<!--
function setCookie(theName,theValue,theDay)
{
	if ((theName != null) && (theValue != null))
	{
		expDay = "Wed, 01-Jan-2030 18:56:35 GMT";	//　指定されない場合とりあえず2020年
		if (theDay != null)
		{
			theDay = eval(theDay);	//　文字列の場合でも数値にする（念のため）
			setDay = new Date();
			setDay.setTime(setDay.getTime()+(theDay*1000*60*60*24));
			expDay = setDay.toGMTString();
		}
		document.cookie = theName + "="+escape(theValue)+";expires="+expDay;
		return true;
	}
	return false;
}

function deleteCookie(theName)
{
	document.cookie = theName + "=;expires=Thu,01-Jan-70 00:00:01 GMT";
	return true;
}

function getCookie(theName)
{
	theName += "=";	//　=を追加して検索の手抜きをする
	theCookie = document.cookie+";";	//　検索時最終項目で-1になるのを防ぐ
	start = theCookie.indexOf(theName);	//　指定された名前を検索する
	if (start != -1)
	{
		end = theCookie.indexOf(";",start);
		return unescape(theCookie.substring(start+theName.length,end));
	}
	return false;
}
function readcookie() {
	cpass = getCookie("passwd");
	if (cpass) {
	  document.forms.form1.passwd.value = cpass;
	  document.forms.form1.cbox.checked = true;
	} else {
	  document.forms.form1.passwd.value = "";
	  document.forms.form1.cbox.checked = false;
	}

}

function formsubmit() {
	 if (document.forms.form1.cbox.checked) {
	 	cpass =   document.forms.form1.passwd.value;
	 	setCookie("passwd",cpass,"2030");
	 } else {
	 	deleteCookie("passwd");
	 }
}

//-->

