$(document).ready(function(){

jQuery.validator.addMethod(
	  "regex",
	   function(value, element, regexp) {
	       if (regexp.constructor != RegExp)
	          regexp = new RegExp(regexp);
	       else if (regexp.global)
	          regexp.lastIndex = 0;
	          return this.optional(element) || regexp.test(value);
	   },"erreur expression reguliere"
	);
	
  $('#formConventionnement').validate(
  {

        rules:
        {
            nom_vous_1:{required: true,minlength: 2},
            prenom_vous_1:{required: true,minlength: 2},
            raison_sociale_1: {required: true},
            num_finess_1: {required: true,minlength: 9},
            num_voie_1: {required: true,minlength: 1},
            nom_voie_1: {required: true,minlength: 2},
            code_postal_1: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_1: {required: true,minlength: 2},
            tel_fixe_1: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_1: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_1: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_1: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_2:{required: true,minlength: 2},
            prenom_vous_2:{required: true,minlength: 2},
            raison_sociale_2: {required: true},
            num_finess_2: {required: true,minlength: 9},
            num_voie_2: {required: true,minlength: 1},
            nom_voie_2: {required: true,minlength: 2},
            code_postal_2: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_2: {required: true,minlength: 2},
            tel_fixe_2: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_2: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_2: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_2: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_3:{required: true,minlength: 2},
            prenom_vous_3:{required: true,minlength: 2},
            raison_sociale_3: {required: true},
            num_finess_3: {required: true,minlength: 9},
            num_voie_3: {required: true,minlength: 1},
            nom_voie_3: {required: true,minlength: 2},
            code_postal_3: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_3: {required: true,minlength: 2},
            tel_fixe_3: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_3: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_3: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_3: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_4:{required: true,minlength: 2},
            prenom_vous_4:{required: true,minlength: 2},
            raison_sociale_4: {required: true},
            num_finess_4: {required: true,minlength: 9},
            num_voie_4: {required: true,minlength: 1},
            nom_voie_4: {required: true,minlength: 2},
            code_postal_4: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_4: {required: true,minlength: 2},
            tel_fixe_4: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_4: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_4: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_4: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_5:{required: true,minlength: 2},
            prenom_vous_5:{required: true,minlength: 2},
            raison_sociale_5: {required: true},
            num_finess_5: {required: true,minlength: 9},
            num_voie_5: {required: true,minlength: 1},
            nom_voie_5: {required: true,minlength: 2},
            code_postal_5: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_5: {required: true,minlength: 2},
            tel_fixe_5: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_5: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_5: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_5: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_6:{required: true,minlength: 2},
            prenom_vous_6:{required: true,minlength: 2},
            raison_sociale_6: {required: true},
            num_finess_6: {required: true,minlength: 9},
            num_voie_6: {required: true,minlength: 1},
            nom_voie_6: {required: true,minlength: 2},
            code_postal_6: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_6: {required: true,minlength: 2},
            tel_fixe_6: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_6: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_6: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_6: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_7:{required: true,minlength: 2},
            prenom_vous_7:{required: true,minlength: 2},
            raison_sociale_7: {required: true},
            num_finess_7: {required: true,minlength: 9},
            num_voie_7: {required: true,minlength: 1},
            nom_voie_7: {required: true,minlength: 2},
            code_postal_7: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_7: {required: true,minlength: 2},
            tel_fixe_7: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_7: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_7: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_7: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_8:{required: true,minlength: 2},
            prenom_vous_8:{required: true,minlength: 2},
            raison_sociale_8: {required: true},
            num_finess_8: {required: true,minlength: 9},
            num_voie_8: {required: true,minlength: 1},
            nom_voie_8: {required: true,minlength: 2},
            code_postal_8: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_8: {required: true,minlength: 2},
            tel_fixe_8: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_8: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_8: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_8: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_9:{required: true,minlength: 2},
            prenom_vous_9:{required: true,minlength: 2},
            raison_sociale_9: {required: true},
            num_finess_9: {required: true,minlength: 9},
            num_voie_9: {required: true,minlength: 1},
            nom_voie_9: {required: true,minlength: 2},
            code_postal_9: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_9: {required: true,minlength: 2},
            tel_fixe_9: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_9: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_9: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_9: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/},

            nom_vous_10:{required: true,minlength: 2},
            prenom_vous_10:{required: true,minlength: 2},
            raison_sociale_10: {required: true},
            num_finess_10: {required: true,minlength: 9},
            num_voie_10: {required: true,minlength: 1},
            nom_voie_10: {required: true,minlength: 2},
            code_postal_10: {required: true,minlength: 4,maxlength: 5,number: true},
            ville_10: {required: true,minlength: 2},
            tel_fixe_10: {required: true,minlength: 8,maxlength: 12,number: true},
            tel_portable_10: {required: false,minlength: 8,maxlength: 12,number: true},
            fax_collectivite_10: {required: false,minlength: 8,maxlength: 12,number: true},
            email_collectivite_10: {required: true,"regex": /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-z]{2,3}$/}
        },
        messages:
        {
            nom_vous_1: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_1: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_1: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_1: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_1 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_1 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_1 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_1 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_1 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_1: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_1: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_1 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_2: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_2: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_2: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_2: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_2 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_2 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_2 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_2 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_2 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_2: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_2: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_2 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_3: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_3: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_3: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_3: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_3 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_3 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_3 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_3 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_3 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_3: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_3: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_3 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_4: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_4: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_4: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_4: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_4 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_4 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_4 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_4 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_4 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_4: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_4: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_4 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_5: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_5: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_5: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_5: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_5 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_5 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_5 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_5 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_5 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_5: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_5: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_5 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_6: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_6: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_6: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_6: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_6 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_6 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_6 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_6 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_6 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_6: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_6: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_6 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_7: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_7: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_7: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_7: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_7 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_7 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_7 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_7 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_7 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_7: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_7: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_7 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_8 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_8 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_8 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_8 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_8: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_8 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_9: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_9: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_9: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_9: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_9 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_9 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_9 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_9 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_9 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_9: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_9: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_9 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>",

            nom_vous_10: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Nom&nbsp;incorrect.</p>",
            prenom_vous_10: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Pr&eacute;nom&nbsp;incorrect.</p>",
            raison_sociale_10: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Raison&nbsp;sociale&nbsp;incorrecte.</p>",
            num_finess_10: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;incorrect.</p>",
            num_voie_10 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>N&deg;&nbsp;voie&nbsp;incorrect.</p>",
            nom_voie_10 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Voie&nbsp;incorrecte.</p>",
            code_postal_10 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 3px;position:relative;top:19px'>CP&nbsp;incorrect.</p>",
            ville_10 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Ville&nbsp;incorrecte.</p>",
            tel_fixe_10 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            tel_portable_10: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;T&eacute;l&nbsp;incorrect.</p>",
            fax_collectivite_10: "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>N&deg;&nbsp;Fax&nbsp;incorrect.</p>",
            email_collectivite_10 : "<p style='color:#de015a;font-size:12px;padding: 0 0 0 25px;position:relative;top:2px'>Email&nbsp;incorrect.</p>"

    },
        success: function(label)
        {
            label.html("&nbsp;").addClass("ok");
        }
       }

  );
     });
	 
	
