function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function verifySubmit() {
	with(document.myBoardForm) {
		if(isBlank(inputName)) { alert('กรุณากรอกชื่อ'); inputName.focus(); return false; }
		if(!isBlank(inputEmail)) {
			if(!isEmail(inputEmail.value)) { alert('กรอกอีเมล์ผิด'); inputEmail.focus(); return false; }
		}
		if(isBlank(inputMessage)) { alert('กรุณากรอกข้อความ'); inputMessage.focus(); return false; }
		
		var thisMessage = inputMessage.value.toLowerCase();
		var blockWord = document.getElementById('blockWord').value;
		var blockWordArr = new Array();
		blockWordArr = blockWord.split(",");
		var i = 0;
		var found = false;
		while (i<(blockWordArr.length-1)) {
			if (thisMessage.lastIndexOf(blockWordArr[i])>=0) found = true;
			i++;
		}
		if (found) {
			myip = document.getElementById('ip').value;
			alert('ระบบไม่อนุญาตให้ท่านลงโฆษณาในเว็บนี้\nถ้ายังฝ่าฝืน ระบบจะทำการ block ip ของท่านไว้\nip ของท่านคือ '+myip);
			inputMessage.focus();
			return false;
		}
	}
	document.getElementById('CommentAction').value='ab15e3da3927f2be6a255cf43464581f';
	
	if(document.getElementById('CommentAction').value=='ab15e3da3927f2be6a255cf43464581f')	
		return true;
	else
		return false;
}
function checkFile(val){
//myfile = this.value;
myfile = val;
if(myfile!='') {
	myfile = myfile.toLowerCase();
	Temp = myfile.charAt(myfile.length-4) + myfile.charAt(myfile.length-3) + myfile.charAt(myfile.length-2) + myfile.charAt(myfile.length-1);
	if(Temp=='.jpg' || Temp=='.gif' || Temp=='jpeg') {
		document.getElementById('trPicture').style.display='';
		document.getElementById('PreviewImage').src=myfile;
	} else {
		document.getElementById('trPicture').style.display='none';
		alert('อนุญาตให้แนบไฟล์รูปภาพได้เท่านั้น');
		this.focus();
	}
}
}
function ShowDataPicker(myDivName,RefX,RefY) {
	document.getElementById(myDivName).style.display=''; 
	document.getElementById(myDivName).style.left = document.body.scrollLeft + window.event.clientX + RefX;
	document.getElementById(myDivName).style.top= document.body.scrollTop+ window.event.clientY + RefY;
}