function go(){
	
	var this_form = document.forms[0] ;
	
	if(!this_form.user_id.value){
		alert('IDの欄をご入力下さい。');
		this_form.user_id.focus();
		return;
	}
	if(!this_form.user_password.value){
		alert('パスワードの欄をご入力下さい。');
		this_form.user_password.focus();
		return;
	}
	if(!this_form.user_name.value){
		alert('氏名の欄をご入力下さい。');
		this_form.user_name.focus();
		return;
	}
	if(
		(!this_form.tel1.value || !this_form.tel2.value || !this_form.tel3.value) && 
		(!this_form.fax1.value || !this_form.fax2.value || !this_form.fax3.value) && 
		(!this_form.keitai1.value || !this_form.keitai2.value || !this_form.keitai3.value) 
	){
		alert('電話、FAX、携帯番号の欄をご入力ください。');
		this_form.tel1.focus();
		return;
	}
	
	var path = 'user_touroku0to1.php';
	this_form.action = path;
	this_form.submit();

}

function check_userid() {
	window.open("../user_reg/id_check.php","check_userid"
	,"width=370,height=190,location=0,menubar=0,scrollbars=1,resizable=1,toolbar=0,directories=0,status=1");

    ml_add = document.makeml.ml.value;
   wid = window.open ("/ctrl/html/MlAddressCheckForm?ml="+ ml_add,"check_userid","width=373, height=190, toolbar=0,menubar=0, location=1, directories=0, status=1, scrollbars=1, resizable=1");
}

han =  "ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝ";
han += "ｧｨｩｪｫｬｭｮｯ";
han += "､｡｢｣ﾞﾟ";
zen =  "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン";
zen += "ァィゥェォャュョッ";
zen += "、。「」゛゜";
function toZenkaku(motoText){
	str = "";
	for(i=0; i<motoText.length; i++){
		c = motoText.charAt(i);
		n = han.indexOf(c, 0);
		if(n>=0) c = zen.charAt(n);
		str += c;
	}
	return str;
}

han_num = "0123456789.,-+";
zen_num = "０１２３４５６７８９．、−＋";
function toHankakuNum(motoText){
	str = "";
	for(i=0; i<motoText.length; i++){
		c = motoText.charAt(i);
		n = zen_num.indexOf(c, 0);
		if(n>=0) c = han_num.charAt(n);
		str += c;
	}
	return str;
}

function limitChars1(){
	if(document.f1.self_introduction.value.length >= 400){
		alert('400文字以内にして下さい');
	}
}
function limitChars2(){
	if(document.f1.ambition.value.length >= 400){
		alert('400文字以内にして下さい');
	}
}
function limitChars3(){
	if(document.f1.comment.value.length >= 400){
		alert('400文字以内にして下さい');
	}
}

function chk_author_dairi(flag){
	var this_form = document.forms[0] ;
	
	if(flag == '1'){
		this_form.author_user_id.value = "";
	}else if(flag == '2'){
		if(this_form.author_user_id.value == ""){
			alert('候補者ID欄を忘れずにご入力下さい。');
			this_form.author_user_id.focus();
		}
	}else if(flag == '3'){
		if(this_form.elements["author_chk"][0].checked == true && this_form.author_user_id.value != ""){
			alert('候補者の方は、別の候補者の方を登録することはできません。');
			this_form.author_user_id.value = "";
			this_form.elements["author_chk"][0].focus();
		}else if(this_form.elements["author_chk"][1].checked == true && this_form.author_user_id.value == ""){
			alert('候補者を指定しない場合、代理人として登録することはできません。');
			this_form.author_user_id.value = "";
			this_form.elements["author_chk"][0].checked = true;
//			this_form.elements["author_chk"][0].value = true;
			this_form.elements["author_chk"][0].focus();
		}
	}
}


