function IsValidForms()
{
	if (document.contact.txtName.value == ""){
		e_msg = "Please enter your Name.";
		f_msg = "Vous devez entrer votre nom.";
		display_error();
		return false;
	}
var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@%&/?\+,;:\\\\\\\"\\.\\[\\]"
	var accentChars="áàÀâÂÇçéÉèÈÊêËëíîÎïÏñÑóôÔúüùûÛ"           //Added Apr 19, 2001
	var validChars="\[^\\s" + specialChars + accentChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

	var emailStr = document.contact.txtEmail.value
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
		e_msg = "Email Address Invalid";
		f_msg = "Votre adresse de courriel est non valide.";
		display_error();
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]

	if (user.match(userPat)==null) {
	    e_msg = "E-mail standards do not allow accented or special characters in the email address. \nPlease remove any of these characters from your address.";     //Added Apr 19, 2001
		f_msg = "Les normes régissant les adresses de courriel ne permettent pas l'utilisation d'accents ou de caractères spéciaux. \nPrière de supprimer ces accents et ces caractères de votre adresse.";     //Added Apr 19, 2001
		display_error();
	    return false
	}

	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		  for (var i=1;i<=4;i++) {
		    if (IPArray[i]>255) {
				e_msg = "Email Address Invalid";
				f_msg = "Votre adresse de courriel est non valide.";
			display_error();
			return false
		    }
	    }
	    return true
	}

	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		e_msg = "E-mail standards do not allow accented or special characters in the email address. \nPlease remove any of these characters from your address.";     //Added Apr 19, 2001
		f_msg = "Les normes régissant les adresses de courriel ne permettent pas l'utilisation d'accents ou de caractères spéciaux. \nPrière de supprimer ces accents et ces caractères de votre adresse.";     //Added Apr 19, 2001
		display_error();
		return false
	}

	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>3) {
		e_msg = "Email Address Invalid";
		f_msg = "Votre adresse de courriel est non valide.";
		display_error();
		return false
	}

	if (len<2) {
	   var errStr="This address is missing a hostname!"
		e_msg = "Email address Invalid";
		f_msg = "Votre adresse de courriel est invalid";
		display_error();
		return false
	}

	if (document.contact.txtCity.value == ""){
		e_msg = "Please enter the City.";
		f_msg = "Vous devez entrer le city.";
		display_error();
		return false;
	}
	if (document.contact.txtPostalCode.value == ""){
		e_msg = "Please enter your Postal Code.";
		f_msg = "Vous devez entrer votre code postal.";
		display_error();
		return false;
	}
	if (document.contact.txtComment.value == ""){
		e_msg = "Please enter your Comment.";
		f_msg = "Vous devez entrer votre comment.";
		display_error();
		return false;
	}
return true;
}
	
//===================================
function trim(arg,func) {
//===================================

var trimvalue = "";
arglen = arg.length;
if (arglen < 1) return trimvalue;
	if (func == "left" || func== "both") {
		i = 0;
		pos = -1;
		while (i < arglen) {
			if (arg.charCodeAt(i) != 32 &&
				!isNaN(arg.charCodeAt(i))) {
				pos = i;
				break;
			}
		i++;
	}
}

if (func == "right" || func== "both") {
	var lastpos = -1;
	i = arglen;
	while (i >= 0) {
		if (arg.charCodeAt(i) != 32 &&
			!isNaN(arg.charCodeAt(i))) {
			lastpos = i;
			break;
		}
	i--;
	}
}

if (func == "left") {
	trimvalue = arg.substring(pos,arglen-1);
}

if (func == "right") {
	trimvalue = arg.substring(0,lastpos+1);
}

if (func == "both") {
	trimvalue = arg.substring(pos,lastpos + 1);
}

return trimvalue;
}