function check_form() {    
    var error_message, error_msg1, error_msg2, error_msg3, error_msg4 = "";
    if ((document.advanced_search.lang.value == '') || (document.advanced_search.lang.value == 'V'))
    {
        error_message = "Có lỗi xuất hiện trong quá trình xử lý trên mẫu tìm kiếm.\n\nHãy làm theo chỉ dẫn đúng ở dưới:\n\n";
        error_msg1 = "* Hãy nhập thông tin từ khóa cần tìm kiếm.\n";
        error_msg2 = "* Bạn phải nhập vào số cho trường: Giá từ.\n";
        error_msg3 = "* Bạn phải nhập vào số cho trường: Tới giá.\n";
        error_msg4 = "* Giá trị của trường: Tới Giá phải lớn hơn hoặc bằng giá trị Giá từ.\n";
    }
    else if(document.advanced_search.lang.value == 'E')
    {
        error_message = "Have error!\n\nFollow the instructions right below:\n\n";
        error_msg1 = "* Please enter search keyword.\n";
        error_msg2 = "* You must enter values for field: Min price.\n";
        error_msg3 = "* You must enter values for field: Max price.\n";
        error_msg4 = "* Valute of field: Max price must more than or equal value of field Min price.\n";
    }
    
  var error_found = false;
  var error_field;
  var keywords = document.advanced_search.keywords.value;
//  var dfrom = document.advanced_search.dfrom.value;
//  var dto = document.advanced_search.dto.value;
  var pfrom = document.advanced_search.pfrom.value;
  var pto = document.advanced_search.pto.value;
  var pfrom_float;
  var pto_float;
	if(((keywords == '') || (keywords.length < 1)) && ((pfrom == '') || (pfrom.length < 1)) && ((pto == '') || (pto.length < 1)))
	 {
		 error_message = error_message + error_msg1;
    	error_field = document.advanced_search.keywords;
    	error_found = true;
	 }
/*	if ( ((keywords == '') || (keywords.length < 1)) && ((pfrom == '') || (pfrom.length < 1)) && ((pto == '') || (pto.length < 1)) ) {
    error_message = error_message + "* Hãy nhập thông tin cần tìm kiếm.\n";
    error_field = document.advanced_search.keywords;
    error_found = true;
  }*/

  /*if ((dfrom.length > 0) && (dfrom != 'mm/dd/yyyy')) {
    if (!IsValidDate(dfrom, 'mm/dd/yyyy')) {
      error_message = error_message + "* Invalid From Date.\n";
      error_field = document.advanced_search.dfrom;
      error_found = true;
    }
  }

  if ((dto.length > 0) && (dto != 'mm/dd/yyyy')) {
    if (!IsValidDate(dto, 'mm/dd/yyyy')) {
      error_message = error_message + "* Invalid To Date.\n";
      error_field = document.advanced_search.dto;
      error_found = true;
    }
  }

  if ((dfrom.length > 0) && (dfrom != 'mm/dd/yyyy') && (IsValidDate(dfrom, 'mm/dd/yyyy')) && (dto.length > 0) && (dto != 'mm/dd/yyyy') && (IsValidDate(dto, 'mm/dd/yyyy'))) {
    if (!CheckDateRange(document.advanced_search.dfrom, document.advanced_search.dto)) {
      error_message = error_message + "* To Date must be greater than or equal to From Date.\n";
      error_field = document.advanced_search.dto;
      error_found = true;
    }
  }*/

  if (pfrom.length > 0) {
    pfrom_float = parseFloat(pfrom);
    if (isNaN(pfrom_float)) {
      error_message = error_message + error_msg2;
      error_field = document.advanced_search.pfrom;
      error_found = true;
    }
  } else {
    pfrom_float = 0;
  }

  if (pto.length > 0) {
    pto_float = parseFloat(pto);
    if (isNaN(pto_float)) {
      error_message = error_message + error_msg3;
      error_field = document.advanced_search.pto;
      error_found = true;
    }
  } else {
    pto_float = 0;
  }

  if ( (pfrom.length > 0) && (pto.length > 0) ) {
    if ( (!isNaN(pfrom_float)) && (!isNaN(pto_float)) && (pto_float < pfrom_float) ) {
      error_message = error_message + error_msg4;
      error_field = document.advanced_search.pto;
      error_found = true;
    }
  }

  if (error_found == true) {
    alert(error_message);
    error_field.focus();
    return false;
  } /*else {
    RemoveFormatString(document.advanced_search.dfrom, "mm/dd/yyyy");
    RemoveFormatString(document.advanced_search.dto, "mm/dd/yyyy");
    return true;
  }*/
}