// JavaScript DocumentString.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };function validateForm(theForm){		try {				var message = '';		var bError = false;		var index = 0;		//alert(theForm.memberSelect.selectedIndex);		if(theForm.memberSelect.selectedIndex == 0){			message +="Please select member.\n";			bError =  true;			theForm.memberSelect.focus();			index = 3;		}						if ( theForm.name.value.trim() == '' ) {			message +="Please enter your name.\n";			bError =  true;			theForm.name.focus(); 			index = 1;			} 				if(theForm.email.value.trim() ==''){						message +="Please enter an email address.\n";			bError = true;			if(index==0){				index=2;			} else if(index==1){				//index=2;				theForm.name.focus();			} else {				index=2;				theForm.email.focus();			}					}		else{					var str=theForm.email.value.trim();			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i			if (!filter.test(str)){				message +="Please enter a valid email address.\n";				bError = true;				if(index==0){					index=2;				} else if(index==1){					//index=2;					theForm.name.focus();				} else {					index=2;					theForm.email.focus(); 				}							}		}				if ( theForm.msg.value.trim() == '' ) {			message +="Please enter your message.\n";			bError =  true;			if(index==1){				theForm.name.focus();			} else if(index==2){				theForm.email.focus();			} else {				theForm.msg.focus();			}				}				if(bError){			alert(message);			return false;		} else {			return true;		}	} catch (e) {		alert(e.message);		return false;	}		}// end function