<!--
function isEmail(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")) {
			newstr += ch;
			if (ch == "@") {
				at=true;
			}
			if (ch == ".") {
				dot=true;
			}
		}
	}
	if ((at == true) && (dot == true)) {
		return true;
	} else {
		return false;
	}
}

function CheckCode(str,flg) { 
// flg 0：半角判別 1：全角判別
	Han = false;
	Zen = false;
    for (var i = 0; i < str.length; i++) { 
        var c = str.charCodeAt(i); 
        // Shift_JIS: 0x0 〜 0x80, 0xa0 , 0xa1 〜 0xdf , 0xfd 〜 0xff
        // Unicode : 0x0 〜 0x80, 0xf8f0, 0xff61 〜 0xff9f, 0xf8f1 〜 0xf8f3
        if ( (c >= 0x0 && c < 0x81) || (c == 0xf8f0) || (c >= 0xff61 && c < 0xffa0) || (c >= 0xf8f1 && c < 0xf8f4)) {
			Han = true;
        }else{
			Zen = true;
        }
    }

	if((flg == 0) && (Zen == true)){
		return false;
	}
	if((flg == 1) && (Han == true)){
		return false;
	}

    return true;
} 


function checkItem(frmName){

var err = 0;

	clear(frmName);
	if(frmName.comMail.value != ""){
		if(CheckCode(frmName.comMail.value,0) == true){
			if(isEmail(frmName.comMail.value) == false){
				document.getElementById("err_email").innerHTML = "<font color='red'>形式が不正です。</font>";
				frmName.comMail.style.backgroundColor ="#FFD7D7";
				err = 1;
			}
		}else{
			document.getElementById("err_email").innerHTML = "<font color='red'>半角英数字で入力してください。</font>";
			err = 1;
		}
	}

	if(frmName.comText.value == ""){
		document.getElementById("err_text").innerHTML = "<font color='red'>必須入力です。</font>";
		frmName.comText.style.backgroundColor ="#FFD7D7";
		err = 1;
	}


	if(err == 1){
		return false;
	}
	
	return true;
}


function clear(frmName){

	document.getElementById("err_email").innerHTML = "";
	frmName.comMail.style.backgroundColor ="#FFFFFF";

	document.getElementById("err_text").innerHTML = "";
	frmName.comText.style.backgroundColor ="#FFFFFF";

}



function pageback(){
	document.comments.action = document.comments.domain.value + "index.php#comment";
	document.comments.a.value = "alche";
	document.comments.submit();
}


//-->

