function combobox_get_data(ob_id,ag_id,typeview,file){
	//alert(ag_id);
	if (ag_id == '') {
		
		
	}
	else {
	
		$.ajax({
			type: "POST",
			url: file,
			data: "type=" + typeview + "&id=" + ag_id,
			success: function(msg){
			
				document.getElementById(ob_id).innerHTML = msg;
				
				
			}
		});
	}
	
} 


function isBlank(myObj) {  if(myObj.value=='' || myObj.value=='- Date -' || myObj.value=='- Month -' || myObj.value=='- Year -' || myObj.value=='Select') { return true; } return false; }
function isEmail(str) {
var supported = 0;
if (window.RegExp) {
	var tempStr = "a";
	var tempReg = new RegExp(tempStr);
	if (tempReg.test(tempStr)) supported = 1;
}
if (!supported) 
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
return (!r1.test(str) && r2.test(str));
}
function verifycontact() {
	with(document.frmcontact) {
		
		
		if(isBlank(Fullname)) {	alert("Please Insert Fullname"); Fullname.focus(); return false; }
		if(isBlank(Email)) {	alert("Please Insert Email"); Email.focus(); return false; }
		if(isEmail(Email)) {	alert("Please Insert Email Format"); Email.focus(); return false; }
		//if(isBlank(country)) {	alert("Please Insert Country"); country.focus(); return false; }	
		//if(isBlank(Phone)) {	alert("Please Insert Phone"); Phone.focus(); return false; }	
		if(isBlank(captchacode)) {	alert("Please Insert Verifly Image"); captchacode.focus(); return false; }	
	
		
		//if(isBlank(txtMail)) {	alert("กรุณาพิมพ์ e-mail"); txtMail.focus(); return false; }
		//if(!isBlank(txtMail)) { if(!isEmail(txtMail.value)) {	alert("รูปแบบของ e-mail ไม่ถูกต้องค่ะ !!"); txtMail.focus(); return false; } }
		}
	return true;
}

function verifybus() {
	with(document.frmbussiness){
		
		
		if(isBlank(Fullname)) {	alert("Please Insert Fullname"); Fullname.focus(); return false; }
		if(isBlank(Comname)) {	alert("Please Insert Company Name"); Comname.focus(); return false; }
		if(isBlank(Address)) {	alert("Please Insert Address"); address.focus(); return false; }
		if(isBlank(Email)) {	alert("Please Insert Email"); Email.focus(); return false; }
		if(isEmail(Email)) {	alert("Please Insert Email Format"); Email.focus(); return false; }
		//if(isBlank(country)) {	alert("Please Insert Country"); country.focus(); return false; }	
		//if(isBlank(Phone)) {	alert("Please Insert Phone"); Phone.focus(); return false; }	
		if(isBlank(captchacode)) {	alert("Please Insert Verifly Image"); captchacode.focus(); return false; }	
	
		
		//if(isBlank(txtMail)) {	alert("กรุณาพิมพ์ e-mail"); txtMail.focus(); return false; }
		//if(!isBlank(txtMail)) { if(!isEmail(txtMail.value)) {	alert("รูปแบบของ e-mail ไม่ถูกต้องค่ะ !!"); txtMail.focus(); return false; } }
		}
	return true;
}
function verifyvan() {
	with(document.frmbussiness){
		
		
		if(isBlank(Fullname)) {	alert("Please Insert Fullname"); Fullname.focus(); return false; }
		if(isBlank(Email)) {	alert("Please Insert Email"); Email.focus(); return false; }
		if(isEmail(Email)) {	alert("Please Insert Email Format"); Email.focus(); return false; }
		//if(isBlank(country)) {	alert("Please Insert Country"); country.focus(); return false; }	
		//if(isBlank(Phone)) {	alert("Please Insert Phone"); Phone.focus(); return false; }	
		if(isBlank(captchacode)) {	alert("Please Insert Verifly Image"); captchacode.focus(); return false; }	
	
		
		//if(isBlank(txtMail)) {	alert("กรุณาพิมพ์ e-mail"); txtMail.focus(); return false; }
		//if(!isBlank(txtMail)) { if(!isEmail(txtMail.value)) {	alert("รูปแบบของ e-mail ไม่ถูกต้องค่ะ !!"); txtMail.focus(); return false; } }
		}
	return true;
}

function verifybookall() {
	with(document.frmbussiness){
		
		
		if(isBlank(Fullname)) {	alert("Please Insert Fullname"); Fullname.focus(); return false; }
		if(isBlank(date)) {	alert("Please Insert Pick Up"); date.focus(); return false; }
		if(isBlank(date1)) {	alert("Please Insert return date"); date1.focus(); return false; }
		if(isBlank(Email)) {	alert("Please Insert Email"); Email.focus(); return false; }
		if(isEmail(Email)) {	alert("Please Insert Email Format"); Email.focus(); return false; }
		//if(isBlank(country)) {	alert("Please Insert Country"); country.focus(); return false; }	
		//if(isBlank(Phone)) {	alert("Please Insert Phone"); Phone.focus(); return false; }	
		if(isBlank(captchacode)) {	alert("Please Insert Verifly Image"); captchacode.focus(); return false; }	
	
		
		//if(isBlank(txtMail)) {	alert("กรุณาพิมพ์ e-mail"); txtMail.focus(); return false; }
		//if(!isBlank(txtMail)) { if(!isEmail(txtMail.value)) {	alert("รูปแบบของ e-mail ไม่ถูกต้องค่ะ !!"); txtMail.focus(); return false; } }
		}
	return true;
}
