<!--	
	// config
	function chkblankconfig(tf) {
		if (tf.txtsitename.value == "") {
			alert('ใส่ชื่อเว็บไซต์ด้วย');
			tf.txtsitename.focus();
			return false;
		}
		if (tf.txtsitetitle.value == "") {
			alert('ใส่ข้อความที่ต้องการให้ปรากฎที่ไตเติ้ลบาร์ด้วย');
			tf.txtsitetitle.focus();
			return false;
		}
		if (tf.txtsitedesc.value == "") {
			alert('ใส่คำอธิบายเกี่ยวกับเว็บไซต์ด้วย');
			tf.txtsitedesc.focus();
			return false;
		}
		if (tf.txtsitekeyword.value == "") {
			alert('ใส่คำค้นด้วย');
			tf.txtsitekeyword.focus();
			return false;
		}		
		if (tf.txtmailadmin.value == "") {
			alert('ใส่เมล์ที่ใช้ในระบบด้วย เช่น info@yourweb.com');
			tf.txtmailadmin.focus();
			return false;
		}
	}	
	function chkblanksitemember(tf) {
		if (tf.txtusername.value == "") {
			alert('กรุณาป้อนชื่อล็อกอินด้วย');
			tf.txtusername.focus();
			return false;
		}
		if (tf.txtemail.value == "") {
			alert('กรุณาป้อน email ของคุณด้วย');
			tf.txtemail.focus();
			return false;
		}
		if (tf.txtemail.value!="") {
			if (tf.txtemail.value.indexOf("@")==-1 || tf.txtemail.value.indexOf(".")==-1 || tf.txtemail.value.indexOf(" ")!=-1 || tf.txtemail.value.length<6) 	{
				alert('รูปแบบอีเมล์ไม่ถูกต้อง');
				tf.txtemail.focus();return false
			} 
		}
		if (tf.txtsitename.value == "") {
			alert('กรุณาป้อนชื่อเว็บไซต์ด้วย');
			tf.txtsitename.focus();
			return false;
		}		
		if (tf.txtsiteurl.value == "") {
			alert('กรุณาป้อน url ของเว็บไซต์ของคุณด้วย');
			tf.txtsiteurl.focus();
			return false;
		}		
	}
	function chkblanklinkcode(tf) {
		if (tf.scontent.value == "") {
			alert('กรุณาป้อนรายละเอียด Link Code ด้วย');
			tf.scontent.focus();
			return false;
		}
	}
	function chkblanksltype(tf) {
		if (tf.sltype.value == "") {
			alert('กรุณาเลือกรูปแบบดวงที่คุณต้องการด้วย');
			tf.sltype.focus();
			return false;
		}
	}
	function chkforetuneteller(tf) {
		if (tf.slforetuneteller.value == "") {
			alert('โปรดเลือกผู้ทำนายด้วย');
			tf.slforetuneteller.focus();
			return false;
		}
	}
	function chkblankmember(tf) {
		if (tf.txtname.value == "") {
			alert('ป้อนชื่อของผู้ทำนายด้วย');
			tf.txtname.focus();
			return false;
		}
		if (tf.txtsurname.value == "") {
			alert('ป้อนนามสกุลของผู้ทำนายด้วย');
			tf.txtsurname.focus();
			return false;
		}
		if (tf.txtemail.value == "") {
			alert('ป้อน email ของทำนายด้วย');
			tf.txtemail.focus();
			return false;
		}
		if (tf.txtemail.value!="") {
			if (tf.txtemail.value.indexOf("@")==-1 || tf.txtemail.value.indexOf(".")==-1 || tf.txtemail.value.indexOf(" ")!=-1 || tf.txtemail.value.length<6) 	{
				alert('รูปแบบอีเมล์ไม่ถูกต้อง');
				tf.txtemail.focus();return false
			} 
		}
		if (tf.txttel.value == "") {
			alert('ป้อนหมายเลขโทรศัพท์ของผู้ทำนายด้วย');
			tf.txttel.focus();
			return false;
		}
		if (tf.txtaddr.value == "") {
			alert('ป้อนที่อยู่ของผู้ทำนายด้วย');
			tf.txtaddr.focus();
			return false;
		}
		if (tf.txtaumpher.value == "") {
			alert('ป้อนชื่ออำเภอด้วย');
			tf.txtaumpher.focus();
			return false;
		}		
		if (tf.txtprovince.value == "") {
			alert('ป้อนชื่อจังหวัดด้วย');
			tf.txtprovince.focus();
			return false;
		}
		if (tf.txtzip.value == "") {
			alert('ป้อนรหัสไปรษณีย์ด้วย');
			tf.txtzip.focus();
			return false;
		}
		if (tf.txtusername.value == "") {
			alert('กำหนดชื่อในการล็อกอินด้วย');
			tf.txtusername.focus();
			return false;
		}
		if (tf.txtpassword.value == "") {
			alert('กำหนดรหัสผ่านให้กับผู้ทำนายด้วย');
			tf.txtpassword.focus();
			return false;
		}		
}
	function chkblankgroup(tf) {
		if (tf.txtgrouptitle.value == "") {
			alert('ป้อนชื่อหมวดหมู่ด้วย');
			tf.txtgrouptitle.focus();
			return false;		
		}	
		if (tf.txtforecast.value == "") {
			alert('ป้อนช่วงวันที่พยากรณ์ด้วย');
			tf.txtforecast.focus();
			return false;
		}
	}
	function chkblankzodiac(tf) {
		if (tf.txtzodiactitle.value == "") {
			alert('ป้อนชื่อราศีด้วย');
			tf.txtzodiactitle.focus();
			return false;		
		}	
		if (tf.txtzodiacetitle.value == "") {
			alert('ป้อนชื่อราศีภาษาอังกฤษด้วย');
			tf.txtzodiacetitle.focus();
			return false;		
		}	
		if (tf.txtperiod.value == "") {
			alert('ป้อนช่วงเวลาด้วย');
			tf.txtperiod.focus();
			return false;		
		}	
	}
	function chkblanklogin(tf) {
		if (tf.loginname.value == "") {
			alert('ใส่ชื่อล็อกอินของคุณด้วย');
			tf.loginname.focus();
			return false;
		}
		if (tf.pwd.value == "") {
			alert('ใส่รหัสผ่านของคุณด้วย');
			tf.pwd.focus();
			return false;
		}
	}
	
