<!--

//エラー判断
function fncSubmit(tmp){
	if(tmp == ""){
		document.myForm.submit();
	}else{
		alert(tmp);
		//document.myForm.submit();
	}
}

//メール配信種チェック
function fncCheckMailSendType(){
	//メール配信種判断
	if(document.myForm.mail_send_type.selectedIndex != 0){
		//メール配信種を選択している場合、メール配信を有効にする
		document.myForm.mail[0].checked = true;
		document.myForm.mail[1].checked = false;
	}else if(document.myForm.mail_send_type.selectedIndex == 0){
		//メール配信種を選択していない場合、メール配信を無効にする
		document.myForm.mail[0].checked = false;
		document.myForm.mail[1].checked = true;
	}
}

//メール配信チェック
function fncCheckMailSend(){
	//2008-01-29 Shinnosuke Tsunogae
	//メール配信種選択対応(リニューアル開始時は配信種指定なし)
	if(document.myForm.mail[1].checked == true){
		document.myForm.mail_send_type.value = 1;
	}
	/*
	//メール配信種判断
	if(document.myForm.mail[1].checked == true){
		document.myForm.mail_send_type.selectedIndex = 0;
		document.myForm.mail_send_type.disabled = true;
	}else{
		document.myForm.mail_send_type.disabled = false;
	}
	*/
}

//ID,パスワードチェック
function fncCheckParametorIDandPass(){
	//IDチェック
	if(document.myForm.id.value == ""){
		tmp += "ネットIDが入力されていません。\n";
	}else{
		//半角チェック
		//６～１２文字以内チェック
		if(fncCheckIDandPass(document.myForm.id.value) == false){
			tmp += "ネットIDは、半角英数字6～12文字で入力してください。\n";
		}else if(fncCheckLastSpace(document.myForm.id.value) == false){
			tmp += "ネットIDに、半角スペースが入力されています。\n";
		}else if(fncCheckCheat(document.myForm.id.value) == false){
			tmp += "ネットIDでは「;>\",<&*'\|」が利用できません。\n";
		}
	}

	//パスワードチェック
	if(document.myForm.pass.value == ""){
		tmp += "パスワードが入力されていません。\n";
	}else{
		//半角チェック
		//６～１２文字以内チェック
		if(fncCheckIDandPass(document.myForm.pass.value) == false){
			tmp += "パスワードは、半角英数字6～12文字で入力してください。\n";
		}else if(fncCheckSpace(document.myForm.pass.value) == false){
			tmp += "パスワード再入力に、半角スペースが入力されています。\n";
		}else if(fncCheckCheat(document.myForm.pass.value) == false){
			tmp += "パスワードでは「;>\",<&*'\| 半角スペース」が利用できません。\n";
		}
	}
}

//半角/全角スペースチェック
function fncCheckHankakuAndZenkakuSpace(str){
	if(str.match(/[　| ]/g)){
		return false;
	}else{
		return true;
	}
}

//半角/全角スペースチェック
function fncCheckZenkakuSpace(str){
	if(str.match(/[　]/g)){
		return false;
	}else{
		return true;
	}
}

//電話番号桁チェック
function fncCheckTel(tel1,tel2,tel3,name){
	tel_error_flag = false;
	
	if(tel1.length > 5){
		tmp += name+"（１コマ目）を５桁以内で入力してください。\n";
		tel_error_flag = true;
	}
	if(tel2.length > 4){
		tmp += name+"（２コマ目）を４桁以内で入力してください。\n";
		tel_error_flag = true;
	}
	if(tel3.length > 4){
		tmp += name+"（３コマ目）を４桁以内で入力してください。\n";
		tel_error_flag = true;
	}

	if(fncCheckSpace(tel1) == false){
		tmp += name+"（１コマ目）に、半角スペースが入力されています。\n";
		tel_error_flag = true;
	}
	if(fncCheckSpace(tel2) == false){
		tmp += name+"（２コマ目）に、半角スペースが入力されています。\n";
		tel_error_flag = true;
	}
	if(fncCheckSpace(tel3) == false){
		tmp += name+"（３コマ目）に、半角スペースが入力されています。\n";
		tel_error_flag = true;
	}

	if(tel_error_flag == false){
		tel = tel1+"-"+tel2+"-"+tel3;
		if (__fncCheckTelCore(tel) == false) {
			tmp += name+"は半角数字で入力してください。\n";
		} 
	}
}

//電話番号チェックコア処理
function __fncCheckTelCore(tel){
	if (tel.match(/[^-\d]/g)) {
		return false;
	}else{
		return true;
	}
}

