function processForm(){        var theForm = document.getElementById('contactForm');    var bStatus = validateForm(theForm);        if(bStatus)      {              theForm.submit();        if(theForm.formType.value == 'popup')        {            this.close();               }    }        }function validateForm(theForm){    var theForm = document.getElementById('contactForm');        //validate first name    if (theForm.firstname.value == "")	{		alert("Please enter a value for the \"First Name\" field.");		theForm.firstname.focus();		return false;	}		    //validate last name    if (theForm.lastname.value == "")	{		alert("Please enter a value for the \"Last Name\" field.");		theForm.lastname.focus();		return false;	}			//validate email address	if ((theForm.email.value==null)||(theForm.email.value==""))	{		alert("Please enter a value for the \"Email\" field.");		theForm.email.focus();		return false	}			if (echeck(theForm.email.value)==false)	{		theForm.email.value="";		theForm.email.focus();		return false	}			//validate phone    if (theForm.phone.value == "")	{		alert("Please enter a value for the \"Phone\" field.");		theForm.phone.focus();		return false;	}		//validate question/comment    if (theForm.comment.value == "")	{		alert("Please enter a value for the \"Question/Comment\" field.");		theForm.comment.focus();		return false;	}		return true;			    }function textAreaLength(tArea,tAreaLength){        if (tArea.value.length > tAreaLength)    {        tArea.value=tArea.value.substring(0,tAreaLength)    }    }function echeck(str) {		var at="@"		var dot="."		var lat=str.indexOf(at)		var lstr=str.length		var ldot=str.indexOf(dot)		if (str.indexOf(at)==-1){		   alert("Please enter valid value for the \"Email\" field.");		   return false		}		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		   alert("Please enter valid value for the \"Email\" field.");		   return false		}		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){		    alert("Please enter valid value for the \"Email\" field.");		    return false		}		 if (str.indexOf(at,(lat+1))!=-1){		    alert("Invalid E-mail ID")		    return false		 }		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		    alert("Please enter valid value for the \"Email\" field.");		    return false		 }		 if (str.indexOf(dot,(lat+2))==-1){		    alert("Please enter valid value for the \"Email\" field.");		    return false		 }				 if (str.indexOf(" ")!=-1){		    alert("Please enter valid value for the \"Email\" field.");		    return false		 }		 		 		 var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/		 if (str.match(illegalChars)) {   			alert("Please enter valid value for the \"Email\" field.");		    return false		 } 		  		 return true						}	