function logname(){
	if( document.forms['input_form'].elements['login'].value != "" ){
		xmlhttp = createXMLHttpRequest();
		if( xmlhttp ){
			un = document.forms['input_form'].elements['login'].value;
			xmlhttp.onreadystatechange = chklogn;
			xmlhttp.open("post","loginchk.php?name=" + encodeURI( un ),true);
			xmlhttp.send(null);
		}
	}
}
function chklogn(){
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
		var ret = xmlhttp.responseText;
		if( ret == 0 ){
			document.getElementById("usernerr").innerHTML = "";
		}else{
			document.getElementById("usernerr").innerHTML = "<strong>指定したログイン名はすでに使用されています。</strong>";
			alert("指定したログイン名はすでに使用されています。");
		}
	}
}
function mailchk( obj, flg ){
	var str = obj.value;
	if( flg == undefined ) flg = true;
	if( str != "" ){
		str = z2h_word( str );
		obj.value = str;
		if(str.match(/.+@.+\..+/)){
			 document.getElementById("mailerr").innerHTML = "&nbsp;";
		}else{
			 document.getElementById("mailerr").innerHTML = "<strong>メールアドレスが不正です。</strong>";
			alert("メールアドレスが不正です。");
		}
	}else{
		if( flg == true ){
			 document.getElementById("mailerr").innerHTML = "<p>※確認メールを送信しますので、お間違えないよう入力してください。</p>";
		}else{
			 document.getElementById("mailerr").innerHTML = "&nbsp;";
		}
	}
}
function passchk(){
	var p1 =  document.forms['input_form'].elements['password1'].value;
	var p2 =  document.forms['input_form'].elements['password2'].value;
	if( p2 != "" ){
		if( p1 != p2 ){
			 document.getElementById("passerr").innerHTML = "<strong>パスワードが一致しません。</strong>";
			alert("パスワードが一致しません。");
		}else{
			 document.getElementById("passerr").innerHTML = "";
		document.getElementById("passerr0").innerHTML = "<p class='note'>※セキュリティ保持のため英数字を織り交ぜた6桁以上で、他人に推測されにくいものを登録してください。</p>";
		}
	}else if( p1 != "" ){
		if( p1.match(/[A-Za-z]+/) ){
			if( p1.match(/[0-9]+/) ){
				if( p1.length >= 6 ){
					document.getElementById("passerr0").innerHTML = "<p class='note'>※セキュリティ保持のため英数字を織り交ぜた6桁以上で、他人に推測されにくいものを登録してください。</p>";
				}else{
					document.getElementById("passerr0").innerHTML = "<strong>パスワードには6桁以上を推奨します。</strong>";
				}
			}else{
				document.getElementById("passerr0").innerHTML = "<strong>パスワードには英数字を織り交ぜたものを推奨します。</strong>";
			
			}
		}else{
			document.getElementById("passerr0").innerHTML = "<strong>パスワードには英数字を織り交ぜたものを推奨します。</strong>";
		}
	}else{
		document.getElementById("passerr0").innerHTML = "<p class='note'>※セキュリティ保持のため英数字を織り交ぜた6桁以上で、他人に推測されにくいものを登録してください。</p>";
		document.getElementById("passerr").innerHTML = "<p>※お間違えが無いか、念のためパスワードをもう一度ご入力ください。</p>";
	}
}
function z2h_word(src) {
	return src.replace(/([Ａ-Ｚａ-ｚ０-９＿．－＠])/g,
	function ($0) {
		return String.fromCharCode($0.charCodeAt(0) - 65248);
	});
}
function udoreg(){
//	document.getElementById("doreg").innerHTML = "<button type=\"button\" value=\"wait\" class=\"sys\">処理中です</button>";
	document.forms["input_form"].action = "userregisterdo.php";
}