//permet de valider le formulaire contact
this.submitFormContact = function(){
    //A la validation du formulaire
    $("#formContact").submit(
        function(e){
            //on annule l'effet que devait avoir la validation du formulaire'
            e.preventDefault();
            if(checkLength($("#nameContact").val(), 2, 100, $("#errorName")) && checkLength($("#surnameContact").val(), 2, 100, $("#errorSurname"))
                && checkLength($("#phoneContact").val(), 2, 15, $("#errorPhone")) && checkEmail($("#emailContact").val(), $("#errorEmail"))
                && checkLength($("#message").val(), 1, 20000, $("#errorMessage"))){
                //fait disparaitre le formulaire validé avec un effet fadeOut
                $(this).fadeOut(1000,function(){
                    //envoi des données en ajax
                    $.ajax({
                        type: 'Post',
                        url: 'model/fonction.php',
                        data: "fonction=mailContact&nameContact=" + $("#nameContact").val().toUpperCase() + "&surnameContact=" + $("#surnameContact").val() +
                        "&phoneContact=" + $("#phoneContact").val() + "&emailContact=" + $("#emailContact").val().toLowerCase() + "&message=" + $("#message").val(),
                        success: function(returnValue){
                            //supprimer le formulaire
                            $(this).remove();
                            //affiche la bonne div en fonction du resultat
                            if((returnValue == "true") || (returnValue == "1")){
                                $("#confirmContact").slideToggle();
                            }else{
                                $("#echecContact").slideToggle();
                            }
                        }
                    });
                });
            }
        }
        );
}

//permet de vérifier la longueur d'une chaine
this.checkLength = function(prmValue,prmMin,prmMax,prmDivError){
    //valeur de retour init a false
    var valRetour = false;
    //si la valeur est sup au min et inf au max
    if((prmValue.toString().length > prmMin) && (prmValue.toString().length < prmMax)){
        //on met la valeur de retour a true
        valRetour = true;
        //cache la div erreur si elle est affiché
        $(prmDivError).hide("slow");
    }else{
        //on affiche le message d'erreur'
        $(prmDivError).show("slow");
    }
    //on retourne la valeur
    return valRetour;
}

//permet de vérifier si il y a au moins un arobase et un point dans l'adresse'
this.checkEmail = function(prmValue,prmDivError){    
    //valeur de retour
    var valRetour = false;
    //index de l'arobase'
    var indexArobase = prmValue.indexOf("@");
    //index du dernier point
    var indexLastPoint = prmValue.indexOf(".");

    //si la chaine contient un arobase et un point
    if((indexArobase != -1) && (indexLastPoint != -1)){
        //init la valeur de retour a true
        valRetour = true;
        //cache la div error
        $(prmDivError).hide("slow");
    }else{
        //affiche le message d'erreur'
        $(prmDivError).show("slow");
    }
    //retourne la valeur
    return valRetour;
}

//permet d'ajouter dynamiquement le nom du lien au chargement de la page'
this.setLinkContent = function(prmNameLink,prmValueLink){
    //init le texte du lien
    $("#nameLinkPage").text(prmNameLink);
    //init la valeur de l'attribut href'
    $("#nameLinkPage").attr("href", prmValueLink);
}

//affiche le formulaire pour l'accès au solution'
this.getFormAccessSolution = function(){    
    //quand on clique sur le lien Accès Solution
    $("#access").click(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
            //affiche la f
            $("#divAccessForm").dialog({
                bgiframe: true,
                resizable: false,
                height: 170,
                modal: true,
                buttons: {
                    'Connecter': function() {
                    },
                    'Annuler': function() {
                        $(this).dialog('close');
                    }
                },
                overlay: {
                    backgroundColor: '#000',
                    opacity: 0.5
                }
            });
        }
        );
}

//affiche la div qui contient les maentions légales en mode dialog
this.getDivMentions = function(){
    $("#mentionsLink").click(function(e){
        e.preventDefault();
        $("#mentions").dialog({
            bgiframe: true,
            resizable: false,
            width: 600,
            height: 500,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            }
        });
    });
}

//recupere le resume d'un evenement au chargement de la page'
this.getEventsFirst = function(){
    //envoi des données en ajax
    $.ajax({
        type: 'Post',
        url: 'model/fonction.php',
        data: "fonction=getResumeEvents",
        success: function(returnValue){
            //parse le retour en json pour récuperer les infos
            var objRetour = $.parseJSON(returnValue);
            //init la dic pour afficher le resume
            $("#textResumeEvent").html(objRetour.resume);
            //specifie la valeur de l'attribut
            $("#linkEvenement").attr("href", "index.php?page=evenement&eventId=" + objRetour.id);
        }
    });
}

