	function checkForm(){

		var f = document.frmContact;
		if (f.contact_name.value == ""){
			alert("Vui lòng điền họ tên!");
			f.contact_name.focus();
			return false;
		}
		
		if (f.contact_address.value == ""){
			alert("vui lòng điền địa chỉ liên hệ!");
			f.contact_address.focus();
			return false;
		}
		
		if (f.contact_email.value == ""){
			alert("Vui lòng nhập địa chỉ thư điện tử!");
			f.contact_email.focus();
			return false;
		}else {
			if (!emailCheck(f.contact_email.value)){
				f.contact_email.focus();
				return false;
			}
		}
	
		if (f.contact_detail.value == ""){
			alert("Vui lòng nhập nội dung liên hệ!");
			f.contact_detail.focus();
			return false;
		}
	
		alert("Thông tin yêu cầu từ quý khách đã được gửi tới chúng tôi. Chúng tôi sẽ liên lạc với quý khách trong thời gian sớm nhất. Xin trân trọng cảm ơn!");
	
		return true;
	}
	function numeralsOnly(evt,msg) {
		evt = (evt) ? evt : event;
		var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
		if (charCode > 31 && (charCode < 48 || charCode > 57)) {
			alert(msg);
			return false;
		}
		return true;
	}
	
	function emailCheck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){		
			alert("Nhập sai định dạng E-mail")
			return false
		}
	
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		
			alert("Nhập sai định dạng E-mail")
			return false
		}
	
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			alert("Nhập sai định dạng E-mail");
			return false
		}
		
		if (str.indexOf(at,(lat+1))!=-1){
			alert("Nhập sai định dạng E-mail");
			return false
		}

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			alert("Nhập sai định dạng E-mail");
			return false
		}
		
		if (str.indexOf(dot,(lat+2))==-1){
			alert("Nhập sai định dạng E-mail");
			return false
		}

		if (str.indexOf(" ")!=-1){
			alert("Nhập sai định dạng E-mail");
			return false
		}
		return true
	}