function conf(obj)
	{
		if (confirm('คลิก OK ถ้าคุณต้องการลบชื่อหมวดหมู่นี้แบบถาวร\nคลิก Cancel ถ้าคุณต้องการยกเลิกการลบ') == true) {
			return true;
		}
		return false;
	}
	function confisvip(obj)
	{
		if (confirm('คลิก OK ถ้าต้องการเปลี่ยนสิทธิพิเศษ\nคลิก Cancel ถ้าคุณต้องการยกเลิกการเปลี่ยนสิทธิพิเศษ') == true) {
			return true;
		}
		return false;
	}
function confdelpict(obj)
	{
		if (confirm('คลิก OK ถ้าต้องการลบรูปภาพนี้\nคลิก Cancel ถ้าคุณต้องการยกเลิกการลบ') == true) {
			return true;
		}
		return false;
	}
	function conf2(obj)
	{
		if (confirm('คลิก OK ถ้าคุณต้องการลบข้อมูลนี้\nคลิก Cancel ถ้าคุณต้องการยกเลิกการลบ') == true) {
			return true;
		}
		return false;
	}
	function chkvalid(tf)
	{
		if (tf.title.value == "") {
			alert('ใส่ชื่อหมวดหมู่ด้วยครับ');
			return false;
		}
		if (tf.description.value == "") {
			alert('ใส่คำอธิบายสั้นๆ เกี่ยวกับหมวดหมู่นี้ด้วยครับ');
			return false;
		}
	}

	function chknum(tf)
	{
		if (tf.mlevel.value < 1) {			
			alert('Level ของสมาชิกต้องอยู่ระหว่าง 0 - 3 เท่านั้นครับ')
			return false;
		}
		if (tf.mlevel.value > 3) {			
			alert('Level ของสมาชิกต้องอยู่ระหว่าง 0 - 3 เท่านั้นครับ')
			return false;
		}
	}
	function chkadmdata(tf)
	{
		if (tf.usrname.value == "") {
			alert('ใส่ชื่อผู้ใช้ด้วยครับ');
			tf.usrname.focus();
			return false;
		}
		if (tf.pwd.value == "") {
			alert('ใส่รหัสผ่านสำหรับ admin ด้วยครับ');
			tf.pwd.focus();
			return false;
		}
		if (tf.confpwd.value != tf.pwd.value) {
			alert('ยืนยันรหัสผ่านให้ถูกต้องด้วยครับ');
			tf.confpwd.focus();
			return false;
		}
	}
	function chkipform(tf) {	
		if (tf.ip.value == "") {
			alert('ใส่หมายเลขไอพีที่ต้องการแบนด้วย');
			tf.ip.focus();
			return false;
		}
		if (tf.opr.value=="") {
			alert('เลือกการปฏิบัติการด้วย');
			tf.opr.focus();
			return false;
		}
	}
	
	function keyCheck(eventObj, obj) {
	var keyCode
	if (document.all){ 
		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}
	var str=obj.value
	if(keyCode==46){ 
		if (str.indexOf(".")>0){
			return false
		}
	}
	if((keyCode<48 || keyCode >58)   &&   (keyCode != 46)){ 
		return false
	}
	return true
}
function chkvalidconfig(tf) {
		if (tf.sitename.value == "") {
			alert('กรอกชื่อเว็บไซต์ด้วย');
			return false;
		}
		if (tf.boardname.value == "") {
			alert('กรอกชื่อเว็บบอร์ดด้วย');
			return false;
		}
		if (tf.rule.value == "") {
			alert('กรอกคำชี้แจงในการใช้เว็บบอร์ดด้วย');
			return false;
		}
		if (tf.qpagelen.value == "") {
			alert('กรอกจำนวนหัวข้อกระทู้ที่ต้องการให้แสดงต่อ 1 หน้าด้วย');
			return false;
		}
		if (tf.apagelen.value == "") {
			alert('กรอกจำนวนข้อความคิดเห็นที่ต้องการให้แสดงต่อ 1 หน้าด้วย');
			return false;
		}
		if (tf.mailadmin.value == "") {
			alert('กรอก Email ผู้ดูแลระบบด้วย');
			return false;
		}
	}
	function chkvalidbadword(tf) {
		if (tf.badwords.value == "") {
			alert('กรอกคำที่ต้องการป้องกันในเว็บบอร์ดด้วย');
			return false;
		}
	}
	function chkvalidmember(tf) {
		if (tf.uname.value == "") {
			alert('กรอกชื่อล็อกอินด้วย');
			tf.uname.focus();
			return false;
		}
		if (tf.upasswd.value == "") {
			alert('กรอกรหัสผ่านด้วย');
			tf.upasswd.focus();
			return false;
		}
		if (tf.firstname.value == "") {
			alert('กรอกชื่อสมาชิกด้วย');
			tf.firstname.focus();
			return false;
		}
		if (tf.lastname.value == "") {
			alert('กรอกนามสกุลด้วย');
			tf.lastname.focus();
			return false;
		}
		if (tf.province.value == "") {
			alert('ระบุจังหวัดด้วย');
			tf.province.focus();
			return false;
		}		
		if (isNaN(tf.ulevel.value)) {
			alert('ใส่ได้เฉพาะตัวเลข 1 หรือ 2 เท่านั้น');
			tf.ulevel.focus();
			return false;
		}
		if (tf.ulevel.value >3) {
			alert('ใส่ได้เฉพาะเลข 1- 2 เท่านั้น');
			tf.ulevel.focus();
			return false;
		}
	}

	
