/* Buffer Check */
	function buff_check(){
        if(document.mailForm.USER_ID.value == "")
        {
            alert("お名前が入力されていません。");
            document.mailForm.USER_ID.focus();
            return(false);
        }
        if(document.mailForm.MAIL_ADDRESS.value == "")
        {
            alert("メールアドレスが入力されていません。");
            document.mailForm.MAIL_ADDRESS.focus();
            return(false);
        }
        if(!checkEmail(document.mailForm.MAIL_ADDRESS.value))
        {
			alert ("入力されたメールアドレスに誤りがあります。\n再度入力し直してください。");
            return(false);
		}
        if(document.mailForm.TITLE.value == "")
        {
            alert("ご相談項目が入力されていません。");
            document.mailForm.TITLE.focus();
            return(false);
        }
	}

	function checkEmail(checkString){
		var newstr = "";
		var at = false;
		var dot = false;

		if (checkString.indexOf("@") != -1) {
			at = true;
		} else if (checkString.indexOf(".") != -1) {
			dot = true;
		}
		for (var i = 0; i < checkString.length; i++) {
			ch = checkString.substring(i, i + 1)
			if ((ch < "A" || ch > "Z") && (ch < "a" || ch > "z")
				&& (ch != "@") && (ch != ".") && (ch != "_")
				&& (ch != "-") && (ch < "0" || ch > "9")) {
				return false;
			}
			if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
				|| (ch == "@") || (ch == ".") || (ch == "_")
				|| (ch == "-") || (ch >= "0" && ch <= "9")) {
				newstr += ch;
				if (ch == "@") {
					at=true;
				}
				if (ch == ".") {
					dot=true;
				}
			}
		}
		if ((at == true) && (dot == true)) {
			return true;
		} else {
			return false;
		}
	}

	function mailCancel(obj){
		obj.submit();
		return true;
	}