//recupere le resume d'un evenement toutes les 30 secondes'
this.getEvents = function(){
    //cache le texte avec un effet
    $("#textResumeEvent").fadeOut(2000,function(){
        //recupere les données en ajax
        $.ajax({
            type: 'Post',
            url: 'model/fonction.php',
            data: "fonction=getResumeEvents",
            success: function(returnValue){
                //si reussite
                //parse le retour en json pour récuperer les infos
                var objRetour = $.parseJSON(returnValue);
                //init la dic pour afficher le resume
                $("#textResumeEvent").html(objRetour.resume);
                //specifie la valeur de l'attribut
                $("#linkEvenement").attr("href", "index.php?page=evenement&eventId=" + objRetour.id);
                //on affiche la div avec un effet
                $("#textResumeEvent").fadeIn(2000);
            }
        });
    });    
}

//valide le premier formulaire
this.submitFormCoorPageOne = function(){
    //a la validation du formulaire
    $("#formCoordonnees").submit(function(e){
        //annule la validation normale du formulaire
        e.preventDefault();
        $("#pageOne").slideUp(1000,function(){
            $("#headerForm").hide(1000,function(){
                $("#headerForm").text("Qualite du Seminaire (2/7)");
                $("#headerForm").show(1000,function(){
                    $("#pageTwo").slideDown(1000);
                });
            });            
        });
    });
}

//valider le deuxieme formulaire
this.submitFormQualitePageTwo = function(){
    //a la validation du formulaire
    $("#formQualite").submit(function(e){
        //annule la validation normale du formulaire
        e.preventDefault();
        $("#pageTwo").slideUp(1000, function(){
            $("#headerForm").hide(1000,function(){
                $("#headerForm").text("Questions Diverses (3/7)");
                $("#headerForm").show(1000,function(){
                    $("#pageThree").slideDown(1000);
                });
            });
        });
    });
}

//valider le troisieme formulaire
this.submitFormQuestionsPageThree = function(){
    //a la validation du formulaire
    $("#formQuestions").submit(function(e){
        //annule la validation normale du formulaire
        e.preventDefault();
        $("#pageThree").slideUp(1000, function(){
            $("#headerForm").hide(1000,function(){
                $("#headerForm").text("Votre Entreprise (4/7)");
                $("#headerForm").show(1000,function(){
                    $("#pageFour").slideDown(1000);
                });
            });
        });
    });
}

//valider le quatrieme formulaire
this.submitFormEntreprisePageFour= function(){
    //a la validation du formulaire
    $("#formSociete").submit(function(e){
        //annule la validation normale du formulaire
        e.preventDefault();
        $("#pageFour").slideUp(1000, function(){
            $("#headerForm").hide(1000,function(){
                $("#headerForm").text("Votre Environnement Technique (5/7)");
                $("#headerForm").show(1000,function(){
                    $("#pageFive").slideDown(1000);
                });
            });
        });
    });
}

//valider le cinquieme formulaire
this.submitFormEnvironnementPageFive = function(){
    $("#formEnvironnement").submit(function(e){
        //annule l'effet normale de la validation du formulaire
        e.preventDefault();
        $("#pageFive").slideUp(1000, function(){
            $("#headerForm").hide(1000,function(){
                $("#headerForm").text("Notre Prochain Seminaire (6/7)");
                $("#headerForm").show(1000,function(){
                    $("#pageSix").slideDown(1000);
                });
            });
        });
    });
}

//[PAGE INDEX]
//Affiche les solutions au chargement de la page
this.getActuFirst = function(prmNameContent){
    //envoi des données en ajax
    $.ajax({
        type: 'Post',
        url: 'model/fonction.php',
        data: "fonction=getActu",
        success: function(returnValue){
            //parse le retour en json
            var obj = $.parseJSON(returnValue);
            //ajoute le code HTML
            $("#contentActuOne").html("<p style='position:relative;z-index: 2;text-align:left;font-size:small;margin-left: 10px'>" + obj[0].description + "<div style='position: absolute;right: 30px;font-size:small;font-style:italic;'>Le " + obj[0].date + "</div>");
            $("#contentActuTwo").html("<p style='text-align:left;font-size:small;margin-left: 10px'>" + obj[1].description + "<div style='position: absolute;right: 30px;font-size:small;font-style:italic;'>Le " + obj[1].date + "</div>");
        }
    });
}

