// JavaScript Document
function msubmit(){	
	if($("#company").val() == ""){
		alert('会社名を入力してください');
		$("#company").focus();
		$("#company").select();
		return false;
	}
	else if($("#client").val() == ""){
		alert('お名前を入力してください');
		$("#client").focus();
		$("#client").select();
		return false;
	}
	else if($("#kana").val() == ""){
		alert('フリガナを入力してください');
		$("#kana").focus();
		$("#kana").select();
		return false;
	}
	else if($("#tel").val() == ""){
		alert('電話番号 を入力してください');
		$("#tel").focus();
		$("#tel").select();
		return false;
	}
	else if($("#email").val() == ""){
		alert('メールアドレスを入力してください');
		$("#email").focus();
		$("#email").select();
		return false;
	}
	else if($("#enter").val() == ""){
		alert('確認用メールアドレスを入力してください');
		$("#enter").focus();
		$("#enter").select();
		return false;
	}
	else if($("#content").val() == ""){
		alert('お問合せ詳細を入力してください');
		$("#content").focus();
		$("#content").select();
		return false;
	}
	else{
		return true;
	}
}

function checkEmail(){
	var exp = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	var email = $("#email").val();
	if(email != ""){
		if(exp.exec(email) == null){
			alert('メールの形式は違います。');
			$("#email").focus();
			$("#email").select();
			return false;
		}
		else{
			return true;
		}	
	}
}

function checkEmails(){
	var exp = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	var enter = $("#enter").val();
	var email = $("#email").val();
	if(enter != ""){
		if(exp.exec(enter) == null||$("#enter").val()!=$("#email").val()){
			alert('確認のメールアドレスとは相違があります。');
			$("#enter").focus();
			$("#enter").select();
			return false;
		}
		else{
			return true;
		}	
	}
}

//判断是否是电话
function checktel(){
	var exp =/^[0-9-]{7,14}$/;
	var tel = $("#tel").val();
	if(tel != ""){
		if(exp.exec(tel) == null){
			alert('電話番号の形式は違います。');
			$("#tel").focus();
			$("#tel").select();
			return false;
		}
		else{
			return true;
		}
	}
}

function checkfax(){
	var exp =/^[0-9-]{7,14}$/;
	var fax = $("#fax").val();
	if(fax != ""){
		if(exp.exec(fax) == null){
			alert('FAX番号の形式は違います。');
			$("#fax").focus();
			$("#fax").select();
			return false;
		}
		else{
			return true;
		}
	}
}

//判断是否是片假名
function doubleword(){
	var exp = /[^x00-xff]/;
	var kana = $("#kana").val();
	if(kana != ""){
		if(exp.exec(kana) == null){
			alert('カタカナの形式は違います。');
			$("#kana").focus();
			$("#kana").select();
			return false;
		}
		else{
			return true;
		}
	}
}