function regform_onsubmit() 
{
if(checkspace(document.regform.name.value)) {
	document.regform.name.focus();
    alert("Please enter name!");
	return false;
   }
  
else if(checkspace(document.regform.content.value)) {
	document.regform.content.focus();
    alert("Please enter message!");
	return false;
   }

else if(checkspace(document.regform.yz.value)) {
	document.regform.yz.focus();
    alert("Please enter verify code!");
	return false;
   }


else if(checkspace(document.regform.content.value) || document.regform.content.value.length < 2) {
	document.regform.content.focus();
    alert("message at least 2 words!");
	return false;
  }

else if(document.regform.email.value.length!=0)
  {
    if (document.regform.email.value.charAt(0)=="." ||        
         document.regform.email.value.charAt(0)=="@"||       
         document.regform.email.value.indexOf('@', 0) == -1 || 
         document.regform.email.value.indexOf('.', 0) == -1 || 
         document.regform.email.value.lastIndexOf("@")==document.regform.email.value.length-1 || 
         document.regform.email.value.lastIndexOf(".")==document.regform.email.value.length-1)
     {
      alert("Please enter correct email!");
      document.regform.email.focus();
      return false;
      }
   }
 else
  {
   alert("Please enter email!");
   document.regform.email.focus();
   return false;
   }	 	 
}

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