//[PAGE RECRUTEMENT]
//init la di pour afficher les annonces en accordeon
this.setDivAnnonceDescription = function(){
    $("#annonce").accordion({
        header: "h3"
    });
}

//change le texte du label
this.changeTextLabel = function(prmNomLabel,prmTextLabel){
    $(prmNomLabel).text(prmTextLabel);
}

//[PAGE GROUPE]
//affiche le texte pour la section Projets Infra
this.setTextGroupe = function(prmTitle, prmNameLink, prmNameDivContent){
    //clic sur le lien
    $(prmNameLink).click(function(e){
        //on annule l'effet normal du lien'
        e.preventDefault();
        // on change le texte
        changeTextLabel("#textTitleContent",prmTitle);
        //on change le texte
        $("#textContentInfo").hide(500, function(){
            $(this).html($(prmNameDivContent).html());
            $(this).show(500);
        });
    });
}

//[PAGE RECRUTEMENT]
//affiche le contenu et le titre de l'annonce'
this.showContentAnnonce = function(prmLinkAnnonce){
    //lors du clic sur le lien de l'annonce
    $(prmLinkAnnonce).click(function(e){
        //annule l'effet normal du lien
        e.preventDefault();
        //change le texte du label pour le titre
        changeTextLabel("#nomAnnonce",$(prmLinkAnnonce).text());
        //cache le contenu de l'annonce
        $("#textContentAnnonce").slideUp(500, function(){
            $(this).html($(prmLinkAnnonce + "ann").html());
            $(this).show(500);
        });
    });
}

//[PAGE ACTUALITE]
//affiche le contenu de l'annonce'
this.showAnnonce = function(prmLinkAnnonce,prmIdActu){
    //lors du clic sur le lien concernée
    $(prmLinkAnnonce).click(function(e){
        //annule l'effet du lien'
        e.preventDefault();
        //change le texte du label
        changeTextLabel("#titreActualiteContent",">> " + $(prmLinkAnnonce).text());
        $.ajax({
            type: 'Post',
            url: 'model/fonction.php',
            data: "fonction=getInfoActu&idActu=" + prmIdActu ,
            success: function(returnValue){
                var obj = $.parseJSON(returnValue);
                $("#actuContentDesc").html(obj.content);
            }
        });
    });
}

//[PAGE ACTUALITES]
//affiche le contenu d'une annonce sans le clic sur le lien
this.showAnnonceAtBegin = function(prmIdActu){    
    $.ajax({
        type: 'Post',
        url: 'model/fonction.php',
        data: "fonction=getInfoActu&idActu=" + prmIdActu ,
        success: function(returnValue){
            var obj = $.parseJSON(returnValue);
            //change le texte du label
            changeTextLabel("#titreActualiteContent",">> " + obj.titre);
            $("#actuContentDesc").html(obj.content);
        }
    });
}

//[PAGE EVENEMENTS]
//affiche les informations des sessions dans des infos bulles
this.showInfoBulle = function(prmCellTable,prmNameDivInfo){
    /* CONFIG */
    xOffset = 1;
    yOffset = 2;
    // these 2 variable determine popup's distance from the cursor
    // you might want to adjust to get the right result
    /* END CONFIG */
    var posXContentMS = document.getElementById("contentMSDays").offsetLeft;
    var posXBloc = document.getElementById("bloc").offsetLeft;
    var posXContent = document.getElementById("content").offsetLeft;
    var posYBloc = document.getElementById("bloc").offsetTop;
    $(prmCellTable).hover(function(e){
        $(prmNameDivInfo)
        .css("top",(e.pageY - posYBloc) + "px")
        .css("left",(e.pageX - posXContentMS - posXBloc - posXContent) +  "px")
        .fadeIn("fast");
    },
    function(){
        $(prmNameDivInfo).fadeOut("fast");
    });
    $(prmCellTable).mousemove(function(e){
        $(prmNameDivInfo)
        .css("top",(e.pageY - posYBloc) + "px")
        .css("left",(e.pageX - posXContentMS - posXBloc - posXContent) + "px");
    });
}

//[PAGE EVENEMENTS]
//affiche le plan d'accès
this.showAcces = function(){
    $("#lienAcces").click(function(e){        
        //annule l'effet normal du lien
        e.preventDefault();
        $("#planAcces").dialog({
            bgiframe: true,
            resizable: false,
            width: 600,
            height: 500,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            }
        });
    });
}

