
function formcheck(){
var fOBj = document.frm1;


if(fOBj.KAISYA_NM.value==""){
	alert('\nYou didn\'t specify a company/organization name. Please specify and submit again.');
	fOBj.KAISYA_NM.focus();
	return false;
}


if(fOBj.BUSYO_NM.value==""){
	alert('\nYou didn\'t specify a department name. Please specify and submit again.');
	fOBj.BUSYO_NM.focus();
	return false;
}

if(fOBj.CONTACT_NM.value==""){
	alert('\nYou didn\'t specify a name. Please specify and submit again.');
	fOBj.CONTACT_NM.focus();
	return false;
}

if(fOBj.POSTAL_CODE.value!=""){
	okpos = '0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	pos = fOBj.POSTAL_CODE.value;
	eer = 0;
	for (i=0;i<pos.length;i++){
		if (okpos.indexOf(pos.charAt(i)) == -1) eer++;
	}
	if (eer!=0) {
		alert('\nYou didn\'t specify a valid postal code. Please correct the entry and submit again.');
		fOBj.POSTAL_CODE.focus();
	return false;
	}

}


if(fOBj.TEL_NO.value==""){
	alert('\nYou didn\'t specify a telephone number. Please specify and submit again.');
	fOBj.TEL_NO.focus();return false;
}

if(fOBj.TEL_NO.value!=""){
	oktel = '0123456789-+';
	tel = fOBj.TEL_NO.value;
	err = 0;
	for (i=0;i<tel.length;i++){
		if (oktel.indexOf(tel.charAt(i)) == -1) err++;
	}
	if (err!=0) {
		alert('\nYou didn\'t specify a valid telephone number. Please correct the entry and submit again.');
		fOBj.TEL_NO.focus();return false;
	}

}

if(fOBj.FAX_NO.value!=""){
	okfax = '0123456789-+';
	fax = fOBj.FAX_NO.value;
	rrr = 0;
	for (i=0;i<fax.length;i++){
		if (okfax.indexOf(fax.charAt(i)) == -1) rrr++;
	}
	if (rrr!=0) {
		alert('\nYou didn\'t specify a valid FAX number. Please correct the entry and submit again.');
		fOBj.FAX_NO.focus();
		return false;
	}

}

if(fOBj.EMAIL_ADDRESS.value==""){
	alert('\nYou didn\'t specify an e-mail address. Please specify and submit again.');
	fOBj.EMAIL_ADDRESS.focus();
	return false;
}


if(fOBj.EMAIL_ADDRESS.value!=""){
	if (!fOBj.EMAIL_ADDRESS.value.match(/^\S+@\S+\.\S+$/)){  
		alert('\nYou didn\'t specify a valid e-mail address. Please correct the entry and submit again.');
		fOBj.EMAIL_ADDRESS.focus();
		return false;
	}
	xx1= fOBj.EMAIL_ADDRESS.value.split("@");
	xx2= xx1[1].indexOf("\.\.");
	if(xx2 != "-1") {
		alert('\nA consecutive \'.\'(period) was specified in your e-mail address. Please correct the entry and submit again.');
//		fOBj.EMAIL_ADDRESS.focus();
		return false;
	}
	xx3 = fOBj.EMAIL_ADDRESS.value.indexOf("\,");
	if(xx3 != "-1") {
		alert('\nA \',\'(comma) was specified in your e-mail address. Please correct the entry and submit again.');
		fOBj.EMAIL_ADDRESS.focus();
		return false;
	}
}


if(fOBj.EMAIL_ADDRESS2.value==""){
	alert('\nYou didn\'t specify an e-mail address for confirmation. Please specify and submit again.');
	fOBj.EMAIL_ADDRESS2.focus();
	return false;
}


if(fOBj.EMAIL_ADDRESS2.value!=""){
	if (!fOBj.EMAIL_ADDRESS2.value.match(/^\S+@\S+\.\S+$/)){  
		alert('\nYou didn\'t specify a valid e-mail address for confirmation. Please correct the entry and submit again.');
		fOBj.EMAIL_ADDRESS2.focus();
		return false;
	}
	yy1= fOBj.EMAIL_ADDRESS2.value.split("@");
	yy2= yy1[1].indexOf("\.\.");
	if(yy2 != "-1") {
		alert('\nA consecutive \'.\'(period) was specified in your e-mail address for confirmation. Please correct the entry and submit again.');
//		fOBj.EMAIL_ADDRESS2.focus();
		return false;
	}
	yy3 = fOBj.EMAIL_ADDRESS2.value.indexOf("\,");
	if(yy3 != "-1") {
		alert('\nA \',\'(comma) was specified in your e-mail address for confirmation. Please correct the entry and submit again.');
		fOBj.EMAIL_ADDRESS2.focus();
		return false;
	}
}

if(fOBj.EMAIL_ADDRESS.value!=fOBj.EMAIL_ADDRESS2.value){
	alert('\nYour e-mail address entries do not match.Please check and submit again.');
	fOBj.EMAIL_ADDRESS.focus();
	return false;
}



return true;
}

