function isName(obj)
{
    string = obj.value;

 	if(string != "" && string.length > 1)
 	{	  
	  		 var name = /^[a-zA-Z]{1,}([-'\W])?([a-zA-Z]{2,})?$/;
	  	  	 //   ^				   	  	 	 means the start of the string
	  
	  	     //   [a-zA-Z]{1,}		   		 means at least 1 letter (upper or lower case)
	  
	   	   	 //   [-'\W+]?		   		 	 means none or only one of the characters -' or whitespace
	  
	  	   	 //   ([a-zA-Z]{2,}){2,}?	 	 means that if there is anything after the
	  	     //	  						 	 punctuation it must be either two or more letters
	  
	  		 //   $							 means the end of the string
			 
	  		  if(string.search(name) != -1)
	  		  {
				    return true;
			  }
	   		  else
	  	  	  {
			  		alert("Name entered contains invalid characters.");
			  		obj.select();
			  		return false;
			  }
    }
	else if(string.length == 1)
	{
	 		  alert("Please enter a valid name.");
			  obj.select();
			  return false;
	}
	else return false;
}

function isOneWord(obj)
{
 	var string = obj.value 
 
    if(string != "")
	{
 		 var letters = /^[a-zA-Z]{2,}$/;
		 
		 if (string.search(letters) != -1)
		 {
				return true;
		 }
		 else
		 {
		  	 	alert("Value entered contains invalid characters.\n");
				obj.select;
				return false;
		 }
	}
	else {return false;}
}

