	function cookie_load(theName) {
		theData   = "";
		theName   = theName + "=";
		theCookie = document.cookie+";";
		start = theCookie.indexOf(theName);
		if (start != -1) {
			end = theCookie.indexOf(";",start);
			theData = unescape(theCookie.substring(start+theName.length,end));
		}
		return theData;
	}

	function cookie_save(theName,theValue) {
		theDay = 1;
		setDay = new Date();
		setDay.setTime(setDay.getTime()+(theDay*1000*60*60*24));
		expDay = setDay.toGMTString();
		document.cookie = theName + "="+escape(theValue)+";expires="+expDay;
	}

	function cookie_delete(theName) {
			document.cookie = theName + "=;expires=Wed,01-Jan-2003 00:00:01 GMT";
	}

	// フォーム全体の 入不可(true): 可(false)
	function set_form(fObj,flg) {
		len = fObj.elements.length;
		for (i=0; i<len; i++) { fObj.elements[i].disabled = flg; }
	}

	function check_form(){
		// ブラウザの検閲
		ver = navigator.userAgent;

		if ( !((ver.match(/MSIE/i)||ver.match(/Firefox/i)||ver.match(/Chrome/i)) && ver.match(/Windows/i)) ) {
			flag = confirm("ご使用のブラウザまたはＯＳに対応していません。簡易版（旧バージョン）の適性検査をおこないますか？");
			if (flag) { location.href='./aptit1.html'; return; } else { return; }
		}

		if (document.apform.name.value == 0) { alert("お名前を記入してください。"); return; }
		if (document.apform.age.value == 0) { alert("年齢を選択してください。"); return; }
		if (document.apform.sex.value == 0) { alert("性別を選択してください。"); return; }
		if (document.apform.add.value == 0) { alert("住所を選択してください。"); return; }
		use = cookie_load("USE");
		if (use >= 2) { alert("利用回数をオーバーしました。後日ご利用ください。"); return; }
		// use++;
		// cookie_save("USE",use);
		cookie_save("NAME",document.apform.name.value);
		cookie_save("AGE",document.apform.age.value);
		cookie_save("SEX",document.apform.sex.value);
		cookie_save("ADD",document.apform.add.value);
		cookie_save("LOGIN",11);

		location.replace ("./test1.html");
	}

	function copyright_write() {
		nowyear = (new Date()).getFullYear();
		document.write("Copyright &copy; 2002-" + nowyear + " Mokada. All rights reserved.");
	}


