function DataCheck() {
        var strNot='';
        if (document.question_form.NAME.value=='') {
                strNot += 'お名前、';
        }
//		if (document.question_form.ADDRESS.value=='') {
//				strNot += 'ご住所、';
//		}
//		if (document.question_form.TEL.value=='') {
//				strNot += '電話番号、';
//#		}
        if (document.question_form.MAIL.value=='') {
                strNot += 'メールアドレス、';
        }
        if (document.question_form.question.value=='') {
                strNot += 'お問い合わせ内容、';
        }
        if (strNot != '') {
                strNot = strNot.replace(/、$/, '');
                window.alert(strNot + 'の項目が入力されていません');
                return(false);
        }
        return(true);
}


function SendParam(thisObj, gid, cid){
	alert("ok");
	n = thisObj.selectedIndex;
	location.href = "./detail.cgi?gid=" + gid + "&cid=" + cid + "op=" + thisObj.options[n].value;
}


//数字のみチェック
function IsNumberOnly(str) {
	if( str.match( /[^0-9]+/ ) ) {
		return false;
	}
	return true;
}


//数字のみチェック(空を許す)
function IsNumberOnly2(str) {
	if( str == "" ) {
		return true;
	}
    if( str.match( /[^0-9]+/ ) ) {
        return false;
    }
    return true;
}


//電話番号形式に則っているか？
function IsPhoneNumber(str) {
    if( str.match( /[^0-9-]+/ ) ) {
        return false;
    }
    return true;
}


//メールアドレスチェック
function IsMailAddress(str) {
    if( str.match( /\,/ ) ) {
		return false;
	}
	if( str.match( /.+@.+\..+/ ) ) {
		return true;
	}
	return false;
}


//メールアドレスチェック(空を許す)
function IsMailAddress2(str) {
    if( str.match( /\,/ ) ) {
		return false;
	}
	if( str == "") {
		return true;
	}
    if( str.match( /.+@.+\..+/ ) ) {
        return true;
    }
    return false;
}


function AllCheck(){
		var strNot2='';
        var str2Not2='';
        if	( document.f1.order_username2.value != ""	|| document.f1.zip2a.value != '' ||
           	document.f1.zip2b.value != '' 		|| document.f1.pref2.value != '' ||
           	document.f1.order_add2.value != ''	|| document.f1.order_tel2.value != '' ||
           	document.f1.order_email2.value != ''
        ){
            if (document.f1.order_username2.value=='') {
                    strNot2 += 'お名前、';
            }
            if (document.f1.zip2a.value=='' || document.f1.zip2b.value=='') {
                    strNot2 += '郵便番号、';
            }
            if (document.f1.order_add2.value=='') {
                    strNot2 += 'ご住所、';
            }
			if (document.f1.pref2.value==''){
					strNot2 += '県名、';
			}
            if (document.f1.order_tel2.value=='') {
                    strNot2 += '電話番号、';
            }
            if (document.f1.order_email2.value=='') {
                    strNot2 += 'メールアドレス、';
            }
            if (!IsNumberOnly2(document.f1.zip2a.value) || !IsNumberOnly2(document.f1.zip2b.value)){
                    str2Not2 += '郵便番号、';
            }
            if (!IsPhoneNumber(document.f1.order_tel2.value))     {
                    str2Not2 += '電話番号、';
            }
            if (!IsMailAddress2(document.f1.order_email2.value))  {
                    str2Not2 += 'メールアドレス、';
            }
            if (strNot2 != '' || str2Not2 != '') {
                    if(strNot2 != ''){
         				strNot2='送付先' + strNot2;
                        strNot2 = strNot2.replace(/、$/, '');
                        strNot2 = strNot2 + 'の項目が入力されていません\n';
                    }
                    if(str2Not2 != ''){
        				str2Not2='送付先' + str2Not2;
                        str2Not2 = str2Not2.replace(/、$/, '');
                        str2Not2 = str2Not2 + 'の入力が正しくありません\n';
                    }
//                    window.alert(strNot2 + str2Not2);
//                    return(false);
            }
    	}
        var strNot='';
		var str2Not='';
        if (document.f1.order_username.value=='') {
                strNot += 'お名前、';
        }
        if (document.f1.zipa.value=='' || document.f1.zipb.value=='') {
                strNot += '郵便番号、';
        }
        if (document.f1.order_add.value=='') {
                strNot += 'ご住所、';
        }
        if (document.f1.order_tel.value=='') {
                strNot += '電話番号、';
        }
        if (document.f1.order_email.value=='') {
                strNot += 'メールアドレス、';
        }
        if (!IsNumberOnly2(document.f1.zipa.value) || !IsNumberOnly2(document.f1.zipb.value)){
                str2Not += '郵便番号、';
		}
        if (!IsPhoneNumber(document.f1.order_tel.value))     {
                str2Not += '電話番号、';
		}
        if (!IsMailAddress2(document.f1.order_email.value))  {
                str2Not += 'メールアドレス、';
		}
//        if (!IsNumberOnly2(document.f1.zip2a.value) || !IsNumberOnly2(document.f1.zip2b.value)){
//                str2Not += '送付先郵便番号、';
//		}
//        if (!IsPhoneNumber(document.f1.order_tel2.value))    {
//                str2Not += '送付先電話番号、';
//		}
//        if (!IsMailAddress2(document.f1.order_email2.value)) {
//                str2Not += '送付先メールアドレス、';
//		}
        if (strNot != '' || str2Not != '' || strNot2 != '' || str2Not2 != '') {
				if(strNot != ''){
                strNot = strNot.replace(/、$/, '');
                strNot = strNot + 'の項目が入力されていません\n';
				}
				if(str2Not != ''){
                str2Not = str2Not.replace(/、$/, '');
                str2Not = str2Not + 'の入力が正しくありません\n';
				}
				window.alert(strNot + str2Not + strNot2 + str2Not2);
                return(false);
        }
		return true;
}
function DeleteChk(){
    myRet = confirm("登録データを削除します。よろしいですか？");
    if ( myRet == true ){
        return true;
    }
    else{
        return false;
    }
}

