// JavaScript Document
var pushbtn = 0;
function chkrc(){
	if (pushbtn == 0) return false;
	return true;
}

function chkprm(){
	sts = true;
	if (document.iform.name_sei.value == "") sts = false;
	if (document.iform.name_mei.value == "") sts = false;
	if (document.iform.toiawase.value == "") sts = false;
	if ((document.iform.howto[0].checked == false) && (document.iform.howto[1].checked == false) && (document.iform.howto[2].checked == false) && (document.iform.howto[3].checked == false)) sts = false;
	if (document.iform.howto[0].checked == true) {
		if ((document.iform.phone1 == "") || (document.iform.phone2 == "") || (document.iform.phone3 == "")) sts = false;
	}
	if (document.iform.howto[1].checked == true) {
		if ((document.iform.fax1 == "") || (document.iform.fax2 == "") || (document.iform.fax3 == "")) sts = false;
	}
	if (document.iform.howto[2].checked == true) {
		if ((document.iform.cell1 == "") || (document.iform.cell2 == "") || (document.iform.cell3 == "")) sts = false;
	}
	if (document.iform.howto[3].checked == true) {
		if (document.iform.mail.value == "") sts = false;
	}
	if (document.iform.inqno.value == "") sts = false;

	return sts;
}

function dosend(){
	pushbtn = 1;
	if (chkprm() == true) {
		document.iform.sw.value = 'send';
		document.iform.action = 'contact_c.php';
		document.iform.submit();
	} else {
		document.iform.sw.value = 'send';
		document.iform.action = 'index.php';
		document.iform.submit();
	}
	pushbtn = 0;
	return;
}

function doclear(){
	document.iform.name_sei.value = '';
	document.iform.name_mei.value = '';
	document.iform.toiawase.value = '';
	document.iform.howto[0].checked = false;
	document.iform.howto[1].checked = false;
	document.iform.howto[2].checked = false;
	document.iform.howto[3].checked = false;
	document.iform.phone1.value = '';
	document.iform.phone2.value = '';
	document.iform.phone3.value = '';
	document.iform.fax1.value = '';
	document.iform.fax2.value = '';
	document.iform.fax3.value = '';
	document.iform.cell1.value = '';
	document.iform.cell2.value = '';
	document.iform.cell3.value = '';
	document.iform.mail.value = '';
	document.iform.sex[0].checked = false;
	document.iform.sex[1].checked = false;
	document.iform.pcode1.value = '';
	document.iform.pcode2.value = '';
	document.iform.address.value = '';
	document.iform.inqno.value = '';
	return;
}
