function validate() {
  	var box = document.form1.name;
    var new_value = trimAll(box.value);
	box.value = new_value; 	
		if(  (box.value=="") || (box.value==null) || (box.value=='\r') || (box.value.length < 2) )	
	 	{
		  alert("Please Enter Your Name. Minimum 2 characters please.");
		  box.value = "";
		  box.focus();
		  indicator = 0;
		  return false;
		}
	
	////////////////////////////////////////////////////////////////
	var box = document.form1.email;
	var new_value = trimAll(box.value);
	box.value = new_value;
	var string = box.value;
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {/* nothing */}
	else {
		alert("Please Enter A valid Email Address.");
		box.value = "";
		box.focus();
		return false;
	}	
  ///////////////////////////////////////////////////////////////////
  ////////////////////////////////////////////////////////////////
	var box = document.form1.comments;
	var new_value = trimAll(box.value);
	box.value = new_value;
	var string = box.value;
	if(  (box.value=="") || (box.value==null) || (box.value=='\r') || (box.value.length < 20) )	
	 	{
		  alert("Please Enter Some Comments. At least 20 characters please.");
		  box.value = "";
		  box.focus();
		  indicator = 0;
		  return false;
		}
  ///////////////////////////////////////////////////////////////////
  
    
  }
  function trimAll( strValue ) {
/************************************************
DESCRIPTION: Removes leading and trailing spaces.

PARAMETERS: Source string from which spaces will
  be removed;

RETURNS: Source string with whitespaces removed.
*************************************************/
 var objRegExp = /^(\s*)$/;

    //check for all spaces
    if(objRegExp.test(strValue)) {
       strValue = strValue.replace(objRegExp, '');
       if( strValue.length == 0)
          return strValue;
    }

   //check for leading & trailing spaces
   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
   if(objRegExp.test(strValue)) {
       //remove leading and trailing whitespace characters
       strValue = strValue.replace(objRegExp, '$2');
    }
  return strValue;
}
//////////////////////////////////