function formProSante()
{
	initformProSante();
	
	$("#specialite").change(function () 
	{
		var cas = $("select#specialite option:selected").val();
		switch(cas){
			case '0' :initformProSante();break;
			case '2' :initformProSante();$("#affichageOpticien").show('slow');break;
			case '3' :initformProSante();$("#affichagePharmacien").show('slow');break;
			default:initformProSante();$('#choixNbCabinets').show('slow');formProSanteCabinets();break;
		}
	});
	$("#nb_cabinets").change(function () 
	{
		formProSanteCabinets();
	});
}

function initformProSante(){
	$("#affichageContenuFormulaire").hide();
	$("#choixNbCabinets").hide();
	$("#affichageOpticien").hide();
	$("#affichagePharmacien").hide();
	$("#affichageEnvoyer").hide();
}

function formProSanteCabinets(){
	var nb_cabinets = $("select#nb_cabinets option:selected").val();
	var html = '';
	for(i=1;i<=nb_cabinets;i++){
		if(nb_cabinets != 1){
			if(i == 1){
                           html += '<h3 class="puce29 color04 text01"><strong>Informations relatives &agrave; vos cabinets</strong></h3>';
                           html += '<div class="formulaire">';
                          }
		 	html += '<h4 class="titreCabinet">Cabinet '+ i +'</h4>';
		 	html += '<div class="coins"><div class="coin coin07 coinHD07"></div></div>';
		} else {
			html += '<h3 class="puce29 color04 text01"><strong>Informations relatives &agrave; votre cabinet</strong></h3>';
			html += '<div class="formulaire"><div class="coins"><div class="coin coin07 coinHG07"></div><div class="coin coin07 coinHD07"></div></div>';
		}
 /* debut formulaire cabinet */

		html += '<div class="formulaireContent">';
		html += '<div class="ligne">';
		html += '<label class="lbl03 il" for="num_finess">Votre N&#176;FINESS/ADELI <span class="champ_obligatoire">*</span> :</label>';
		html += '<input type="text" id="num_finess_'+i+'" name="num_finess_'+i+'" class="input_text champ01 il required" />';
		html += '<div class="clear_float"></div></div>';
		html += '<div class="ligne">';
		html += '<label class="lbl03 il" for="type_systeme_echange">Type d&rsquo;&eacute;change syst&egrave;me de t&eacute;l&eacute;transmission <span class="champ_obligatoire">*</span> :</label>';
		html += '<select id="type_systeme_echange_'+i+'" name="type_systeme_echange_'+i+'" class="select02 il" ><option selected="selected" value="manuel">manuel</option><option value="noemie1">no&eacute;mie1 (gestion unique)</option><option value="dre">DRE (gestion s&eacute;par&eacute;e)</option><option value="concentrateur">Concentrateur</option></select>';
		html += '<div class="clear_float"></div></div>';
		html += '<div class="ligne">';
		html += '<label class="lbl03 il">Civilit&eacute; <span class="champ_obligatoire">*</span> :</label>';
		html += '<ul class="radiolist il oh">';
		html += '<li class="il"><input type="radio" id="mr_vous_'+i+'" name="civilite_vous_'+i+'" class="il" value="Mr" checked/><label for="mr_vous" class="lbl02 il">M.</label></li>';
		html += '<li class="il"><input type="radio" id="mme_vous_'+i+'" name="civilite_vous_'+i+'" class="il" value="Mme"/><label for="mme_vous" class="lbl02 il">Mme</label></li>';
		html += '<li class="il"><input type="radio" id="mlle_vous_'+i+'" name="civilite_vous_'+i+'" class="il" value="Melle"/><label for="mlle_vous" class="lbl02 il">Mlle</label></li>';
		html += '</ul><div class="clear_float"></div></div>';
		html += '<div class="ligne">';
		html += '<label class="lbl03 il" for="nom_vous">Nom <span class="champ_obligatoire">*</span> :</label>';
		html += '<input type="text" id="nom_vous_'+i+'" name="nom_vous_'+i+'" class="input_text champ01 il required" />';
		html += '<div class="clear_float"></div></div>';
		html += '<div class="ligne">';
		html += '<label class="lbl03 il" for="prenom_vous">Pr&eacute;nom <span class="champ_obligatoire">*</span> :</label>';
		html += '<input type="text" id="prenom_vous_'+i+'" name="prenom_vous_'+i+'" class="input_text champ01 il required" />';
		html += '<div class="clear_float"></div></div>';
		html += '<div class="ligne">';
		html += '<label class="lbl03 il" for="raison_sociale">Raison sociale <span class="champ_obligatoire">*</span> :</label>';
		html += '<input type="text" id="raison_sociale_'+i+'" name="raison_sociale_'+i+'" class="input_text champ01 il required" />';
		html += '<div class="clear_float"></div></div>';
		html += '</div>';
		html += '<div class="coins"><div class="coin coin07 coinBG07"></div><div class="coin coin07 coinBD07"></div></div>';

/* fin infos cabinet*/

/* debut coordonnes cabinet*/

                html+='<div id="affichageCoordonnees">';
                  html += '<h2 class="mutTitre03">Vos coordonn&eacute;es</h2>';
                  html +='<div id="infosAdresse" class="formulaire">';
                    html +='<div class="coins">';
                      html +='<div class="coin coin07 coinHG07"></div>';
                      html +='<div class="coin coin07 coinHD07"></div>';
                    html +='</div>';
                  html += '<p class="mention"><span class="champ_obligatoire">*</span> Champs obligatoires</p>';
                  html += '<div class="formulaireContent">';
                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="num_voie">N&deg; et type de voie <span class="champ_obligatoire">*</span> :</label>';
                      html += '<input type="text" id="num_voie_'+i+'" name="num_voie_'+i+'" class="input_text champ02 il" />';
                      html += '<select id="type_voie_'+i+'" name="type_voie_'+i+'" class="select03 il" >';
                      html += '<option selected="selected"';
                        html += '<option value="RUE">RUE</option>';
                        html += '<option value="ALLEE">ALLEE</option>';
                        html += '<option value="AVENUE">AVENUE</option>';
                        html += '<option value="BOULEVARD">BOULEVARD</option>';
                        html += '<option value="CHEMIN">CHEMIN</option>';
                        html += '<option value="CITE">CITE</option>';
                        html += '<option value="CLOS">CLOS</option>';
                        html += '<option value="COUR">COUR</option>';
                        html += '<option value="CENTRE">CENTRE</option>';
                        html += '<option value="GRANDE RUE">GRANDE RUE</option>';
                        html += '<option value="IMPASSE">IMPASSE</option>';
                        html += '<option value="LOTISSEMENT">LOTISSEMENT</option>';
                        html += '<option value="PLACE">PLACE</option>';
                        html += '<option value="QUARTIER">QUARTIER</option>';
                        html += '<option value="RESIDENCE">RESIDENCE</option>';
                        html += '<option value="ROUTE">ROUTE</option>';
                        html += '<option value="SQUARE">SQUARE</option>';
                      html += '</select>';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="nom_voie">Nom de la voie <span class="champ_obligatoire">*</span> :</label>';
                      html += '<input type="text" id="nom_voie_'+i+'" name="nom_voie_'+i+'" class="input_text champ01 il" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="complement_adresse">Compl&eacute;ment d&#39;adresse :</label>';
                      html += '<input type="text" id="complement_adresse_'+i+'" name="complement_adresse_'+i+'" class="input_text champ01 il" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="code_postal">Code Postal <span class="champ_obligatoire">*</span> :</label>';
                      html += ' <input type="text" id="code_postal_'+i+'" name="code_postal_'+i+'" class="input_text champ02 il" />';
                      html += '<label class="lbl02 il" for="ville">Ville <span class="champ_obligatoire">*</span> :</label>';
                      html += '<input type="text" id="ville_'+i+'" name="ville_'+i+'" class="input_text champ03 il" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="pays">Pays <span class="champ_obligatoire">*</span> :</label>';
                      html += '<select id="pays_'+i+'" name="pays_'+i+'" class="select02 il">';
                        html += '<option value="France" >France</option>';
                        html += '<option value="Autre" >Autres</option>';
                      html += '</select>';

                      html += '<div class="clear_float"></div>';
                    html += '</div>';
                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="tel_fixe">N&deg; de t&eacute;l&eacute;phone principal <span class="champ_obligatoire">*</span> :</label>';
                      html += '<input type="text" id="tel_fixe_'+i+'" name="tel_fixe_'+i+'" class="input_text champ01 il" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="tel_portable">N&deg; de t&eacute;l&eacute;phone secondaire :</label>';
                      html += '<input type="text" id="tel_portable_'+i+'" name="tel_portable_'+i+'" class="input_text champ01 il" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="fax_collectivite">N&deg; de fax :</label>';
                      html += '<input type="text" id="fax_collectivite_'+i+'" name="fax_collectivite_'+i+'" class="input_text champ01 il" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                    html += '<div class="ligne">';
                      html += '<label class="lbl03 il" for="email_collectivite">Email <span class="champ_obligatoire">*</span> :</label>';
                      html += '<input type="text" id="email_collectivite_'+i+'" name="email_collectivite_'+i+'" class="input_text champ01 il required" />';
                      html += '<div class="clear_float"></div>';
                    html += '</div>';

                  html += '</div>';
                  html += '<div class="coins"><div class="coin coin07 coinBG07"></div><div class="coin coin07 coinBD07"></div></div>';
    
            html += '</div>';
 
/* fin coordonnes cabinet */
	}

      html += '<h3 class="puce29 color04 text01"><strong> </strong></h3>';
        html += '<div class="formulaireContent">';
          html += '<div class="coins">';
          html += '<div class="coin coin07 coinHG07"></div>';
          html += '<div class="coin coin07 coinHD07"></div>';
        html += '</div>';

        html += '<div class="ligne">';
          html += '<input type="checkbox" value="oui" name="accept_collectivite" id="accept_collectivite" class="checkbox01 il" />';
          html += '<label for="accept_collectivite" class="lbl05 il">J&#39;accepte de recevoir des informations commerciales de la part d&#39;APREVA.</label>';
          html += '<div class="clear_float"></div>';
        html += '</div>';

        html += '<div class="ligne">';
          html += '<input type="checkbox" value="oui" name="accept_conventionnement" id="accept_conventionnement" class="checkbox01 il" />';
          html += '<label for="accept_conventionnement" class="lbl04 il">Oui, je souhaite me conventionner</label>';
          html += '<div class="clear_float"></div>';
        html += '</div>';
      html += '</div>';

      html += '<div class="coins">';
          html += '<div class="coin coin07 coinBG07"></div>';
          html += '<div class="coin coin07 coinBD07"></div>';
      html += '</div>';


	$("#affichageContenuFormulaire").html(html);
	$("#affichageContenuFormulaire").show('slow');
	$("#affichageCoordonnees").show('slow');
	$("#affichageEnvoyer").show('slow');


      for(i=1;i<=nb_cabinets;i++)
      {
        $("#num_finess_"+i).mask("999999999",{placeholder:""});
        //$("#nom_vous_"+i).mask("aa?aaaaaaaaaaaaaaaaaaaaaaa",{placeholder:""});
		//$("#prenom_vous_"+i).mask("aa?aaaaaaaaaaaaaaaaaaaaaaa",{placeholder:""});
        //$("#raison_sociale_"+i).mask("**?***********************",{placeholder:" "});
        $("#num_voie_"+i).mask("9?*****",{placeholder:""});
        //$("#nom_voie_"+i).mask("*?**********************************",{placeholder:" "});
        $("#code_postal_"+i).mask("9*99?9",{placeholder:""});
        //$("#ville_"+i).mask("a?aaaaaaaaaaaaaaaaaaaaaaaa",{placeholder:" "});
        $("#tel_fixe_"+i).mask("99999999?9999",{placeholder:""});
        $("#tel_portable_"+i).mask("99999999?9999",{placeholder:""});
        $("#fax_collectivite_"+i).mask("99999999?9999",{placeholder:""});

      }

}	

