function confirmQ(req){
	if (confirm(req)==true){return true;}
	else{return false;}
}
function recieve_value(page, field, result){
  	DIM1 = (document.getElementById(field).value)
	//setTimeout("document.form1.submit()",5000);
	doajax(page+DIM1,result)
}
function ccss(OID1, OCNAME1){
	var nodeObj1 = document.getElementById(OID1);
	nodeObj1.className = OCNAME1;
} 
function numberkey(evt){
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	return false;
	return true;
}
function AddSmileyIcon(iconCode){
	document.tment.detail.value += iconCode;
	document.tment.detail.focus();
}
function checkF(xvalue){
	if (xvalue==1){
		chk_cartype = document.getElementById('cartype').value;
		chk_brand = document.getElementById('brand').value;
		chk_province = document.getElementById('province').value;

		if (chk_cartype.length <= 0 || chk_brand.length <= 0 || chk_province.length <= 0){
			alert("อาจเป็นไปได้ว่าคุณยังกรอกข้อมูลไม่ครบ");
			return false;
		}
		else{
			document.fms.submit();
			return true;
		}
	}
	else if (xvalue==2){
		chk_head = document.getElementById('head').value;
		chk_price = document.getElementById('price').value;
		chk_name = document.getElementById('name').value;
		chk_tel = document.getElementById('tel').value;

		if (chk_head.length <= 0 || chk_name.length <= 0 || chk_tel.length <= 0){
			alert("อาจเป็นไปได้ว่าคุณยังกรอกข้อมูลไม่ครบ");
			return false;
		}
		else{
			document.fms.submit();
			return true;
		}
	}
}
function checkR(xvalue){ // Check Register
		chk_user = document.getElementById('user').value;
		chk_password = document.getElementById('password').value;
		chk_repassword = document.getElementById('repassword').value;
		chk_email = document.getElementById('email').value;

		if (chk_user.length <= 0 || chk_password.length <= 0 || chk_repassword.length <= 0 || chk_email.length <= 0){
			alert("อาจเป็นไปได้ว่าคุณยังกรอกข้อมูลไม่ครบ");
			return false;
		}
		else if (chk_password != chk_repassword){
			alert("ยืนยันรหัสผ่านไม่ถูกต้อง");
			return false;
		}
		else{
			document.fms.submit();
			return true;
		}
}