<!--
/* START for Form Checking */

function valiData() {
errfound = false;

/* Track Select*/
{
   var count = 0;
   for (i=0; i<4; i++)
		if (document.registration.Attend11[i].checked) count++;
	if (count <=0)
	{
		alert("Please select Track Session \n for \"11:30-12:20\"");
		document.registration.Attend11[+i].checked = false;
		return;
}
   var count = 0;
   for (i=0; i<4; i++)
		if (document.registration.Attend12[i].checked) count++;
	if (count <=0)
	{
		alert("Please select Track Session \n for \"13:45-14:30\"");
		document.registration.Attend12[+i].checked = false;
		return;
}
   var count = 0;
   for (i=0; i<4; i++)
		if (document.registration.Attend13[i].checked) count++;
	if (count <=0)
	{
		alert("Please select Track Session \n for \"14:30-15:15\"");
		document.registration.Attend13[+i].checked = false;
		return;
}
   var count = 0;
   for (i=0; i<4; i++)
		if (document.registration.Attend14[i].checked) count++;
	if (count <=0)
	{
		alert("Please select Track Session \n for \"15:30-16:15\"");
		document.registration.Attend14[+i].checked = false;
		return;
}
}
/* End Track Select*/

{
   var count = 0;
   for (i=0; i<2; i++)
		if (document.registration.Traffic[i].checked) count++;
	if (count <=0)
	{
		alert("Please select your Transportation");
		document.registration.Traffic[+i].checked = false;
}
}

if (document.registration.chiName.value == "") {
	ErrorMsg("請填上你的「中文姓名」！");
}
if (document.registration.FirstName.value == "") {
	ErrorMsg("請填上你的「英文名字」！");
}
if (document.registration.LastName.value == "") {
	ErrorMsg("請填上你的「英文姓氏」！");
}
if (document.registration.Gender.value == "") {
	ErrorMsg("請選擇先生或小姐！");
} 
if (document.registration.chiCompany.value == "") {
	ErrorMsg("請填上你的「公司名稱」！");
}
if (document.registration.Company.value == "") {
	ErrorMsg("請填上你的「公司英文名稱」！");
}
if (document.registration.phoneCode.value == "區號") {
	ErrorMsg("請填上你的「電話區號」！");
}
if (document.registration.phoneCode.value == "") {
	ErrorMsg("請填上你的「電話區號」！");
}
if (document.registration.Phone.value == "") {
	ErrorMsg("請填上你的「電話號碼」！");
}
if (document.registration.Phone.value.length <=5) {
	ErrorMsg("請填上你的正確「電話號碼」！");
}
if (document.registration.eMail.value == "") {
	ErrorMsg("請填上你的「電子郵件」！");
}
if (document.registration.eMail.value.indexOf ('@', 0) == -1) {
	ErrorMsg("請填上你的正確「電子郵件」 (you@your.com.tw)");
}
if (document.registration.eMail.value.indexOf ('.', 0) == -1) {
	ErrorMsg("請填上你的正確「電子郵件」需要.com 或 .com.tw");
}
if (document.registration.eMail.value.length <=8) {
	ErrorMsg("請填上你的正確「電子郵件」");
}
if (document.registration.Lunch.value == "") {
	ErrorMsg("請選擇你的「午餐」選項！");
}


SubmitForm();
} 

function ErrorMsg(text) {
	if (errfound) return;
	window.alert(text);
	errfound=true;
} 

function SubmitForm() {
	if(errfound == false) {
	cfmSubmit = confirm("謝謝！你的報名資料即將送出。");
	if(cfmSubmit == true) {
	document.registration.submit();
}

}
}


/* start code for reset */

function reSet() {
	document.registration.reset();
}

//-->  