function call_sendemail(theForm)
{
  var checkemail = true;
  if(theForm.posEmail.value.length!=0)
  {
    if (theForm.posEmail.value.charAt(0)=="." ||        
         theForm.posEmail.value.charAt(0)=="@"||       
         theForm.posEmail.value.indexOf('@', 0) == -1 || 
         theForm.posEmail.value.indexOf('.', 0) == -1 || 
         theForm.posEmail.value.lastIndexOf("@")==theForm.posEmail.value.length-1 || 
         theForm.posEmail.value.lastIndexOf(".")==theForm.posEmail.value.length-1)
     {
      alert("Email address is incorrect ");
      theForm.posEmail.focus();
      checkemail = false;
      }
      
   } 
   else
  {
   alert("Email address is incorrect ");
   theForm.posEmail.focus();
   checkemail = false;
   }
   if(checkspace(theForm.posText.value)&&checkemail) {
	theForm.posText.focus();
        alert("Please input message");
	checkemail = false;
  }
   if(checkemail){
   	return true;
   }
   else{
   	return false;
   }
}

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
