// JavaScript Document
function checkMe(){


String.prototype.trim   =   function   ()   
{ 
return   this.replace(/(^[\s]*)|([\s]*$)/g,""); 
}; 


var name=document.guestbook.userName.value.trim(); 

	if (name.length==0)
	{
		alert("请输入您的姓名。");
		document.guestbook.userName.focus();
		return false;
	}


var emai=document.guestbook.email.value	
var re = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/g);
	if (!re.test(emai))
	{
		alert("请正确输入您的 email 地址！");
		document.guestbook.email.focus();
		return false;
	}





var   str=document.guestbook.title.value.trim(); 
if(str.length==0) 
	{
		alert("请输入留言主题。");
		document.guestbook.title.focus();
		return false;
	}
	
	
	//	function   pTrim(m){   
 // while((m.length>0)&&(m.charAt(0)==' '))   
 // m   =   m.substring(1, m.length);   
 // while((m.length>0)&&(m.charAt(x.length-1)==' '))   
//  m = m.substring(0, m.length-1);   
//  return m;   
//  } 

var	content=document.guestbook.content.value.trim(); 
	if (content.length==0)
	{
		alert("请输入留言内容。");
		document.guestbook.content.focus();
		return false;
	}
	




}