//住所１チェック
function fncCheckAddressFirst(address,address_name,kaigai_flag){
	if(kaigai_flag == false){
		if(fncGetCountByte(address) > 32){
			tmp += address_name+"の項目は全角16桁(半角32桁)以内に区切ってください。\n";
		}

		if (fncCheckSpace(address) == false) {
			tmp += address_name+"の項目に、半角スペースが入力されています。\n";
		}else if (fncCheckZenkaku(address) == false) {
			tmp += address_name+"の項目は全角文字で入力してください。\n";
		}
	}else{
		if(fncGetCountByte(address) > 32){
			tmp += address_name+"の項目は全角16桁(半角32桁)以内に区切ってください。\n";
		}

		if (address.match(/[&#\"\\$%\'()=~|\[\]{}_\/?<>\t]/g)) {
			tmp += address_name+"で特殊な記号[&\"#$%'()=~|[]{}_?<>]が含まれています。\n";
		}
	}
}

//住所チェック
function fncCheckAddress(address,address_name,kaigai_flag){
	if(kaigai_flag == false){
		if(fncGetCountByte(address) > 40){
			tmp += address_name+"の項目は全角20桁(半角40桁)以内に区切ってください。\n";
		}

		if (fncCheckSpace(address) == false) {
			tmp += address_name+"の項目に、半角スペースが入力されています。\n";
		}else if (fncCheckZenkaku(address) == false) {
			tmp += address_name+"の項目は全角文字で入力してください。\n";
		}
	}else{
		if(fncGetCountByte(address) > 40){
			tmp += address_name+"の項目は全角20桁(半角40桁)以内に区切ってください。\n";
		}

		if (address.match(/[&#\"\\$%\'()=~|\[\]{}_\/?<>\t]/g)) {
			tmp += address_name+"で特殊な記号[&\"#$%'()=~|[]{}_?<>]が含まれています。\n";
		}
	}
}

//海外チェックボックス対応
function fncCheckKaigai(){
	__fncCheckKaigaiCore("kaigai_hope","zip1","zip2","pref","pref2","zip_search_button","address_search_link","suggest");
	if(document.getElementById("kaigai_hope").checked == true){
		//海外がチェックされている場合
		if(document.getElementById("mobile_mail")){
			document.getElementById("mobile_mail").value = "";
			document.getElementById("mobile_mail").style.backgroundColor = "InactiveBorder";
			document.getElementById("mobile_mail").disabled = true;
		}
		if(document.getElementById("mobile_send_mail1")){
			document.getElementById("mobile_send_mail1").disabled = true;
			document.getElementById("mobile_send_mail1").checked = false;
		}
		if(document.getElementById("mobile_send_mail2")){
			document.getElementById("mobile_send_mail2").disabled = true;
			document.getElementById("mobile_send_mail2").checked = false;
		}

		if(document.getElementById("mobile_1")){
			document.getElementById("mobile_1").value = "";
			document.getElementById("mobile_1").disabled = true;
			document.getElementById("mobile_1").style.backgroundColor = "InactiveBorder";
		}

		if(document.getElementById("mobile_2")){
			document.getElementById("mobile_2").value = "";
			document.getElementById("mobile_2").disabled = true;
			document.getElementById("mobile_2").style.backgroundColor = "InactiveBorder";
		}

		if(document.getElementById("mobile_3")){
			document.getElementById("mobile_3").value = "";
			document.getElementById("mobile_3").disabled = true;
			document.getElementById("mobile_3").style.backgroundColor = "InactiveBorder";
		}
	}else{
		//海外がチェックされていない場合
		if(document.getElementById("mobile_mail")){
			document.getElementById("mobile_mail").style.backgroundColor = "Window";
			document.getElementById("mobile_mail").disabled = false;
		}
		if(document.getElementById("mobile_send_mail1")){
			document.getElementById("mobile_send_mail1").disabled = false;
		}
		if(document.getElementById("mobile_send_mail2")){
			document.getElementById("mobile_send_mail2").disabled = false;
		}

		if(document.getElementById("mobile_1")){
			document.getElementById("mobile_1").disabled = false;
			document.getElementById("mobile_1").style.backgroundColor = "Window";
		}
		if(document.getElementById("mobile_2")){
			document.getElementById("mobile_2").disabled = false;
			document.getElementById("mobile_2").style.backgroundColor = "Window";
		}
		if(document.getElementById("mobile_3")){
			document.getElementById("mobile_3").disabled = false;
			document.getElementById("mobile_3").style.backgroundColor = "Window";
		}
	}
}

//届け先海外チェックボックス対応
function fncCheckDeliveryKaigai(){
	__fncCheckKaigaiCore("delivery_kaigai_hope","delivery_zip1","delivery_zip2","delivery_pref","delivery_pref2","delivery_zip_search_button","delivery_address_search_link");
}

//ID登録なし　ユーザー情報（旧）用　海外チェックボックス対応
function fncCheckNonIdOldKaigai(){
	__fncCheckKaigaiCore("old_kaigai_hope","old_zip1","old_zip2","old_pref","old_pref2","old_zip_search_button","old_address_search_link");
}

//ID登録なし　ユーザー情報（新）用　海外チェックボックス対応
function fncCheckNonIdNewKaigai(){
	__fncCheckKaigaiCore("new_kaigai_hope","new_zip1","new_zip2","new_pref","new_pref2","new_zip_search_button","new_address_search_link");
	if(document.getElementById("new_kaigai_hope").checked == true){
		if(document.getElementById("change_mobile_mail")){
			document.getElementById("change_mobile_mail").disabled = true;
			document.getElementById("change_mobile_mail").checked = false;
		}
		if(document.getElementById("change_mobile_send_mail")){
			document.getElementById("change_mobile_send_mail").disabled = true;
			document.getElementById("change_mobile_send_mail").checked = false;
		}

		if(document.getElementById("old_mobile_mail")){
			document.getElementById("old_mobile_mail").value = "";
			document.getElementById("old_mobile_mail").style.backgroundColor = "InactiveBorder";
			document.getElementById("old_mobile_mail").disabled = true;
		}
		if(document.getElementById("new_mobile_mail")){
			document.getElementById("new_mobile_mail").value = "";
			document.getElementById("new_mobile_mail").style.backgroundColor = "InactiveBorder";
			document.getElementById("new_mobile_mail").disabled = true;
		}

		if(document.getElementById("old_mobile_send_mail_text")){
			document.getElementById("old_mobile_send_mail_text").checked = false;
			document.getElementById("old_mobile_send_mail_text").disabled = true;
		}
		if(document.getElementById("old_mobile_send_mail_no")){
			document.getElementById("old_mobile_send_mail_no").checked = false;
			document.getElementById("old_mobile_send_mail_no").disabled = true;
		}
		if(document.getElementById("new_mobile_send_mail_text")){
			document.getElementById("new_mobile_send_mail_text").checked = false;
			document.getElementById("new_mobile_send_mail_text").disabled = true;
		}
		if(document.getElementById("new_mobile_send_mail_no")){
			document.getElementById("new_mobile_send_mail_no").checked = false;
			document.getElementById("new_mobile_send_mail_no").disabled = true;
		}
	}else{
		if(document.getElementById("change_mobile_mail")){
			document.getElementById("change_mobile_mail").disabled = false;
		}
		if(document.getElementById("change_mobile_send_mail")){
			document.getElementById("change_mobile_send_mail").disabled = false;
		}

		if(document.getElementById("old_mobile_mail")){
			document.getElementById("old_mobile_mail").style.backgroundColor = "Window";
		}
		if(document.getElementById("new_mobile_mail")){
			document.getElementById("new_mobile_mail").style.backgroundColor = "Window";
		}

		if(document.getElementById("old_mobile_send_mail_text")){
			document.getElementById("old_mobile_send_mail_text").disabled = false;
		}
		if(document.getElementById("old_mobile_send_mail_no")){
			document.getElementById("old_mobile_send_mail_no").disabled = false;
		}
		if(document.getElementById("new_mobile_send_mail_text")){
			document.getElementById("new_mobile_send_mail_text").disabled = false;
		}
		if(document.getElementById("new_mobile_send_mail_no")){
			document.getElementById("new_mobile_send_mail_no").disabled = false;
		}
	}
}

function __fncCheckKaigaiCore(kaigai_hope,zip1,zip2,pref,pref2,zip_search_button,address_search_link,suggest){
	if(document.getElementById(kaigai_hope).checked == true){
		document.getElementById(zip1).value = "000";
		document.getElementById(zip2).value = "0000";
		if(document.getElementById(pref)){
			document.getElementById(pref).selectedIndex = 0;
			document.getElementById(pref).disabled = true;
		}
		if(document.getElementById(pref2)){
			document.getElementById(pref2).disabled = false;
		}
		document.getElementById(zip_search_button).disabled = true;
		document.getElementById(address_search_link).style.visibility = "hidden";
		if(document.getElementById(suggest)){
			document.getElementById(suggest).style.display = "none";
		}
	}else{
		document.getElementById(zip1).value = "";
		document.getElementById(zip2).value = "";
		if(document.getElementById(pref)){
			document.getElementById(pref).disabled = false;
		}
		if(document.getElementById(pref2)){
			document.getElementById(pref2).disabled = true;
			document.getElementById(pref2).selectedIndex = 0;
		}
		document.getElementById(zip_search_button).disabled = false;
		document.getElementById(address_search_link).style.visibility = "visible";
		if(document.getElementById(suggest)){
			document.getElementById(suggest).style.display = "none";
		}
	}
}


//名前チェック
function fncCheckName(name,name_name){
	if(fncCheckSpace(name) == false){
		tmp += name_name+"に、半角スペースが入力されています。\n";
	}else if(name.length > 10){
		tmp += name_name+"は全角10桁以内で入力してください。\n";
	}else if(fncCheckZenkaku(name) == false){
		tmp += name_name+"は全角文字で入力してください。\n";
	}
}

//関数系
//radio長さ取得
function fncGetLength(obj){
	if(!obj.length){
		return 1;
	}else{
		return obj.length;
	}
}

//select系チェック
function fncCheckSelect(index){
	if(index == ""){
		return false;
	}else{
		return true;
	}
}

// 数値のチェック
function fncCheckNumeric(num){
	if (num.match(/[^\d]/g)) {
			return false;
	}
	return true;
}

// 半角英数のチェック
function fncCheckEng(str){
	if (str.match(/^[a-zA-Z ]+$/)) {
			return true;
	}
	return false;
}

// 半角全角英数のチェック
function fncCheckEngHanZen(str){
	if (str.match(/^[a-zA-ZＡ-ｚ ]+$/)) {
			return true;
	}
	return false;
}



// 半角英数のチェック
function fncCheckHankaku(str){
	if (str.match(/[^ \d\w-]/g)) {
			return false;
	}
	return true;
}

// 郵便番号のチェック
function fncCheckZip(str){
	if (str.match(/[^-\d]/g)) {
			return false;
	}
	return true;
}

//カード番号のチェック
function fncCheckCardNo(str){
	if (str.match(/[^-\d]/g)) {
			return false;
	}
	return true;
}

// メールアドレスのチェック
function fncCheckMail(str){
	if(!str.match(/^([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i)){
			return false;
	}
	return true;
}

// メールアドレスのチェック
function fncCheckMobileMail(str){
	//docomo
	if(str.match("docomo.ne.jp|docomo-camera.ne.jp|mopera.net|ebilling.ne.jp|docomo-bill.ne.jp|mobachemail.ne.jp|mail.visualnet.mopera.ne.jp")){
		//alert("docomo");
		return true;
	}

	//softbank
	if(str.match("softbank.ne.jp|vodafone.ne.jp")){
		//alert("softbank");
		return true;
	}

	//au
	if(str.match("ezweb.ne.jp|ido.ne.jp")){
		//alert("au");
		return true;
	}

	//tu-ka
	if(str.match("sky.tkk.ne.jp|sky.tkc.ne.jp|sky.tu-ka.ne.jp")){
		//alert("tu-ka");
		return true;
	}

	//ウィルコム
	if(str.match("pdx.ne.jp")){
		//alert("ウィルコム");
		return true;
	}

	return false;
}

//携帯電話のチェック
function fncCheckMobilePhone(str){
	//携帯電話
	if(str.match("^(090|080|070)+$")){
		return true;
	}else{
		return false;
	}

	return false;
}

// 半角カナチェック
function fncCheckHankakuKana(str)
{
	txt = "ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮｯｰ､｡｢｣ﾞﾟ";

	for (i=0; i<str.length; i++){
		if (txt.indexOf(str.charAt(i),0) >= 0) {
			return true;
		}
	}

	return false;
}

//全角チェック
function fncCheckZenkaku(str){
	if (
		str.match(/[\d\w&\-\"\\#$%\'()=~|\[\]{}_\/?<> \t]/g) ||
		fncCheckHankakuKana(str)
	) {
		return false;
	}else{
		return true;
	}
}

//全角ひらがな・かたかなチェック
function fncCheckZenkakuKana(str){
	if(str.match("^[ぁ-ヶー－]+$")){
		return true;
	}else{
		return false;
	}
}

//スペースチェック
function fncCheckSpace(str){
	if(str.match(" ")){
		return false;
	}else{
		return true;
	}
}

//最後のスペースチェック
function fncCheckLastSpace(str){
	if(str.match("[ ]+$")){
		return false;
	}else{
		return true;
	}
}

//ID,パスワードチェック
function fncCheckIDandPass(str){
	if(
		fncCheckHankaku(str) == false ||
		(
			str.length < 6 || 
			str.length > 12
		)
	){
		return false;
	}else{
		return true;
	}
}

//不正文字チェック
function fncCheckCheat(str){
	if(str.match(/[\/;>\",<&*\'\|]/)){
		return false;
	}else{
		return true;
	}
}

//不正文字チェック(半角スペース付き)
function fncCheckCheatSpace(str){
	if(str.match(/[\/;>\",<&*\'\| ]/)){
		return false;
	}else{
		return true;
	}
}


//生年月日から年齢取得
function fncGetAge(birthyear,birthmonth,birthday){
	now = new Date();
	y=now.getYear();
	m=now.getMonth()+1;
	d=now.getDate();
	if(y<1900) {y=y+1900;}
	if(m < birthmonth){age=y-birthyear-1}
	if(m > birthmonth){age=y-birthyear}
	if(m == birthmonth){
	if(d < birthday){age=y-birthyear-1}
	else{age=y-birthyear}
	}

	return age;
}

//都道府県配列
function fncSetPrefArray(){
	return array = {
		"1":"北海道",
		"2":"青森県",
		"3":"岩手県",
		"4":"秋田県",
		"5":"宮城県",
		"6":"山形県",
		"7":"福島県",
		"8":"栃木県",
		"9":"茨城県",
		"10":"千葉県",
		"11":"群馬県",
		"12":"埼玉県",
		"13":"山梨県",
		"14":"神奈川県",
		"15":"東京都",
		"16":"新潟県",
		"17":"長野県",
		"18":"富山県",
		"19":"石川県",
		"20":"福井県",
		"21":"静岡県",
		"22":"愛知県",
		"23":"岐阜県",
		"24":"三重県",
		"25":"滋賀県",
		"26":"奈良県",
		"27":"京都府",
		"28":"大阪府",
		"29":"和歌山県",
		"30":"兵庫県",
		"31":"岡山県",
		"32":"広島県",
		"33":"鳥取県",
		"34":"島根県",
		"35":"山口県",
		"36":"香川県",
		"37":"愛媛県",
		"38":"徳島県",
		"39":"高知県",
		"40":"福岡県",
		"41":"佐賀県",
		"42":"長崎県",
		"43":"熊本県",
		"44":"大分県",
		"45":"宮崎県",
		"46":"鹿児島県",
		"47":"沖縄県",
		"48":"海外",
		"49":"アジア",
		"50":"北米・中米・オセアニア・中近東",
		"51":"ヨーロッパ",
		"52":"南米・アフリカ",
		length:52
	}
	array.__proto__ = Array.prototype;

}

//年月日チェック
function fncCheckDate(year,month,day){
	//年チェック
	if(year == ""){
		return false;
	}

	//月チェック
	if(month == "" || month < 1 || month > 12){
		return false;
	}

	//日チェック
	if(day == "" || day < 1 || day > 31){
		return false;
	}

	//月による最終日判断
	switch(month){
		//31日がない日判断
		case "4":
		case "6":
		case "9":
		case "11":
			if(day > 30){
				return false;
			}
			break;
		//うるう年判定
		//コメントは、　はてなダイアリー　「うるう年とは」　より
		case "2":
			if(year %4 == 0){
				if(year % 100 == 0){
					if(year % 400 == 0){
						//西暦が400で割り切れる年はうるう年である。
						if(day > 29){
							return false;
						}
					}else{
						//400で割り切れない場合、西暦が100で割り切れる年はうるう年ではない
						if(day > 28){
							return false;
						}
					}
				}else{
					//100で割り切れない場合、西暦が4で割り切れる年はうるう年である。
					if(day > 29){
						return false;
					}
				}
			}else{
				//4で割り切れない場合、うるう年ではない。
				if(day > 28){
					return false;
				}
			}

			break;
	}

	return true;
}

//バイト数を取得
function fncGetCountByte(str) { 
	result = 0;
	for (i = 0; i < str.length; i++) {
			c = str.charCodeAt(i);
			if ( (c >= 0x0 && c < 0x81) || (c == 0xf8f0) || (c >= 0xff61 && c < 0xffa0) || (c >= 0xf8f1 && c < 0xf8f4)) {
				result += 1;
			} else { 
				result += 2;
			}
	}
	return result;
} 

//生年月日正規表現
function fncCheckDateRegex(date){
	if(date.match("^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$")){
		return true;
	}else{
		return false;
	}
}

-->