function check_input(obj){
	//var content;

//必須項目関連
	if(obj.name.value==""){
		obj.name.focus();
		alert('First Name is missing.');
		return false; // 送信を中止 
	}
	if(obj.lname.value==""){
		obj.lname.focus();
		alert('Last Name is missing.');
		return false; // 送信を中止 
	}
	if(obj.email.value==""){
		obj.email.focus();
		alert('E-mail is missing.');
		return false; // 送信を中止 
	}
	if(obj.subject.value==""){
		obj.subject.focus();
		alert('Regarding is missing.');
		return false; // 送信を中止 
	}
	if(obj.content.value==""){
		obj.content.focus();
		alert('Question or Content is missing.');
		return false; // 送信を中止 
	}

//文字数制限について
	if(obj.name.value.length >= 81){
		obj.name.focus();
		alert('First Name is too long.');
		return false; // 送信を中止 
	}
	if(obj.lname.value.length >= 81){
		obj.lname.focus();
		alert('Last Name is too long.');
		return false; // 送信を中止 
	}
	if(obj.email.value.length >= 257){
		obj.email.focus();
		alert('E-mail is too long.');
		return false; // 送信を中止 
	}
	if(obj.tel.value.length >= 81){
		obj.tel.focus();
		alert('Phone number is too long.');
		return false; // 送信を中止 
	}
	if(obj.post.value.length >= 81){
		obj.post.focus();
		alert('Zip code is too long.');
		return false; // 送信を中止 
	}
	if(obj.address.value.length >= 257){
		obj.email.focus();
		alert('Address is too long.');
		return false; // 送信を中止 
	}
	if(obj.subject.value.length >= 81){
		obj.subject.focus();
		alert('Regarding is too long.');
		return false; // 送信を中止 
	}
	if(obj.content.value.length >= 2049){
		obj.content.focus();
		alert('Message exceeds maximum number of characters allowed.');
		return false; // 送信を中止 
	}

//全角半角判定
	if(zenhan(obj.name.value,1))
	{
		obj.name.focus();
		alert('First Name in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.lname.value,1))
	{
		obj.lname.focus();
		alert('Last Name in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.email.value,1))
	{
		obj.email.focus();
		alert('E-mail in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.tel.value,1))
	{
		obj.tel.focus();
		alert('Phone number in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.post.value,1))
	{
		obj.post.focus();
		alert('Zip code in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.address.value,1))
	{
		obj.address.focus();
		alert('Address in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.subject.value,1))
	{
		obj.subject.focus();
		alert('Regarding in alphabet please.');
		return false; // 送信を中止 
	}
	if(zenhan(obj.content.value,1))
	{
		obj.content.focus();
		alert('Question or Comment in alphabet please.');
		return false; // 送信を中止 
	}


//不正ドメインチェック
	str = obj.email.value;
	if(str.search("@") < 0){
		obj.email.focus();
		alert('Please make sure of the e-mail address.');
		return false; // 送信を中止 
	}
	emailData = str.split("@");
	if(emailData.length > 2){
		obj.email.focus();
		alert('Please make sure of the e-mail address.');
		return false; // 送信を中止 
	}
	if(emailData[0] == ""){
		obj.email.focus();
		alert('Please make sure of the e-mail address.');
		return false; // 送信を中止 
	}
	if(emailData[1] == ""){
		obj.email.focus();
		alert('Please make sure of the e-mail address.');
		return false; // 送信を中止 
	}
	/*if(emailData[1].length >= 40){
		obj.email.focus();
		alert('Please make sure of the e-mail address.');
		return false; // 送信を中止 
	}*/


	return true;//送信を実行

	//if(confirm(content)){ // 確認ダイアログを表示 
	//	return true; // 「OK」時は送信を実行 
	//} 
	//else{ // 「キャンセル」時の処理 

	//	alert('修正、お願いします'); // 警告ダイアログを表示 
	//	return false; // 送信を中止 
	//} 
}

//全角半角判定
function zenhan(str,fl) { 
    for (var i = 0; i < str.length; i++) { 
        var ch = str.charCodeAt(i); 
        // Shift_JIS: 0x0 〜 0x80, 0xa0 , 0xa1 〜 0xdf , 0xfd 〜 0xff 
        //if ( (ch >= 0x0 && ch <= 0x80) || (ch == 0xa0) || (ch >= 0xa1 && ch <= 0xdf) || (ch >= 0xff61 && ch <= 0xff9f)) { 
        if ( (ch >= 0x0 && ch <= 0x80) || (ch == 0xa0) || (ch >= 0xa1 && ch <= 0xdf)) { 
            if(!fl) return true; 
        } else { 
            if(fl) return true; 
        } 
    } 
    return false; 
} 
