<!--

Form_Null_Msg_1= "Please input Name / 請輸入姓名";
Form_Null_Msg_2= "Please input Telephone no. / 請輸入電話號碼";
Form_Null_Msg_3= "Please input Email / 請輸入電郵";
Form_Null_Msg_4= "Please input number - Telephone no. / 請輸入數字 - 電話號碼";
Form_Null_Msg_5= "Please input build no";
Form_Null_Msg_6= "Please input detail";
Form_Null_Msg_7= "Please input login id";
Form_Null_Msg_8= "Please input password";
Form_Null_Msg_9= "Please select a program";
Form_Null_Msg_10= "Please input bug detail";
Form_Null_Msg_11= "Please Enter Existing Password";
Form_Null_Msg_12= "Please Enter New Password";
Form_Null_Msg_13= "Please Enter New Re-type Password";
Form_Null_Msg_14= "New Password Not Matched";
Form_Null_Msg_15= "Please select either a Bug, an Enhancement, or a Program";
Form_Null_Msg_16= "Please input Build No.";
Form_Null_Msg_17= "Please input Update Detail";
Form_Null_Msg_18= "Please select either a bug, an enhancement or a program";
Form_Mail_Msg_1= "Invalid email format (Missing @) / 電郵格式不正確 (無 @ 符號)";
Form_Mail_Msg_2= "Invalid email format (Missing .) / 電郵格式不正確 (無 . 符號)";
Form_Chkbox_Msg_1="Please check  at lease one box / 請至少選擇一項";
Form_SelectBox_Msg_1="Please select Occupation / 請選擇職業";

function Form_Validate() {
	if (document.form1.app_name.value=="")
	{
		alert(Form_Null_Msg_1);
		document.form1.app_name.focus();
		return false;
	}
	if (document.form1.app_tel.value=="")
	{
		alert(Form_Null_Msg_2);
		document.form1.app_tel.focus();
		return false;
	}
	for(var i = 0; i < document.form1.app_tel.value.length ; i++){
		var onechar = document.form1.app_tel.value.substring(i, i + 1);
		if( onechar < "0" || onechar > "9"){
			alert (Form_Null_Msg_4);
			document.form1.app_tel.focus();
			return false;
		}
	}
	if (document.form1.app_email.value=="")
	{
		alert(Form_Null_Msg_3);
		document.form1.app_email.focus();
		return false;
	}
	if ((p=document.form1.app_email.value.indexOf("@"))<1){
		alert(Form_Mail_Msg_1);
		document.form1.app_email.focus();
		return false;
	}
	if ((p=document.form1.app_email.value.indexOf("."))<1){
		document.form1.app_email.focus();
		alert(Form_Mail_Msg_2);
		return false;
	}
	Total_Check=0;

	if (document.form1.checkbox1.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox2.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox3.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox4.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox5.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox6.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox7.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox8.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox9.checked){
		Total_Check=Total_Check+1;
	}
	if (document.form1.checkbox10.checked){
		Total_Check=Total_Check+1;
	}
	if (Total_Check<1){
		alert(Form_Chkbox_Msg_1);
		return false;
	}
		return true;
}
function Form_Reset() {
	document.form1.reset();
}
function Form_Submit() {
	if (Form_Validate()==true){
		document.form1.submit();
	}
}

function Form_Validate_01() {
	if (document.form1.txt_buildno.value=="")
	{
		alert(Form_Null_Msg_5);
		document.form1.txt_buildno.focus();
		return false;
	}
	if (document.form1.txt_detail.value=="")
	{
		alert(Form_Null_Msg_6);
		document.form1.txt_detail.focus();
		return false;
	}

		return true;
}
function Form_Submit_01() {
	if (Form_Validate_01()==true){
		document.form1.submit();
	}
}

function Form_Validate_02() {
	if (document.form1.txt_loginid.value=="")
	{
		alert(Form_Null_Msg_7);
		document.form1.txt_loginid.focus();
		return false;
	}
	if (document.form1.txt_password.value=="")
	{
		alert(Form_Null_Msg_8);
		document.form1.txt_password.focus();
		return false;
	}

		return true;
}
function Form_Submit_02() {
	if (Form_Validate_02()==true){
		document.form1.submit();
	}
}

function Form_Validate_03() {
	if (document.form1.select.value=="0")
	{
		alert(Form_Null_Msg_9);
//		document.form1.txt_loginid.focus();
		return false;
	}
	if (document.form1.txt_detail.value=="")
	{
		alert(Form_Null_Msg_10);
		document.form1.txt_detail.focus();
		return false;
	}

		return true;
}
function Form_Submit_03() {
	if (Form_Validate_03()==true){
		document.form1.submit();
	}
}

function Form_Check_Password() {
	if (document.form1.txt_password.value=="")
	{
		alert(Form_Null_Msg_11);
		document.form1.txt_password.focus();
		return false;
	}
	if (document.form1.txt_newpassword.value=="")
	{
		alert(Form_Null_Msg_12);
		document.form1.txt_newpassword.focus();
		return false;
	}
	if (document.form1.txt_newpassword1.value=="")
	{
		alert(Form_Null_Msg_13);
		document.form1.txt_newpassword1.focus();
		return false;
	}
	if (document.form1.txt_newpassword.value!=document.form1.txt_newpassword1.value)
	{
		alert(Form_Null_Msg_14);
		document.form1.txt_newpassword.focus();
		return false;
	}
	return true;
}


function Form_Validate_04() {
	Total_Select = 0;
	if (document.form1.select_bug.value=="0" && document.form1.select_enhancement.value=="0" && document.form1.select_program.value=="0")
	{
		alert(Form_Null_Msg_15);
//		document.form1.txt_loginid.focus();
		return false;
	}
	if (document.form1.select_bug.value!="0")
	{
		Total_Select = Total_Select + 1;
	}
	if (document.form1.select_program.value!="0")
	{
		Total_Select = Total_Select + 1;
	}
	if (document.form1.select_enhancement.value!="0")
	{
		Total_Select = Total_Select + 1;
	}
	if (Total_Select > 1)
	{
		alert(Form_Null_Msg_18);
//		document.form1.txt_loginid.focus();
		return false;
	}
//	if (document.form1.txt_build_no.value=="")
//	{
//		alert(Form_Null_Msg_16);
//		document.form1.txt_build_no.focus();
//		return false;
//	}
	if (document.form1.txt_detail.value=="")
	{
		alert(Form_Null_Msg_17);
		document.form1.txt_detail.focus();
		return false;
	}
		return true;
}
function Form_Submit_04() {
	if (Form_Validate_04()==true){
		document.form1.submit();
	}
}
-->