// ลืมรหัสผ่าน
function chkforgotform(tf) {
	if (tf.email.value == "") {
		alert('กรอกอีเมล์ของคุณด้วย');
		tf.email.focus();
		return false;
	}
	if (tf.email.value!="") {
		if (tf.email.value.indexOf("@")==-1 || tf.email.value.indexOf(".")==-1 || tf.email.value.indexOf(" ")!=-1 || tf.email.value.length<6) 	{
			alert('รูปแบบอีเมล์ไม่ถูกต้อง');
			tf.email.focus();return false
		} 
	}
}

function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}

//member login
function chkloginform(tf) {
	if (tf.uname.value == "") {
		alert('กรอกชื่อล็อกอินของคุณด้วย');
		tf.uname.focus();
		return false;
	}	
	if (tf.upassword.value == "") {
		alert('กรอกรหัสผ่านของคุณให้ถูกต้องด้วย');
		tf.upassword.focus();
		return false;
	}
}
function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	} 
} 
function mOut(src,clrIn){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	} 
} 
// bookmark
function addBookmark(title,url) {
		if (window.sidebar) {
			window.sidebar.addPanel(title, url,"");
		} else if( document.all ) {
			window.external.AddFavorite( url, title);
		} else if( window.opera && window.print ) {
			return true;
		}
	}

