<!--
function point2() {
	with (document.forms['frmLS']) {
		if (optSelected[0].checked) {
			txtFnameLname.focus();
			txtPID.value = "";
		} else {
			txtPID.focus();
			txtFnameLname.value = "";
		}
	}
}

function checkSemaphore(obj) {
	with (document.forms['frmLS']) {
		if (obj.name == "txtFnameLname") {
			optSelected[0].checked = true;
			txtPID.value = "";
		} else {
			optSelected[1].checked = true;
			txtFnameLname.value = "";
			checkDash();
		}
	}
}

function checkDash() {
	with (document.forms['menu']) {
		switch(pid.value.length) {
			case 1 : case 6 : case 12 : case 15 :
			pid.value = pid.value + "-";
		}
	}
	setTimeout("checkDash()",200);
}

function CheckNumKey(key){
   if ( ((key < 48) || (key > 57)) && (key != 13))
	return false;
   else
	return true;
}

function checkSubmit(chkform) {
	var pFnameLname = /^\S+\s+\S+$/;
	var pPID = /^\d{1}-\d{4}-\d{5}-\d{2}-\d{1}$/;
	var ok = false;
	for (var i=0;i<2;i++) {
		if (chkform.optSelected[i].checked) {
			if (i == 0) {
				with (chkform.txtFnameLname) {
					if (value == "") {
						alert("กรุณาใส่ชื่อและนามสกุลด้วย !");
						focus();
						event.returnValue = false;
					} else if (value.match(pFnameLname) == null) {
						alert("กรุณาใส่ชื่อและนามสกุลตามนี้\nรูปแบบ : ชื่อ<ที่ว่าง>นามสกุล");
						focus();
						select();
						event.returnValue = false;
					}
				}
			} else {
				with (chkform.txtPID) {
					if (value == "") {
						alert("กรุณาใส่เลขประจำตัวประชาชนด้วย !");
						focus();
						event.returnValue = false;
					} else if (value.match(pPID) == null) {
						alert("กรุณาใส่เลขประจำตัวประชาชนให้ครบถ้วนและถูกต้องด้วย !");
						focus();
						select();
						event.returnValue = false;
					}
				}
			}
			ok = true;
		}
	}
	if (!ok) {
		alert("กรุณาระบุข้อมูล !!!");
		event.returnValue = false;
	}
}

function checkSubmit1(chkform) {
        var pFnameLname = /^\S+\s+\S+$/;
        var pPID = /^\d{1}-\d{4}-\d{5}-\d{2}-\d{1}$/;
        var ok = false;
              with (chkform.txtPID) {
                  if (value == "") {
                          alert("กรุณาใส่เลขประจำตัวประชาชนด้วย !");
                          focus();
                          event.returnValue = false;
                          } else if (value.match(pPID) == null) {
                               alert("กรุณาใส่เลขประจำตัวประชาชนให้ครบถ้วนและถูกต้องด้วย !");
                               focus();
                               select();
                               event.returnValue = false;
                               }
                         }
}
function checkSubmitUpd(chkform) {
        if(chkform.town_birth.value == "" || chkform.state_birth.value == "" || chkform.land_birth.value == ""){
               alert("กรุณาใส่สถานที่เกิดให้ครบ !");
               focus();
               event.returnValue = false;
	}
      /*  if(chkform.state_birth.value == ""){
               alert("กรุณาใส่จังหวัด/มลรัฐ ที่เกิด !");
               focus();
               event.returnValue = false;
	}
        if(chkform.land_birth.value == ""){
               alert("กรุณาใส่ประเทศ ที่เกิด !");
               focus();
               event.returnValue = false;
	}
        */
}

function newImage(arg) {
        if (document.images) {
                rslt = new Image();
                rslt.src = arg;
                return rslt;
        }
}

function changeImages() {
        if (document.images && (preloadFlag == true)) {
                for (var i=0; i<changeImages.arguments.length; i+=2) {
                        changeImages.arguments[i].src = changeImages.arguments[i+1];
                }
        }
}

var preloadFlag = false;
function preloadImages() {
        if (document.images) {
                ok_over = newImage("images/ok-over.gif");
                backmenu_over = newImage("images/backmenu-over.gif");
                preloadFlag = true;
        }
}
//-->

