var charexp = /./
var letterexp = /[a-z]/i
var phonexp =  /^\d{10}$/
var motpasse = /^[a-z_0-9\.&@]{5,}$/
var zipexp = /^[a-z][0-9][a-z]\s[0-9][a-z][0-9]/i
var emailexp = /^[a-z][a-z_0-9\.]+@[a-z_0-9\.]+\.[a-z]{2,3}$/i




function isValid(pattern, str) {
	return pattern.test(str)
}

function hasLetter(str) {
	return letterexp.test(str)
}

function hasChar(str) {
	return charexp.test(str)
}

function stripChars(pattern, str) {
	return str.replace(pattern,"")
}

function stripNonDigits(str) {
	return str.replace(/[^0-9]/g,"")
}

function checkform(form) {

	if  (!hasLetter(form.nom.value)) {
		alert("Entrez votre nom.")
		form.nom.focus()
		return false
		
	} else if  (!hasLetter(form.prenom.value)) {
		alert("Entrez votre prénom.")
		form.prenom.focus()
		return false
	
			
	} else if (!isValid(emailexp,form.email.value)) {
		alert("Your email is invalid")
		form.email.focus()
		return false
	
	} else {
		form.action = "http://www.picmedia.ca/chasse2.php";
	}
	

}