function keyCheck(eventObj, obj)
{
	var keyCode

	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}

	var str=obj.value

	if(keyCode==46){ 
		if (str.indexOf(".")>0){
			return false
		}
	}

	if((keyCode<48 || keyCode >58)   &&   (keyCode != 46)){ 
		return false
	}

	return true
}
function conf(obj)
   {
   	if (confirm('การกระทำนี้ จะเป็นการลบข้อมูลอย่างถาวร\nคลิก OK เพื่อยืนยันการลบข้อมูล') == true) {
   	   return true;
   	}
   	return false;
   }
var cnt=1;
	var oldmsg =" ";
function AddPic(pictname) {
	if (cnt == 1) {
		oldmsg = document.frmpost.comment.value;
		document.frmpost.comment.value += " " + document.frmpost.blob.value + " ";
		document.frmpost.comment.focus();
		cnt +=1;
	}
	else {
		document.frmpost.comment.value = oldmsg;
		document.frmpost.comment.value += " " + document.frmpost.blob.value + " ";
		document.frmpost.comment.focus();
		alert('ใส่รูปภาพได้ครั้งละ 1 รูปเท่านั้น\nถ้าต้องการใส่รูปมากกว่า 1 รูป คลิกที่ปุ่ม images แล้วใส่ url ของรูปภาพแทน ');
	}
}
function AddPic2(pictname) {
	if (cnt == 1) {
		oldmsg = document.frmpost.question.value;
		document.frmpost.question.value += " " + document.frmpost.blob.value + " ";
		document.frmpost.question.focus();
		cnt +=1;
	}
	else {
		document.frmpost.question.value = oldmsg;
		document.frmpost.question.value += " " + document.frmpost.blob.value + " ";
		document.frmpost.question.focus();
		alert('ใส่รูปภาพได้ครั้งละ 1 รูปเท่านั้น\nถ้าต้องการใส่รูปมากกว่า 1 รูป คลิกที่ปุ่ม images แล้วใส่ url ของรูปภาพแทน ');
	}
}
function textCounter(field, countfield, maxlimit) {
		if (field.value.length > maxlimit) // if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
			// otherwise, update 'characters left' counter
		else
			countfield.value = maxlimit - field.value.length;
	}
	function AddTag(code,promptText, InsertText) {
		if (code != "") {
			insertCode = prompt(promptText + "\n[" + code + "]ข้อความ[/" + code + "]", InsertText);
				if ((insertCode != null) && (insertCode != "")){
					document.frmpost.comment.value += " " + "[" + code + "]" + insertCode + "[/"+ code + "]" + " ";
				}
		}
		document.frmpost.comment.focus();
	} 
	function AddTag2(code,promptText, InsertText) {
		if (code != "") {
			insertCode = prompt(promptText + "\n[" + code + "]ข้อความ[/" + code + "]", InsertText);
				if ((insertCode != null) && (insertCode != "")){
					document.frmpost.question.value += " " + "[" + code + "]" + insertCode + "[/"+ code + "]" + " ";
				}
		}
		document.frmpost.question.focus();
	} 
	function AddFontTag(code,promptText, InsertText) {
		if (code != "") {
			insertCode = prompt(promptText + "\n[" + code + "]ข้อความ[/f]", InsertText);
				if ((insertCode != null) && (insertCode != "")){
					document.frmpost.comment.value += "[" + code + "]" + insertCode + "[/" + code +"]" + " ";
				}
		}
		document.frmpost.comment.focus();
	}
	function AddFontTag2(code,promptText, InsertText) {
		if (code != "") {
			insertCode = prompt(promptText + "\n[" + code + "]ข้อความ[/f]", InsertText);
				if ((insertCode != null) && (insertCode != "")) {
					document.frmpost.question.value += "[" + code + "]" + insertCode + "[/" + code +"]" + " ";
				}
		}
		document.frmpost.question.focus();
	}
	function AddIcon(iconCode) {
 		document.frmpost.comment.value += iconCode + " ";
	}
	function AddIcon2(iconCode) {
 		document.frmpost.question.value +=  iconCode + " " ;
	}
	function CngTd(form,act,Title)	{
		if(act=="on")	{
			form.style.backgroundColor='#ffffff';
}	else	{
			form.style.backgroundColor=''
		}
}
function chkkeyword(tf) {
    if (tf.keyword.value == "") {
    		alert('ใส่คำที่ต้องการค้นหาด้วย');
    		return false;
    }
}
	
	function onSubmitForm(tf) {
		if (tf.attach1.value == "" && tf.attach2.value == "" && tf.attach3.value == "" && tf.attach4.value == "" && tf.attach5.value == "" && tf.attach6.value == "" && tf.attach6.value == "" && tf.attach7.value == "" && tf.attach8.value == "" && tf.attach9.value == "" && tf.attach10.value == "") {
			alert('เลือกรูปภาพที่ต้องการเพิ่มด้วย');
			return false;
		}
	}
	function emoicon(symbol)
	{
		frm.txt_detail.value = frm.txt_detail.value + symbol;
		frm.txt_detail.focus();
	}
		
	function addToFavorites(urlAddress,pageName) { 	
	if (window.external) { window.external.AddFavorite(urlAddress,pageName) 
	} else { alert("เสียใจด้วย บราวเซอร์ของคุณไม่รองรับการทำงานของฟังก์ชั่นนี้"); } 
}	
function jumptof(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function chkblanksrchmember(tf) {
	if (tf.srchname.value =="") {
		alert('ใส่ชื่อของสมาชิกที่ต้องการค้นหาด้วย');
		tf.srchname.focus();
		return false;
	}
}
function chkblankmbnewpass(tf) {
	if (tf.fname.value =="") {
		alert('กรอกชื่อด้วย');
		tf.fname.focus();
		return false;
	}
	if (tf.lname.value =="") {
		alert('กรอกนามสกุลด้วย');
		tf.lname.focus();
		return false;
	}
	if (tf.email.value =="") {
		alert('กรอก E-mail ด้วย');
		tf.email.focus();
		return false;
	}
	if (tf.newpasswd.value == "") {
		alert('กรอกรหัสผ่านใหม่ด้วย');
		tf.newpasswd.focus();
		return false;
	}
}

function chkblankmemberlogin(tf) {
	if (tf.txtusername.value == "") {
		alert('ป้อน Username ของคุณด้วย');
		tf.txtusername.focus();
		return false;
	}
	if (tf.txtpassword.value == "") {
		alert('ป้อน Password ของคุณด้วย');
		tf.txtpassword.focus();
		return false;
	}
}
function maskKeyPress(objEvent) 
	{
	  var iKeyCode;  	
	  iKeyCode = objEvent.keyCode;			
	  if(iKeyCode>=48 && iKeyCode<=57) return true;
	  return false;
	}

//-->