//[PAGE EVENEMENT]
//affichage du formulaire
this.showFormInscription = function(prmNomLien,prmNomDiv){
    $(prmNomLien).click(function(e){
        //annule l'effet normal du lien'
        e.preventDefault();
        $(prmNomDiv).dialog({
            bgiframe: true,
            resizable: false,
            width: 600,
            height: 500,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            }
        });
    });
}

//[PAGE EVENEMENT]
//validation du formulaire
this.submitFormEvent = function(){
    $("#btnValiderInscription").click(function(e){
        //annulatuion de l'effet normal de la validation'
        e.preventDefault();
        //Test les valeurs pour pouvoir les envoyer
        if((checkLength($("#nom").val(), 1, 100, $("#errorName"))) && (checkLength($("#prenom").val(), 1, 100, $("#errorSurname")))
            && (checkEmail($("#email").val(), $("#errorEmail"))) && (checkLength($("#societe").val(), 1, 100, $("#errorSociete")))
            && (checkLength($("#fonctionPoste").val(), 0, 100, $("#errorFonction"))) && (checkLength($("#telephone").val(), 9, 20, $("#errorPhone")))
            && (checkLength($("#questionOne").val(), 1, 1000, $("#errorQuestionOne")))){
            //fait disparaitre le formulaire validé avec un effet fadeOut
            $("#formInscription").fadeOut(1000,function(){                
                //envoi des données en ajax
                $.ajax({
                    type: 'Post',
                    url: 'model/fonction.php',
                    data: "fonction=saveInscriptionEvent&eventId=" + $("#eventIdHidden").val() + "&nom=" + $("#nom").val().toUpperCase() + "&prenom=" + $("#prenom").val() + "&email=" + $("#email").val().toLowerCase() + "&societe=" + $("#societe").val() +
                    "&fonctionPoste=" + $("#fonctionPoste").val() + "&telephone=" + $("#telephone").val() + "&questionOne=" + $("#questionOne").val(),
                    success: function(returnValue){
                        //supprimer le formulaire
                        $(this).remove();
                        //affiche la bonne div en fonction du resultat
                        if((returnValue == "true") || (returnValue == "0")){                            
                            $("#confirmInscription").slideToggle();
                        }else{
                            $("#echecInscription").slideToggle();
                        }
                    }
                });
            });
        }
    });
}

//[PAGE ACTU]
//Recupere les actualités par date
this.getActuByDate = function(){
    //envoi des données en ajax
    $.ajax({
        type: 'Post',
        url: 'model/fonction.php',
        data: "fonction=getActuByDate",
        success: function(returnValue){
            var obj = $.parseJSON(returnValue);
            //ACTU UNE
            $("#ligneLeftOne").html(obj[0].description);
            $("#imageActuOne").attr("src", obj[0].image);
            $("#imageActuOne").attr("alt", obj[0].prenom);
            $("#infoActuOne").text(obj[0].date + ", par " + obj[0].prenom);
            //ACTU TWO
            $("#ligneLeftTwo").html(obj[1].description);
            $("#imageActuTwo").attr("src", obj[1].image);
            $("#imageActuTwo").attr("alt", obj[1].prenom);
            $("#infoActuTwo").text(obj[1].date + ", par " + obj[1].prenom);
            //ACTU THREE
            $("#ligneLeftThree").html(obj[2].description);
            $("#imageActuThree").attr("src", obj[2].image);
            $("#imageActuThree").attr("alt", obj[2].prenom);
            $("#infoActuThree").text(obj[2].date + ", par " + obj[2].prenom);
            //ACTU FOUR
            $("#ligneLeftFour").html(obj[3].description);
            $("#imageActuFour").attr("src", obj[3].image);
            $("#imageActuFour").attr("alt", obj[3].prenom);
            $("#infoActuFour").text(obj[3].date + ", par " + obj[3].prenom);
            //ACTU FIVE
            $("#ligneLeftFive").html(obj[4].description);
            $("#imageActuFive").attr("src", obj[4].image);
            $("#imageActuFive").attr("alt", obj[4].prenom);
            $("#infoActuFive").text(obj[4].date + ", par " + obj[4].prenom);
        }
    });
}

//[PAGE GROUPE]
//affiche les infos de la balise raison
this.showInfoRaison = function(){
    $("#lienAccordionRaison").click(function(e){
        //annule l'effet du lien
        e.preventDefault();
        $("#contentAccordionMetier").hide("slow",function(){
            $("#contentAccordionRaison").slideToggle("slow");
        });
    });
}

