// JavaScript Document
<!-- 
function active_texfield(name){
	var s, F;
	F = document.contact;
	s = document.getElementsByName(name)[0]; 
	s.style.border = "solid #2C353C 1px";
}

function deactive_texfield(name){
	var s, F;
	F = document.contact;
	s = document.getElementsByName(name)[0]; 
	s.style.border = "solid #B2C5D1 1px";
}

function str_trim(sx) {
	return str_trim2(sx,0);	// do not filter cr or ln characters
}
function str_trim2(sx,crln) {
	return str_trim3(sx,0,1);	// do not filter cr or ln characters, change " to '
}
function str_trim3(sx,crln,chng_qt) {
	var s, i, str, c;
	s = sx + "";
	len = s.length;
	if (len <= 0)
		return "";
	i = 0;
	for (i = 0; i < len; ++i) {
		c = s.charAt(i);
		if (c != " " && c != "\t") {
			if (!crln || (crln && c != "\r" && c != "\n"))
				break;
		}
	}
	str = s.substr(i, len - i);
	len = str.length;
	if (len <= 0)
		return "";
	for (i = len - 1; i >= 0; --i) {
		c = str.charAt(i);
		if (c != " " && c != "\t") {
			if (!crln || (crln && c != "\r" && c != "\n"))
				break;
		}
	}
	if (i < 0)
		return "";
	if (chng_qt) {
		// convert " to '
		s = str.substr(0, i + 1);
		len = s.length;
		str = "";
		for (i = 0; i < len; ++i) {
			c = s.charAt(i);
			str += (c == '"') ? "'" : (crln && (c == '\r' || c == '\n')) ? " " : c;
		}
	}
	return str;
}
function chk_zip(s) {
	var str, n, x;
	str = str_trim(s);
	if (str.length < 5 || str.length > 10)
		return false;
	if (str.match("^[0-9][0-9][0-9][0-9][0-9]$")) {
		n = parseInt(str, 10);
		if (n < 210)
			return false;
		return true;
	}
	if (str.match("^[0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]$")) {
		x = str.substr(0,5);
		n = parseInt(x, 10);
		if (n < 210)
			return false;
		return true;
	}
	return false;
}
function chk_form(F) {
	F.zipcode.value = str_trim(F.zipcode.value);
	if (!chk_zip(F.zipcode.value)) {
		if (F.zipcode.value == "") {
			alert("Veuillez saisir un code postal.");
		} else {
			alert("Veuillez saisir un code postal valide (5 chiffres).");
		}
		F.zipcode.focus();
		return false;
	}
	if(F.ac.value.length<1)
	{
		window.alert("Veuillez renseigner une activité");
		F.ac.focus();
		return false;
	}
	
	return true;
}
function chk_form2(F) {
	F.zipcode.value = str_trim(F.zipcode.value);
	if (!chk_zip(F.zipcode.value)) {
		if (F.zipcode.value == "") {
			alert("Veuillez saisir un code postal.");
		} else {
			alert("Veuillez saisir un code postal valide (5 chiffres).");
		}
		F.zipcode.focus();
		return false;
	}
	return true;
}
// -->