function CheckForm()
{
 if ((document.myform.subject.value=="") || (document.myform.subject.value.length<5)|| (document.myform.subject.value.length>120))
  {
    alert("Your message's Subject must be between 5~120 characters.");
	document.myform.subject.focus();
	return false;
  }
  

 
  
  
   if ((document.myform.name.value=="") || (document.myform.name.value.length<2)|| (document.myform.name.value.length>30))
  {
    alert("Your Name must be between 2~30 characters.");
	document.myform.name.focus();
	return false;
  }
  
   if ((document.myform.email.value=="") || (document.myform.email.value.length<5)|| (document.myform.email.value.length>100))
  {
    alert("Your Email must be between 5~100 characters.");
	document.myform.email.focus();
	return false;
  }

	if (isEmail(document.myform.email.value)){
 	
  }else{
   alert("Please specify a valid email address.");
	 return false;
  
  }
  
 
     
   if  ((document.myform.tel1.value==""))
  {
    alert("Country code incorrect.");
	document.myform.tel1.focus();
	return false;
  }

       
  if  ((document.myform.tel2.value==""))
  {
    alert("Area Code incorrect.");
	document.myform.tel2.focus();
	return false;
  }
  
  
  if((document.myform.tel3.value==""))
  {
    alert("Number  incorrect.");
	document.myform.tel3.focus();
	return false;
  }
  
   if ((document.myform.content.value=="") || (document.myform.content.value.length<20)|| (document.myform.content.value.length>3000))
  {
    alert("Your Message must be between 20~3000 characters.");
	document.myform.content.focus();
	return false;
  }
  
      
  if((document.myform.CheckCode.value==""))
  {
    alert("Enter the characters you see in the image.");
	document.myform.CheckCode.focus();
	return false;
  }
  esave.style.visibility="visible";
}


function isEmail(strEmail) {
    if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
       return true;
    else
        
		return false;
}


function JHshNumberText()

{
if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) 

|| (window.event.keyCode == 13) || (window.event.keyCode == 46) 

|| (window.event.keyCode == 45)))

{

   window.event.keyCode = 0 ;

}

return ;

}

