/**
 * Initialisation des variables de d'appui sur une touche pour un input
 */
var cpTouchKey	= 1;

/**
 * Contrôle du Formulaire WebCallBack (champ Code Postal)
 */
function checkFormAgents() {
	
	$("codepostal").onkeyup	= checkCPOnKeyPress;
    $("codepostal").onblur	= checkCP;

	$("formAgent").onsubmit	= function() {
		
		cpTouchKey	+= 2;
		
		if(checkCP()) {
			return true;
		}
		else {
			checkCP();
			return false;
		}
	};
}

/**
* Controle le Champ à la volée
*/
function checkCPOnKeyPress() {
    if(cpTouchKey > 0) {
        var chk1 = CheckCodePostal('codepostal', 'errorCodepostal', cpTouchKey);
    }
    cpTouchKey++;
    return chk1;
}

/**
 * Contrôle le champ à la sortie et au submit
 */
function checkCP() {
    return CheckCodePostal('codepostal', 'errorCodepostal');
}
