<!---

//---------------------------------------------------------------------------------------
// PiXL Pivotal Business Server HTML Forms Generator
// Copyright 2003, 2004 Consultants Crac! Inc.
// Use of this component is subject to the clauses of a licence agreement.
// Please read your licence agreement carefully before using or modifying this component
//
//---------------------------------------------------------------------------------------
// File      : specificvalidation.js
// Version   : 1.1
// DateTime  : 2003-11-22 13:32
// Author    : P.Custeau
// Purpose   : This document's purpose is to hold specific functions that might have become
//           : necessary by the use of specific field types as defined in ExceptionFieldsHandler.inc
//---------------------------------------------------------------------------------------



// The following is the function to be used for ZIP code validation
// This function will verify that a numeric value (5 digits) was entered in the ZIP code
// field for France only
//

function ValidateZip(e){
    if(!e.value) return true;
    var v = e.value;
    if (isNaN(v) == true && (document.all('Country').value == 'France')){
        window.alert(sZipMessage);
        e.focus();
        e.value = '';
        return false;
        }
    var sValue = String(e.value);
    if ((sValue.length != 5) && (document.all('Country').value == 'France')){
        window.alert("Nombre de chiffres invalide");
        e.focus();
        e.value = '';
        return false;
        }
}

// This function will verify an email address' conformity
//

function EmailCheck(oField) {
    var sAddr = String(oField.value);
    var regInvalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
    var regValid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
    if (regInvalid.test(sAddr) || !regValid.test(sAddr)) {
        window.alert("Merci de bien vouloir vérifier votre adresse e-mail");
        oField.focus();
        return false;
    }
}

function AgeCheck(e) {
    if(!e.value) return true;    
    var v = e.value;
    if(isNaN(v)){
        window.alert("L'age saisi semble non valide");
        e.focus();
        return false;
    }
    if((v < 1) || (v > 125)) {
        window.alert("L'age entré semble non valide");
        e.focus();
        return false;
    }
}

function CheckIsStreetNumber(e) {
    if(!e.value) return true;
    if(isNaN(e.value)){
        window.alert("Le numéro de rue entré semble non valide");
        e.focus();
        e.value = "";
	return false;
    } else {
        document.getElementsByName('CL_Street_Number').value = document.getElementsByName('CL_Street_Number_Number').value + ' ' + document.getElementsByName('StreetBisCode').value;
    }
}

-->