//[PAGE GROUPE]
//affiche les infos de la balise metier
this.showInfoMetier = function(){    
    $("#lienAccordionMetier").click(function(e){
        //annule l'effet du lien
        e.preventDefault();
        $("#contentAccordionRaison").hide("slow",function(){
            $("#contentAccordionMetier").slideToggle("slow");
        });
    });
}

//[PAGE RECRUTEMENT]
//montre le contenu de l'annonce
this.showContentAnnonce = function()
{
    $("#expertcollabsecu").click(function(e){        
        if($("#contentAnnonceProjetOne").css("display") == "none"){
            $("#contentAnnonceProjetOne").slideDown("fast");
        }else{
            $("#contentAnnonceProjetOne").hide("fast");
        }
        
    });

    $("#ingsysinfra").click(function(e){
        if($("#contentAnnonceProjetTwo").css("display") == "none"){
            $("#contentAnnonceProjetTwo").slideDown("fast");
        }else{
            $("#contentAnnonceProjetTwo").hide("fast");
        }
    });

    $("#ingdev").click(function(e){
        if($("#contentAnnonceProjetThree").css("display") == "none"){
            $("#contentAnnonceProjetThree").slideDown("fast");
        }else{
            $("#contentAnnonceProjetThree").hide("fast");
        }
    });
}

this.getDivSondage = function()
{
	$("#slide").click(function(e){
		e.preventDefault();
		$("#divSondage").dialog({
            bgiframe: true,
            resizable: false,
            width: 600,
            height: 350,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            }
        });
    });
	
	$("#sondage").click(function(e){
		e.preventDefault();
		$("#divSondage").dialog({
            bgiframe: true,
            resizable: false,
            width: 600,
            height: 360,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            }
        });
	});
}

this.getInfosSondage = function()
{
	$("#submitSondage").click(function(e){
		e.preventDefault();
		//envoi des données en ajax	
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailSondage&emailContact=" + $("#emailSondage").val().toLowerCase() + "&securiser=" + $("#securiser").attr('checked') + "&reduire=" + $("#reduire").attr('checked') + "&virtualiser=" + 
			$("#virtualiser").attr('checked') + "&porter=" + $("#porter").attr('checked') + "&mes=" + $("#mes").attr('checked') + "&suggestion=" + $("#suggestion").val(),
			success: function(returnValue){
				$("#divSondage").dialog('close');
			}
		});
    });
}

this.getFormInfoDDPS = function()
{
    //quand on clique sur le lien Accès Solution
    $("#ddpsLink").click(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
            //affiche la f
            $("#divInfoDDPS").dialog({
                bgiframe: true,
                resizable: false,
                width: 500,
                height: 420,
                modal: true,
                buttons: {
                    'Valider': function(e) {
                        e.preventDefault();
                        e.preventDefault();
		//envoi des données en ajax
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailInfoDdps&nomSocieteLicence=" + $("#nomSocieteLicence").val() + "&numContratLic=" + $("#numContratLic").val() + "&saOuiNon=" + $("#saOuiNon").val() + "&nomPrenom=" +
			$("#nomPrenom").val() + "&fonctionDdps=" + $("#fonctionDdps").val() + "&emailDDPS=" + $("#emailDDPS").val() + "&telephone=" + $("#telephone").val()+ "&societe=" + $("#societe").val(),
			success: function(returnValue){
				$("#divInfoDDPS").dialog('close');
			}
		});
                    },
                    'Annuler': function() {
                        $(this).dialog('close');
                    }
                },
                overlay: {
                    backgroundColor: '#000',
                    opacity: 0.5
                }
            });
        }
        );
}

this.showProgLync = function(){
    //quand on clique sur le lien Accès Solution
    $("#programmeLync").click(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
            //affiche la f
            $("#divProgLync").dialog({
                bgiframe: true,
                resizable: false,
                width: 450,
                height: 400,
                modal: true,
                overlay: {
                    backgroundColor: '#000',
                    opacity: 0.5
                }
            });
        }
        );
}

