function formcheck(rec)
{	
	var s;
	for (i=0; i<rec; i++) if (document.form_t.elements["F_PRODUCT"][i].checked) s = i+1;
	if (i != 0 && s == undefined){
		alert('Inquiry classification is not chosen.');
		return false;
	}

	//var n;
	//for (i=0; i<9; i++) if (document.form_t.elements["F_INQUIRY_KIND"][i].checked) n = i+1;
	//if (n == undefined){
	//	alert('お問い合わせ種別が選択されていません。');
	//	return false;
	//}

	inquiry = document.form_t.F_INQUIRY.value;
	if(inquiry == ""){
		alert("The contents of an inquiry are indispensable items. Please input.");
		document.form_t.F_INQUIRY.focus();
		return false;
	}

	company = document.form_t.F_EXCEPT_NAME.value;
	if(company == "")	{
		alert("A company / school is an indispensable items. Please input.");
		document.form_t.F_EXCEPT_NAME.focus();
		return false;
	}

	//busyo = document.form_t.F_POST_NAME.value;
	//if(busyo == "")	{
	//	alert("部署名は必須項目です。入力してください。");
	//	document.form_t.F_POST_NAME.focus();
	//	return false;
	//}

	name = document.form_t.F_NAME.value;
	if(name == "")	{
		alert("A name is an indispensable item. Please input.");
		document.form_t.F_NAME.focus();
		return false;
	}

	//kana = document.form_t.F_NAME_KANA.value;
	//if(kana == "")	{
	//	alert("フリガナは必須項目です。入力してください。");
	//	document.form_t.F_NAME_KANA.focus();
	//	return false;
	//}
	//base = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをんぁぃぅぇぉゃゅょがぎぐげござじずぜぞだぢずでどばびぶべぼぱぴぷぺぽｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮ､｡｢｣";
	//data = "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョ、。「」";
	//converted="";

	//tmp = document.form_t.F_NAME_KANA.value;
	//tmp = document.form_t.F_NAME_KANA.value;
	//for (i=0; i<tmp.length; i++)
	//{
	//	c = tmp.charAt(i);
	//	if (base.indexOf(c,0) >= 0)
	//	{
	//		alert("フリガナは全角カナでご入力お願いします。");
	//		document.form_t.F_NAME_KANA.focus();
	//		return false;
	//	}
	//}

	e_mail=document.form_t.F_E_MAIL.value;
	if(e_mail == "")
	{
		alert("A mail address is an indispensable item. Please input.");
		document.form_t.F_E_MAIL.focus();
		return false;
	}
	txt = document.form_t.F_E_MAIL.value;
	data = txt.match(/^\S+@\S+\.\S+$/);
	if (!data){
		alert("A mail address is not right.");
		document.form_t.F_E_MAIL.focus();
		return false;
	}

	//zip_code=document.form_t.F_POSTAL_CODE.value;
	//if(zip_code == "")
	//{
	//	alert("郵便番号は必須項目です。入力してください。");
	//	document.form_t.F_POSTAL_CODE.focus();
	//	return false;
	//}
	//if(document.form_t.F_ADDRESS1.value == "")
	//{
	//	alert("住所（都・道・府・県）は必須項目です。入力してください。");
	//	document.form_t.F_ADDRESS1.focus();
	//	return false;
	//}
	//if(document.form_t.F_ADDRESS2.value == "")
	//{
	//	alert("住所（市・区・群・町・番地）は必須項目です。入力してください。");
	//	document.form_t.F_ADDRESS2.focus();
	//	return false;
	//}

	if(document.form_t.F_TEL.value == "")
	{
		alert("A telephone number is an indispensable item. Please input.");
		document.form_t.F_TEL.focus();
		return false;
	}
	txt = document.form_t.F_TEL.value;
	data1 = txt.match(/^[0-9-]{6,9}$|^[0-9-]{12}$/);
	data2 = txt.match(/^\d{1,4}-\d{4}$|^\d{2,5}-\d{1,4}-\d{4}$/);
	if(!data1) { // mod#20091215
	//if(!data1 && !data2) {
		alert("A telephone number is inaccurate.");
		document.form_t.F_TEL.focus();
		return false;
	}
	txt = document.form_t.F_FAX.value;
	if(txt != "")
	{
		data1 = txt.match(/^[0-9-]{6,9}$|^[0-9-]{12}$/);
		data2 = txt.match(/^\d{1,4}-\d{4}$|^\d{2,5}-\d{1,4}-\d{4}$/);
		if(!data1) { // mod#20091215
		//if(!data1 && !data2) {
			alert("A facsimile number is inaccurate.");
			document.form_t.F_FAX.focus();
			return false;
		}
	}

	//if(document.form_t.F_TYPE_INDUSTRY.value == "")
	//{
	//	alert("業種・専門分野は必須項目です。入力してください。");
	//	document.form_t.F_TYPE_INDUSTRY.focus();
	//	return false;
	//}

	//if(document.form_t.F_OCCUPATIONAL.value == "")
	//{
	//	alert("職種は必須項目です。入力してください。");
	//	document.form_t.F_OCCUPATIONAL.focus();
	//	return false;
	//}

	//n = document.form_t.elements.length;
	//m = "";
	//for( e=0; e<n; e++ ){
	//	m = document.form_t.elements[e].value;
	//	m = allreplace(m,"\'","’");
	//	m = allreplace(m,",","，");
	//	m = allreplace(m,"\"","”");
	//	document.form_t.elements[e].value = m;
	//}
	if(ByteCheck(document.form_t.F_INQUIRY,10000)=="false") return false;
//	return confirm("送信します");

	return true;

}

function allreplace(str,str1,str2){
	kazu=0;
	kekka=0;
	moji=str;
	for(i=0; i<moji.length; i++)
		if(moji.charAt(i)==str1)kazu++;
	for(i=0; i<kazu; i++)
		moji=moji.replace(str1,str2);
	return moji;
}

function ByteCheck(obj,num){
	var bytes=0;
	for(i=0;i<obj.value.length;i++){
		bytes+=((obj.value.charAt(i)>="｡"&&obj.value.charAt(i)<="ﾟ")?1:(escape(obj.value.charAt(i)).length>3?2:1));
	}
	if(bytes>num){
		alert("Please somewhat shorten the contents of an inquiry.");
		return false;
	}
}
