var testresults

function fcheck_email(){

 var str=document.frmEmail.txt_email.value
 var filter=/^.+@.+\..{2,3}$/
 if (document.frmEmail.txt_email.value == ""){
 	alert("Bạn chưa nhập Email!")
    document.frmEmail.txt_email.focus();
    testresults=false
 }else{
	 if (filter.test(str))
		testresults=true
	 else {
		alert("Email không hợp lệ!")
		document.frmEmail.txt_email.focus();
		testresults=false
	 }
 }
 return (testresults)
}

function fcheck_email_address(){
  
  if(fcheck_email()==false)
  	return 0;
  else document.frmEmail.submit();
  
}


function fcheck_email_lang(){

 var str=document.frmEmail.txt_email.value
 var filter=/^.+@.+\..{2,3}$/
 if (document.frmEmail.txt_email.value == ""){
 	alert("Input your Email address, please!")
    document.frmEmail.txt_email.focus();
    testresults=false
 }else{
	 if (filter.test(str))
		testresults=true
	 else {
		alert("Invalid Email!")
		document.frmEmail.txt_email.focus();
		testresults=false
	 }
 }
 return (testresults)
}


function fcheck_email_address_lang(){
  
  if(fcheck_email_lang()==false)
  	return 0;
  else document.frmEmail.submit();
  
}


function fcheck_key_search(){
  if (document.frmSearch.txt_key_search.value == "Product Name..."){
	alert("Bạn phải nhập giá trị tìm kiếm");
    document.frmSearch.txt_key_search.focus();
	return false;
  }
  else document.frmSearch.submit();
}
