function checkvalue(Item, Name){
        if (Item.value == '') {
                alert(Name + "の入力をお願いします。");
                return false;
        } else {
                        return true;
                }
}
function GLength(Item){
	var i,cnt=0;
	for(i=0;i<Item.length;i++){
		if(escape(Item.charAt(i)).length >=4){
			cnt+=2;
		} else {
			cnt++;
		}
  	}
return cnt;
}

function check_email () {
	if ( GLength(document.member.mail_pc.value) > document.member.mail_pc.length) {
		alert("メールアドレスは半角英数字で入力してください。");
	return false;
	}
	if (document.member.mail_pc.length <5) {
		error(document.member.mail_pc, "メールアドレスが正しく入力されていません");
		return false;
	}
	if (document.member.mail_pc.value.indexOf("@", 0) == -1) {
		alert("メールアドレスが正しく入力されていません");
		return false;
	}
	return true;
}

function checkform () {
        if (checkvalue(document.member.name_f,'ふりがな')
        && checkvalue(document.member.name_k,'お名前')
        && checkvalue(document.member.address,'ご住所')
        && tel_check()
        && check_email()
        )	{
                return true;
        } else {
                return false;
        }
}
function tel_check() {
    str = document.member.tel.value;
    var tmp = str.match(/[0-9＼- ]+/g);
    if (tmp != str) {
      alert('電話番号を正しく入力して下さい');
    	return false;
	}
    else {return true};
}