this.showFormSem = function(){
    //quand on clique sur le lien Accès Solution
    $("#formLync").submit(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailDown&nomLync=" + $("#nomLync").val() + "&prenomLync=" + $("#prenomLync").val() + "&societeLync=" + $("#societeLync").val() + "&emailLync=" + $("#emailLync").val() + "&fonctionLync=" + $("#fonctionLync").val()
                                + "&telLync=" + $("#telLync").val() + "&attenteLync=" + $("#attenteLync").val(),
			success: function(returnValue){
                            $("#divInscripSem").hide("slow",function(){
                                $("#confirmInscript").slideToggle("slow");
                            });
			}
		});
            
        }
        );
}

this.showFormBriefHard = function(){
    //quand on clique sur le lien Accès Solution
    $("#formLync").submit(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailSemLync&nomLync=" + $("#nomLync").val() + "&prenomLync=" + $("#prenomLync").val() + "&societeLync=" + $("#societeLync").val() + "&emailLync=" + $("#emailLync").val() + "&fonctionLync=" + $("#fonctionLync").val()
                                + "&telLync=" + $("#telLync").val() + "&attenteLync=" + $("#attenteLync").val(),
			success: function(returnValue){
                            $("#divInscripSem").hide("slow",function(){
                                $("#confirmInscript").slideToggle("slow");
                            });
			}
		});
            
        }
        );
}

this.showFormCoach = function(){
    //quand on clique sur le lien Accès Solution
    $("#formLync").submit(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailCoach&nomLync=" + $("#nomLync").val() + "&prenomLync=" + $("#prenomLync").val() + "&societeLync=" + $("#societeLync").val() + "&emailLync=" + $("#emailLync").val() + "&fonctionLync=" + $("#fonctionLync").val()
                                + "&telLync=" + $("#telLync").val() + "&attenteLync=" + $("#attenteLync").val(),
			success: function(returnValue){
                            $("#divInscripSem").hide("slow",function(){
                                $("#confirmInscript").slideToggle("slow");
                            });
			}
		});
            
        }
        );
}

this.showFormAzure = function(){
    //quand on clique sur le lien Accès Solution
    $("#formLync").submit(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailAzure&nomLync=" + $("#nomLync").val() + "&prenomLync=" + $("#prenomLync").val() + "&societeLync=" + $("#societeLync").val() + "&emailLync=" + $("#emailLync").val() + "&fonctionLync=" + $("#fonctionLync").val()
                                + "&telLync=" + $("#telLync").val() + "&attenteLync=" + $("#attenteLync").val(),
			success: function(returnValue){
                            $("#divInscripSem").hide("slow",function(){
                                $("#confirmInscript").slideToggle("slow");
                            });
			}
		});
            
        }
        );
}

this.showFormSi3 = function(){
    //quand on clique sur le lien Accès Solution
    $("#formLync").submit(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailSi3&nomLync=" + $("#nomLync").val() + "&prenomLync=" + $("#prenomLync").val() + "&societeLync=" + $("#societeLync").val() + "&emailLync=" + $("#emailLync").val() + "&fonctionLync=" + $("#fonctionLync").val()
                                + "&telLync=" + $("#telLync").val() + "&attenteLync=" + $("#attenteLync").val(),
			success: function(returnValue){
                            $("#divInscripSem").hide("slow",function(){
                                $("#confirmInscript").slideToggle("slow");
                            });
			}
		});
            
        }
        );
}

this.showFormBrief = function()
{
    //quand on clique sur le lien Accès Solution
    $("#inscriptionBrief7").click(
        function(e){
            //annule l'effet normal du lien'
            e.preventDefault();
            //affiche la f
            $("#formIncriptionBrief").dialog({
                bgiframe: true,
                resizable: false,
                width: 500,
                height: 420,
                modal: true,
                buttons: {
                    'Valider': function(e) {
                        e.preventDefault();
		//envoi des données en ajax
		$.ajax({
			type: 'Post',
			url: 'model/fonction.php',
			data: "fonction=mailInscriBrief&nom7=" + $("#nom7").val() + "&prenom7=" + $("#prenom7").val() + "&societe7=" + $("#societe7").val() + "&fonction7=" + $("#fonction7").val()
                                + "&tel7=" + $("#tel7").val() + "&email7=" + $("#email7").val() + "&date7=" + $("#date7").val() + "&demi1=" + $("#demi1").attr('checked') + "&demi2=" + $("#demi2").attr('checked'),
			success: function(returnValue){
				$("#formIncriptionBrief").dialog('close');
			}
		});
                    },
                    'Annuler': function() {
                        $(this).dialog('close');
                    }
                },
                overlay: {
                    backgroundColor: '#000',
                    opacity: 0.5
                }
            });
        }
        );
}
