﻿/* Check value is empty
	if obj's value is null return true 
	else return false
*/
function CheckNull(obj){			
    strValue=eval(obj).value;
    if (strValue == "") {
		this.value = '';
		this.focus();
		return true;
    }
    else {
      Status = 0;
      for (i = 0; i < strValue.length; i++) {
        if (strValue.charAt(i) != " ") {
           Status = 1;
           break;                      
        }
      }         
      if (Status == 0) {          
	      return true;
      }
      else {
		this.value = '';
		this.focus();      
		return false;
      }
    }
}

function ValidData(){
	if (CheckNull(document.forms[0].txtMailFrom)){
		alert('Bạn chưa nhập đủ thông tin');
		document.forms[0].txtMailFrom.focus();
		return false;
	}	
	if (CheckNull(document.forms[0].txtContact)){
		alert('Bạn chưa nhập đủ thông tin');
		document.forms[0].txtContact.focus();
		return false;
	}		
	return true;
}