function validate_form (form)
{
	var x = document.forms["contact"]["email"].value;
	var atpos = x.indexOf("@");
	var dotpos = x.lastIndexOf(".");
	var y = document.contact.phone.value;

	var fname_text = document.contact.fname.value.replace(/^\s+|\s+$/g, '');
	var lname_text = document.contact.lname.value.replace(/^\s+|\s+$/g, '');
	var phone_text = document.contact.phone.value.replace(/^\s+|\s+$/g, '');
	var email_text = document.contact.email.value.replace(/^\s+|\s+$/g, '');
	var comment_text = document.contact.comment.value.replace(/^\s+|\s+$/g, '');
	var vercode_text = document.contact.vercode.value.replace(/^\s+|\s+$/g, '');
/*	docn.plaintiff_fname.value.replace(/^\s+|\s+$/g, '');*/

    if ( fname_text == "" )
    {
        alert ( "Please fill in the First Name." );
		form.fname.focus();
       	return false;
    }
	if ( lname_text == "" )
    {
        alert ( "Please fill in the Last Name." );
		form.lname.focus();
       	return false;
    }
	if ( phone_text == "" )
    {
        alert ( "Please fill in the Phone Number." );
		form.phone.focus();
       	return false;
    }
   
	if ( email_text == "" )
    {
        alert ( "Please fill in the Email." );
		form.email.focus();
       	return false;
    }
	
	
	if(atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
	{
	 alert("Not a valid e-mail address");
	 form.email.focus();
	 return false;
	}
	if ( comment_text == "" )
    {
        alert ( "Please fill in the Comments." );
		form.comment.focus();
       	return false;
    }
	
	if ( vercode_text == "" )
    {
        alert ( "Please fill in the Captcha." );
		form.vercode.focus();
       	return false;
    }
    return true;
}


