function Confirms(){
	if(confirm("คุณต้องการลบใช่หรือไม่")){
		return(true);
	}
	return(false);
}

function trim(s) {
	return s.replace(/[ \t]+$/, "").replace(/^[ \t]+/, "");
}

function CheckGuestbook(theForm) {
	if(trim(theForm.name.value)==""){
		alert("กรุณากรอกชื่อด้วยครับ");
		theForm.name.focus();
		return(false);
	}
	if(theForm.email.value == "") {
		 alert("กรุณากรอกอีเมลด้วยครับ");
		 theForm.email.focus();
		 return(false);
	}
	if(theForm.email.value.indexOf('@')==-1){
		alert("กรุณากรอกอีเมลให้ถูกต้องด้วยครับ");
		theForm.email.select();
		return false;
	}
	if(theForm.email.value.indexOf('.')==-1){
		alert("กรุณากรอกอีเมลให้ถูกต้องด้วยครับ");
		theForm.email.select();
		return false;
	}
	if(trim(theForm.detail.value)==""){
		alert("กรุณากรอกรายละเอียดด้วยครับ");
		theForm.detail.focus();
		return(false);
	}
	if(theForm.detail.value.length<11){
		alert("รายละเอียดต้องไม่ต่ำกว่า 10 ตัวอักษร");
		theForm.detail.focus();
		return(false);
	}
	if(trim(theForm.security.value)==""){
		alert("กรุณากรอกรหัสทดสอบความเป็นมนุษย์ด้วยครับ");
		theForm.security.focus();
		return(false);
	}
	return(true);
}
