Merci de confirmer votre inscription depuis votre boîte mail.
", "Confirmation"); }else { jAlert("Il semblerait qu'il y ait une erreur de programmation
Veuillez prendre contact par téléphone pour signaler le bug.
", "Message d'erreur"); }}});}}return false;});}function popupcall(){$("#callbackform input[type=text],#callbackform textarea").focus(function(){ var placeholder = $(this).attr("placeholder");color(this);if ($(this).val() == placeholder) {$(this).val('');}});$("#callbackform input[type=text],#callbackform textarea").blur(function(){ var placeholder = $(this).attr("placeholder");decolor(this);if ($(this).val() == "") {$(this).val(placeholder);}});$('#callbackform_prenom').blur(function() {if ($(this).val() != "") {var part1 = $(this).val().substring(0,1).toUpperCase();var part2 = $(this).val().substring(1).toLowerCase();$(this).val(part1+part2);}});if ($("#lang_mem").val() == "fr") {$("#callbackform_tel").keyup(function(){var input_content = $(this).val();var check = input_content.replace(/ /gm,"");var number_length = input_content.length;var unicode = event.keyCode?event.keyCode:event.charCode;if (unicode != 8) {if (number_length == 2 || number_length == 5 || number_length == 8 || number_length == 11){input_content = input_content + " ";} else if (parseInt(number_length) > 14){input_content = input_content.substr(0,14);}$(this).val(input_content);}});}$("#callbackform").submit(function(){var msg = ""; if (!$("input[name=callbackform_civilite]:checked").length) { msg += "Merci de sélectionner votre civilité.\n";}if ($("#callbackform_prenom").val() == "Prénom") { msg += "Merci d'insérer votre prénom.\n";color($("#callbackform_prenom"));}if ($("#callbackform_nom").val() == "Nom") { msg += "Merci d'insérer votre nom.\n";color($("#callbackform_nom"));}if ($("#callbackform_tel").val() == "Téléphone") { msg += "Merci d'insérer votre numéro de téléphone.\n";color($("#callbackform_tel"));}if ($("#lang_mem").val() == "fr" && $("#callbackform_tel").val().length != 14) { msg += "Le numéro de téléphone doit être au format 00 00 00 00 00.\n";color($("#callbackform_tel"));}if ($("#callbackform_email").val() == "Suivez-nous") { msg += "Merci d'insérer votre adresse e-mail.\n";color($("#callbackform_email"));}if ($("#callbackform_email").val() != "Suivez-nous") { indexAroba = $("#callbackform_email").val().indexOf('@');indexPoint = $("#callbackform_email").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)) {msg += "Merci de corriger votre adresse e-mail.\n";color($("#callbackform_email"));}{ var invalidChars = " /:,;'éèàùï"; for (i=0; i -1) {msg += "Merci de corriger votre adresse e-mail.\n";color($("#callbackform_email"));} } }{ var atPos = $("#callbackform_email").val().indexOf("@",1); if ($("#callbackform_email").val().indexOf("@",atPos+1) != -1) { msg += "Merci de corriger votre adresse e-mail.\n";color($("#callbackform_email"));} }}if ($("#callbackform_msg").val() == "Raison de votre demande" || $("#callbackform_msg").val() == "") { msg += "Merci d'insérer votre adresse e-mail.\n";color($("#callbackform_msg"));}if (msg != "") { jAlert("Veuillez corriger les erreurs suivantes :\n" + msg, "Message d'erreur :");} else { if ($("#call_wait").is(":hidden")) {$("#call_wait").show();var civilite = $("input[name=callbackform_civilite]:checked").val();var nom = $("#callbackform_nom").val().toUpperCase();var prenom = $("#callbackform_prenom").val();var tel = $("#callbackform_tel").val();var mail = $("#callbackform_email").val().toLowerCase();var msgbis = $("#callbackform_msg").val();var newsletter = "no";var lang = $("#lang_mem").val();if ($("#callbackform_newsbox").is(":checked")) { newsletter = "yes"; }var totalvars = "action=callback&civilite=" + civilite + "&nom=" + encodeURIComponent(nom) + "&prenom=" + encodeURIComponent(prenom) + "&tel=" + encodeURIComponent(tel) + "&mail=" + encodeURIComponent(mail) + "&msgbis=" + encodeURIComponent(msgbis) + "&newsletter=" + newsletter + "&lang=" + lang;$.ajax({type: "GET",url: "includes/callback.php",data: totalvars,cache: false,success: function(data){$("#call_wait").hide();$("#callbackform input[type=text]").val("");$("#callbackform input[type=radio],#callbackform input[type=checkbox]").prop("checked",false);$("#callbackform input[type=text],#callbackform textarea").each(function(){var placeholder = $(this).attr("placeholder");$(this).val(placeholder);});$.colorbox.close();if (data == 1) {jAlert("Nous avons bien reçu votre demande !
Nous vous rappelerons dans les meilleurs délais,
merci de votre confiance.", "Confirmation");if (analytics == "on" && consent != "no"){_gaq.push(['_trackPageview', '/includes/tracking.php?step=callback']);if (newsletter == "yes") { _gaq.push(['_trackPageview', '/optin.html']); }}} else { jAlert("Il semblerait qu'il y ait une erreur de programmation
Veuillez prendre contact par téléphone pour signaler le bug.
", "Message d'erreur"); }}});}}return false;});}function popuprdv(){$.colorbox({inline:true,href:"#rdvshow"});if ($(".callhide").is(":visible")) {$(".callhide").hide();$(".callshow").fadeIn(500);if (analytics == "on" && consent != "no"){ _gaq.push(['_trackPageview', '/includes/tracking.php?step=call']); }}}function map_cabinet(){var cabinet = $("#zone_cabinet .selected").attr("id").replace("li_","");console.log("test:"+cabinet);var open_bayonne = $("#zone_customer").find(".open_bayonne").html();var open_biarritz = $("#zone_customer").find(".open_biarritz").html();var open_dax = $("#zone_customer").find(".open_dax").html();var open_stpierre = $("#zone_customer").find(".open_stpierre").html();$(".map_wzone .sprite").html(".");$("#map_wzone").find(".open_bayonne").html(open_bayonne);$("#map_wzone").find(".open_biarritz").html(open_biarritz);$("#map_wzone").find(".open_dax").html(open_dax);$("#map_wzone").find(".open_dax").html(open_stpierre);$("#map_wzone_"+cabinet).show();$(".map_place").removeClass("selected");$("#map_place_"+cabinet).addClass("selected");if (cabinet == "bayonne") {$("#map_zone").append('');} else if (cabinet == "biarritz") {$("#map_zone").append('');} else if (cabinet == "dax") {$("#map_zone").append('');} else if (cabinet == "stpierre") {$("#map_zone").append('');}$(".map_info_cabinet").hide();$("#map_info_"+cabinet).fadeIn(500);$(".map_place").click(function(){var test = $(this).attr("class");var cabinet = $(this).attr("id").replace("map_place_","");$(".map_wzone").hide();$("#map_wzone_"+cabinet).show();if (test != "map_place selected" && test != "selected map_place") {$(".map_place").removeClass("selected");$("#map_place_"+cabinet).addClass("selected");$(".map_info_cabinet").hide();$("#map_info_"+cabinet).fadeIn(500);$("#map_zone iframe").remove();if (cabinet == "bayonne") {$("#map_zone").append('');} else if (cabinet == "biarritz") {$("#map_zone").append('');} else if (cabinet == "dax") {$("#map_zone").append('');} else if (cabinet == "stpierre") {$("#map_zone").append('');}}});}function open_cabinet(){$.ajax({type:"GET",url:path+"includes/timediff.php",data:"action=opencheck",cache:false,success:function(data){if (data != "") {data = data.split("[BRK]");$(".open_stpierre").html(data[3]);}}});setTimeout("open_cabinet()",30000);}function hackmail(){$.ajax({type:"GET",url:path+"includes/hackmail.php",data:"action=check",cache:false,success:function(data){if ($(".hackmail").length){$(".hackmail").attr("href","mailto:"+data);$(".hackmail").html(data);}},});}function infoCookie(){jAlert("Le site n'utilise pas de cookie, aucune statistique de visite n’est enregistrée.", "INFORMATION");}$(document).ready(function(){ navigation();var page_en_cours = window.location.href.replace("https://www.atlantic-pathologie.fr/", "");if (page_en_cours == "contact.html") {contact();map_cabinet();}else if (page_en_cours == "cabinets-fr.html") { map_cabinet(); }else if (page_en_cours == "login.html") { login(); }else if (page_en_cours == "espacepro.html") { espacepro(); }}); function cookieCheck(){var consent = $("#consent_mem").val();var analytics = $("#analytics").val();var path = "/";if (consent == "unset"){if ((navigator.doNotTrack&&(navigator.doNotTrack=='yes'||navigator.doNotTrack=='1'))||(navigator.msDoNotTrack&&navigator.msDoNotTrack==1)||(window.DoNotTrack&&window.DoNotTrack==1)){$.get(path+"config/cookie.php",{action:"consent",consent:"no"});$("#consent_mem").val("no");$.get(path+"config/cookie.php",{action:"del_session"});} else {$.colorbox({inline:true,href:"#cookiePopup",className:"cookiePopup",escKey:false,overlayClose:false,closeButton:false});}} else if (consent != "no"){if (analytics == "on"){ _gaq.push(['_trackPageview']); }$(".off-img").addClass("hide");$(".on-img").removeClass("hide");$("#accept_analytics").html("Je refuse");} else {$(".on-img").addClass("hide");$(".off-img").removeClass("hide");$("#accept_analytics").html("J'accepte");$("#accept_analytics").addClass("switch-off");$.get(path+"config/cookie.php",{action:"del_session"});}$("#cookiego").click(function(){$.colorbox({inline:true,href:"#cookiePopup",className:"cookiePopup",escKey:false,overlayClose:false,closeButton:false});return false;});$("#personalize-analytics").click(function(){$.colorbox({inline:true,href:"#analyticsPopup",className:"analyticsPopup",escKey:false,overlayClose:false,closeButton:false});return false;});$("#go_back_cookie").click(function(){$.colorbox({inline:true,href:"#cookiePopup",className:"cookiePopup",escKey:false,overlayClose:false,closeButton:false});return false;});$("#accept_analytics").click(function(){$(this).toggleClass("switch-off");$(".google-analytics .on-off-switch img").toggleClass("hide");if($(this).hasClass("switch-off")){$(this).text("J'accepte");} else {$(this).text("Je refuse");}});$(".google-analytics .on-off-switch").click(function(){$(".google-analytics .on-off-switch img").toggleClass("hide");$("#accept_analytics").toggleClass("switch-off");if($("#accept_analytics").hasClass("switch-off")){$("#accept_analytics").text("J'accepte");} else {$("#accept_analytics").text("Je refuse");}});$(".cboxClose").click(function(){var id = $(this).attr("id");var consent = "yes";var consent_mem = $("#consent_mem").val();if (id == "consentNO"){ consent = "no"; }else if (id == "consentFINISH" && $(".on-img").hasClass("hide")){ consent = "no"; }if (consent == "no"){ $.get(path+"config/cookie.php",{action:"del_session"}); }if (consent == "yes"){$(".on-img").removeClass("hide");$(".off-img").addClass("hide");$("#accept_analytics").html("Je refuse");} else {$(".on-img").addClass("hide");$(".off-img").removeClass("hide");$("#accept_analytics").html("J'accepte");}$.colorbox.close();$.ajax({type:"GET",url:path+"config/cookie.php",data:"action=consent&consent="+encodeURIComponent(consent) + "&consent_mem="+encodeURIComponent(consent_mem),success:function(data){if (consent == "yes"){ $("#consent_mem").val(data); } else { $("#consent_mem").val("no"); }if (consent == "yes" && analytics == "on"){ _gaq.push(['_trackPageview']); } }});});}function navigation(){$("a.ajax").click(function(){ var text = $(this).attr("href");if (text != "/") { text = text.replace("https://www.atlantic-pathologie.fr/", ""); text = text.replace("/", ""); }if (text == "") { text = "/"; }text = "#!/" + text;$(location).attr('href',text);return false;});function nav() {$("#content a.ajax, #ariane a.ajax").click(function(){ var text = $(this).attr("href");if (text != "/") { text = text.replace("https://www.atlantic-pathologie.fr/", ""); text = text.replace("/", ""); }if (text == "") { text = "/"; }text = "#!/" + text;$(location).attr('href',text);return false;});}$("a").click(function(){$(this).blur();});$(window).hashchange(function(){var lang = "fr";var type = "";var url = window.location.hash.substring(3);if (url == "") { url = $("#page_mem").val(); }var dest1 = url.indexOf("-" + lang + ".html");var dest2 = url.indexOf("-blog-" + lang + "-");var dest3 = url.indexOf("-bcat-" + lang + "-");var dest4 = url.indexOf("-cat-" + lang + "-");var dest5 = url.indexOf("-scat-" + lang + "-");var dest6 = url.indexOf("-col-" + lang + "-");var dest7 = url.indexOf("-prod-" + lang + "-");if (dest1 >= 0) { type = "page"; }else if (url == "/" || url == "fr") { type = "page"; }else if (dest2 >= 0) { type = "blog"; }else if (dest3 >= 0) { type = "bcat"; }else if (dest4 >= 0) { type = "cat"; }else if (dest5 >= 0) { type = "scat"; }else if (dest6 >= 0) { type = "col"; }else if (dest7 >= 0) { type = "prod"; }else { type = "template"; }if (url == "blog" || url == "blog-" + lang + "") { type = "bcat"; }var clicpage = url;if (clicpage == "/") {var nextpage = clicpage;} else {var nextpage = "/" + clicpage;}var totalvars = "cookie=&" + type+"=" + url + "&lang=fr";if (clicpage == "espacepro.html") { window.location.href = "espacepro.html"; return; }if (clicpage != "#") {if (!($("#nav_loading").length)) {$("#content_middle").html('
chargement en cours...
');}setTimeout(function(){var page_top = $("body").offset().top;$("html,body").animate({scrollTop:page_top}, 1000);}, 100);if (clicpage != "legal.html") { cookie_agreement(); }if (clicpage == "/"){ $("#slider").fadeIn(500); $("body").addClass("homepage"); } else { $("#slider").hide(); $("body").removeClass("homepage"); }$.ajax({type: "GET",url:path+"includes/content.php",data: totalvars,cache: false,success: function(data){data = data.split('[BRK]');$("#content_middle").hide();$("#content_middle").html(data[0]); $("title").text(data[1]); nav(); hackmail();$("#content_middle").fadeIn(1000);if (clicpage == "contact.html") { contact(); map_cabinet(); var status = $("#zone_customer .open_stpierre").html(); $(".open_stpierre").html(status); } if ($("#content_middle").find("#rdv").length) { $("#rdv").click(function(){ popuprdv(); }); }if (clicpage == "cabinets-fr.html") { map_cabinet(); var status = $("#zone_customer .open_stpierre").html(); $(".open_stpierre").html(status); }if (clicpage == "espacepro.html") { window.location.href = "espacepro.html"; }if(clicpage=="login.html"){ login(); }if (analytics == "on" && consent != "no") {} }});}}); if(window.location.hash.substring(3) != "" && window.location.hash.substring(3) != "#") { $("#content_middle").html('
chargement en cours...
');setTimeout('$(window).trigger("hashchange")', 1000); }$("a.ajax").click(function () {var lastlink = window.location.hash;var nextlink = $(this).attr('href');if (lastlink == nextlink) {$(window).trigger("hashchange");}});}function contact(){$("#icon_tel2").click(function(){$(this).hide();$(".callhide").hide();$(".callshow").fadeIn(500);$($("#icon_tel")).fadeIn(500);if (analytics == "on" && consent != "no") { _gaq.push(['_trackPageview', '/includes/tracking.php?step=call']); }});if ($(".callshow").is(":visible")) {$("#icon_tel2").hide();$($("#icon_tel")).fadeIn(500);}$("#contact_form input,#contact_form select,#contact_form textarea").focus(function() { color(this); });$("#contact_form input,#contact_form select,#contact_form textarea").blur(function() { decolor(this); });$("#contact_prenom").blur(function() { if ($(this).val() != "") { var part1 = $(this).val().substring(0, 1).toUpperCase(); var part2 = $(this).val().substring(1); $(this).val(part1+part2); } });$('#contact_news_box').click(function() {if ($(this).attr('src') == "template/webtao/images/box1.png") {$(this).attr('src', 'template/webtao/images/box2.png');$('#contact_news').val('on');} else {$(this).attr('src', 'template/webtao/images/box1.png');$('#contact_news').val('off');}});if ($("#lang_mem").val() == "fr") {$("#contact_tel").keyup(function(){var input_content = $(this).val();var check = input_content.replace(/ /gm,"");var number_length = input_content.length;var unicode = event.keyCode?event.keyCode:event.charCode;if (unicode != 8) {if (number_length == 2 || number_length == 5 || number_length == 8 || number_length == 11){input_content = input_content + " ";} else if (parseInt(number_length) > 14){input_content = input_content.substr(0,14);}$(this).val(input_content);}});}$("#contact_submit").find("a").click(function(){$("#form_contact").submit();return false;});$("#form_contact").submit(function(){ var msg = ""; if ($("#contact_civility input[type=radio]:checked").length == 0) { msg += "Merci de sélectionner votre civilité.\n";}if ($("#contact_nom").val() == "") { msg += "Merci d'insérer votre nom.\n";color($("#contact_nom"));}if ($("#contact_prenom").val() == "") { msg += "Merci d'insérer votre prénom.\n";color($("#contact_prenom"));}if ($("#contact_tel").val() == "") { msg += "Merci d'insérer votre numéro de téléphone.\n";color($("#contact_tel"));}if ($("#lang_mem").val() == "fr" && $("#contact_tel").val().length != 14 && $("#contact_tel").val().length != 0) { msg += "Le numéro de téléphone doit être au format 00 00 00 00 00.\n";color($("#contact_tel"));}if ($("#contact_email").val() == "") { msg += "Merci d'insérer votre adresse e-mail.\n";color($("#contact_email"));}if ($("#contact_email").val() != "") { indexAroba = $("#contact_email").val().indexOf('@');indexPoint = $("#contact_email").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)) {msg += "Merci de corriger votre adresse e-mail.\n";color($("#contact_email"));} }{ var invalidChars = " /:,;'éèàùï"; for (i=0; i -1) {msg += "Merci de corriger votre adresse e-mail.\n";color($("#contact_email"));} } }{ var atPos = $("#contact_email").val().indexOf("@",1); if ($("#contact_email").val().indexOf("@",atPos+1) != -1) { msg += "Merci de corriger votre adresse e-mail.\n";color($("#contact_email"));} }if ($("#contact_message").val() == "") { msg += "Merci d'écrire votre demande.\n";color($("#contact_message"));}if ($("#contact_spam").val() == "" || $("#contact_spam").val() != "10") { msg += "Merci de réaliser le test anti-spam.\n";color($("#contact_spam"));}if (msg != "") { jAlert("Veuillez corriger les erreurs suivantes :\n" + msg, "Message d'erreur");} else { $('#contact_wait').show();var civilite = $("#contact_civility input[type=radio]:checked").val();var nom = $("#contact_nom").val().toUpperCase();var prenom = $("#contact_prenom").val();var tel = $("#contact_tel").val();var company = $("#contact_company").val();if (company == "Société") { company = ""; }var mail = $("#contact_email").val().toLowerCase();var folder = $("#contact_folder").val();var msgbis = $("#contact_message").val();var newsletter = "no";var lang = $("#lang_mem").val();if ($("#contact_news_box").is(":checked")) { newsletter = "yes"; }var totalvars = "action=contact&civilite=" + civilite + "&nom=" + encodeURIComponent(nom) + "&prenom=" + encodeURIComponent(prenom) + "&tel=" + encodeURIComponent(tel) + "&company=" + encodeURIComponent(company) + "&mail=" + encodeURIComponent(mail) + "&newsletter=" + newsletter + "&folder=" + encodeURIComponent(folder) + "&msgbis=" + encodeURIComponent(msgbis) + "&lang=" + lang;$.ajax({type: "GET",url: "/includes/contact.php",data: totalvars,cache: false,success: function(data){if(data != 1) {jAlert("Il semblerait qu'il y ait une erreur de programmation
Veuillez prendre contact par téléphone pour signaler le bug.", "Message d'erreur");} else if (data == 1){$("#contact_message").val("Votre demande a été envoyée");if (analytics == "on" && consent != "no") {}jAlert('Nous avons bien reçu votre demande !
Nous vous répondrons dans les meilleurs délais,
merci de votre confiance.', 'Confirmation');$("#contact_news_box,input[name=civility]").prop("checked",false);$("#form_contact input[type=text],#form_contact textarea").val("");$("#attach1,#attach2,#attach3,.icon_delete").hide();if ($("#attach").is(":hidden")){ $("#attach").show(); }$.get("/includes/dropzone.php",{action:"contact_delete",number:1});$.get("/includes/dropzone.php",{action:"contact_delete",number:2});$.get("/includes/dropzone.php",{action:"contact_delete",number:3});$("#contact_attach").val(1);}$('#contact_wait').hide();}});}return false;});$.ajax({type:"GET",url:path+"includes/dropzone.php",data:"action=contact_check",cache:false,success:function(data){data = data.split("[BRK]");if(data[0] == 1){ $("#attach1").show(); }if(data[1] == 1){ $("#attach2").show(); }if(data[2] == 1){ $("#attach3").show(); }var total = parseInt(data[0])+parseInt(data[1])+parseInt(data[2]);$("#attach"+total+" .icon_delete").show();$("#contact_attach").val(parseInt(total)+1);if (total == 3) { $("#attach").hide(); }$("#attach1 a").attr("href","upload/"+data[3]);$("#attach2 a").attr("href","upload/"+data[4]);$("#attach3 a").attr("href","upload/"+data[5]);}});Dropzone.options.attach={maxFilesize:3,acceptedFiles:"image/jpeg,application/pdf",init:function(){this.on("addedfile",function(file){var id = $("#contact_attach").val();$("#attach").hide();$("#attach"+id).show();$("#attach"+id+" .progress span").html(0);$("#attach"+id+" .progress").show();});this.on("error",function(file){var id = $("#contact_attach").val();$("#attach"+id).hide();$("#attach"+id+" .progress").hide();$("#attach").show();jAlert("Veuillez joindre un document JPG ou PDF (3 Mo max).", "Message d'erreur");});this.on("uploadprogress",function(file,progress){var id = $("#contact_attach").val();$("#attach"+id+" .progress span").html(parseInt(progress));});this.on("success", function(file, response){var id = $("#contact_attach").val();$("#attach"+id+" .progress").hide();$("#attach"+id+" .icon_delete").show();if (id != 3) { $("#attach").show(); }$("#contact_attach").val(parseInt(id)+1);$("#attach"+(parseInt(id)-1)+" .icon_delete").hide();$("#attach"+id+" a").attr("href","upload/"+response);});}};$("#attach").dropzone({url:path+"includes/dropzone.php?action=contact_transfer"});$(".icon_delete").click(function(){var number = $(this).parent().attr("id").replace("attach","");var id = $("#contact_attach").val();$.ajax({type:"GET",url:path+"includes/dropzone.php",data:"action=contact_delete&number="+number,cache:false,success:function(data){data = data.split("[BRK]");if(data == 1){$("#attach"+number).find(".icon_delete").hide();$("#attach"+number).find(".icon_progress").show();$("#attach"+number).fadeOut(500);if (id == 4) { $("#attach").show(); }$("#contact_attach").val(parseInt(id)-1);$("#attach"+(parseInt(id)-2)+" .icon_delete").show();}}});});}function login(){$("#slider").hide();$("#header").css("border-bottom","1px solid #e1e1e1");$("#mail").blur(function(){logincheck()});$("#mdp").blur(function(){passcheck()});$('#login_auto span').click(function(){if ($('#login_box1').is(":visible")) {$('#login_box1').hide();$('#login_box2').show();$('#autologin').val('yes');} else {$('#login_box1').show();$('#login_box2').hide();$('#autologin').val('no');}});$("#login").submit(function(){var test1 = $("#mail").val();var test2 = $("#mdp").val();var auto = "no"; if ($("#checkbox").is(":checked")){auto = "yes"}var totalvars = "mail=" + encodeURIComponent(test1) + "&pass=" + encodeURIComponent(test2) + "&autologin=" + auto + "&action=login&lang=fr";if ($('#mail').val() != '' && $('#mdp').val() != '') {$.ajax({type: "POST",url: "includes/login.php",data: totalvars,success: function(data){ data = data.split("[BRK]"); if (data[0] == 1) { window.location.href = "espacepro.html"; $("#customer_session").val("on"); $("#id_customer").val(data[5]); $("#h_menu .menu:nth-child(6)").show(); $("#h_menu .menu:nth-child(4),#h_menu .menu:nth-child(5)").hide(); }}});}return false;});$("#login_oubli").colorbox({inline:true, href:"#password"});$("#login_oubli").click(function() { $("#password_part1").show();$("#password_part2").hide();$("#password_mail").val('');$("#password_new").val('');$("#password_conf").val('');$("#password_send").show();$("#password_wait").hide();}); $("#password_form").find('input[type=text]').focus(function() {$(this).css("background-color", "#dcdcdc");});$("#password_form").find('input[type=password]').focus(function() {$(this).css("background-color", "#dcdcdc");});$("#password_send").click(function() { var msg = "";var mail = $("#password_mail").val();if ($("#password_mail").is(':visible')){ if ($("#password_mail").val() == ""){ msg += "Veuillez saisir votre adresse e-mail.\n";$("#password_mail").css("background-color", "#2db6e8");}if ($("#password_mail").val() != ""){ indexAroba = $("#password_mail").val().indexOf('@');indexPoint = $("#password_mail").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)){msg += "Votre adresse e-mail est invalide.\n";$("#password_mail").css("background-color", "#2db6e8");} }{ var atPos = $("#password_mail").val().indexOf("@",1); if ($("#password_mail").val().indexOf("@",atPos+1) != -1) { msg += "Votre adresse e-mail est invalide.\n";$("#password_mail").css("background-color", "#2db6e8");} }}if ($("#password_new").val() == ""){msg += "Veuillez saisir un nouveau mot de passe.\n";$("#password_new").css("background-color", "#2db6e8");}var strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");if (!strongRegex.test($("#password_new").val())){msg += "Veuillez définir un mot de passe plus complexe (voir mention sécurité).\n";$("#password_new").css("background-color", "#2db6e8");}if ($("#password_conf").val() == "") { msg += "Veuillez confirmer votre nouveau mot de passe.\n";$("#password_conf").css("background-color", "#2db6e8");}if ($("#password_conf").val() != $("#password_new").val()){ msg += "Les mots de passe ne sont pas identiques.\n";$("#password_new").css("background-color", "#2db6e8");$("#password_conf").css("background-color", "#2db6e8");}var mail = $("#password_mail").val();var mdp = $("#password_new").val();if (msg == "") { $("#password_send").hide();$("#password_wait").show();totalvars = "mail=" + encodeURIComponent(mail) + "&password=" + encodeURIComponent(mdp) + "&lang=fr";$.ajax({type: "POST",url: "includes/login.php",data: totalvars,cache: false,success: function(data){if (data == 1) { jAlert("Vous n'êtes pas enregistré(e) dans notre base de données.
Merci de corriger votre adresse e-mail
ou de nous contacter par e-mail.", "Message d'information");$("#password_send").show();$("#password_wait").hide();} else if (data == 2) { $("#password_part1").hide();$("#password_part2").fadeIn(1000);setTimeout('$("#password_send").show()', 2000);setTimeout('$("#password_wait").hide()', 2000);}}});} else { jAlert("Merci de corriger les erreurs suivantes :\n"+msg, "Message d'information");}return false;});}function logincheck(){if ($("#mail").val() != ''){var test = $("#mail").val();$.ajax({type: "POST", url: "includes/login.php",data: "mail=" + test + "&action=checkmail&lang=fr",success: function(msg){if(msg==1) { $('#mail_ok').show(); $('#mail_error').hide(); } else { if (test != "") { $('#mail_error').show(); $('#mail_ok').hide(); } }}});} }function passcheck(){if ($("#mail").val() != ''){var test1 = $("#mail").val();var test2 = $("#mdp").val();$.ajax({type: "POST",url: "includes/login.php",data: "mail=" + test1 + "&pass=" + test2 + "&action=checkpass&lang=fr",success: function(msg){ if(msg==1) { $('#mdp_ok').show(); $('#mdp_error').hide(); } else { $("#mdp_error").show(); $("#mdp_ok").hide();}}});}}function espacepro(){$("#slider").hide();$("#header").css("border-bottom","1px solid #e1e1e1");$("#prospace_folders .level1-").last().prepend('');$("#prospace_new span").click(function(){if ($("#prospace_folders .selected").parent().find("ul").length){var classname = $("#prospace_folders .selected").parent().find("ul").first().find("li").first().attr("class");var id = $("."+classname).last().attr("id");var path = $("#prospace_folders .selected").attr("id")+"-nouveau";var nextone = parseInt(id.split("-").pop()) + 1;var parts = id.split("-");var param1 = classname+nextone;var param2 = classname;var param3 = classname.replace("level","")+nextone;var loop_check = "off";$("."+classname).each(function(){var labelname = $(this).find(".name span").html();if (labelname == "nouveau"){ loop_check = "on"; }});if (loop_check == "off"){$("#prospace_folders .selected").parent().find("ul").first().append('');setTimeout(function(){ $("#"+path+" input").select(); },300);} else {jAlert("Veuillez d'abord renommer le dossier « nouveau ».","ERREUR",function(answer){if (answer){ $("#"+path+" input").select(); }});}} else {var id = $("#prospace_folders .selected").parent().attr("id");var parts = id.split("-");if (parts[2] == undefined){var path = $("#prospace_folders .selected").attr("id")+"-nouveau";var param1 = id+"-1";var param2 = id+"-";var param3 = id.replace("level","")+"-1";var classname = $("#prospace_folders .selected").parent().find("ul").first().find("li").first().attr("class");var loop_check = "off";$("."+classname).each(function(){var labelname = $(this).find(".name span").html();if (labelname == "nouveau"){ loop_check = "on"; }});if (loop_check == "off"){$("#prospace_folders .selected").parent().append('');setTimeout(function(){ $("#"+path+" input").select(); },300);} else {jAlert("Veuillez d'abord renommer le dossier « nouveau ».","ERREUR",function(answer){if (answer){ $("#"+path+" input").select(); }});}} else { jAlert("Impossible de créer un sous-dossier !","INFORMATION"); }}$("#"+path+" span").hide();$("#"+path+" input").show();$("#prospace_folders .cachebottomleft").remove();$("#prospace_folders .level1-").last().prepend('');});$("#prospace_trash span").click(function(){var id = $("#prospace_folders .selected").parent().attr("id").replace("level","");var folder_name = $("#level"+id+" .name span").html();if (id != 1){jConfirm("Êtes-vous sûr de vouloir supprimer
le dossier « "+folder_name+" » ?","CONFIRMATION",function(answer){if(answer){$("#prospace_folders .selected").parent().fadeOut(500,function(){$(this).remove()});setTimeout(function(){if (!$("#prospace_folders .cachebottomleft").length){$("#prospace_folders .level1-").last().prepend(''); }},700);var path = $("#title").html().replace(/\ > /g,'/').replace(/\ /g,'_');var folderParentPath = path.replace("/"+folder_name,"");var folderParentName = folderParentPath.replace("documents-téléchargeables/","");$.get("/includes/espacepro.php",{action:"deletefolder",path:path});open_path(folderParentPath);setTimeout(function(){if ($("#prospace_folders .selected").parent().find("ul").length && !$("#prospace_folders .selected").parent().find("ul li").length){$("#prospace_folders .selected").parent().find("ul").remove();}},600);}});} else { jAlert("Impossible de supprimer le dossier « documents-téléchargeables »","INFORMATION"); }});$("#prospace_edit span").click(function(){var id = $("#prospace_folders .selected").parent().attr("id").replace("level","");var folder_name = $("#level"+id+" .name").html();if (id != 1){$("#prospace_folders .selected input").show().select();$("#prospace_folders .selected span").hide();$("#prospace_folders .name").removeClass("selected");} else { jAlert("Impossible de renommer le dossier « documents-téléchargeables »","INFORMATION"); }});open_path("documents-téléchargeables");var path = $("#title").html().replace(/\ > /g,'/');Dropzone.options.droparea={maxFilesize:150,init:function(){this.on("sending", function(file,xhr,data){var path = $("#title").html().replace(/\ > /g,'/');data.append("path",path);});this.on("dragover",function(file){$("#droparea").css("border","1px dotted #888");});this.on("dragleave",function(file){$("#droparea").css("border","1px solid transparent");});this.on("addedfile",function(file){$("#droparea span").html('
');$("#droparea").css("border","1px solid transparent");});this.on("error",function(file){jAlert("Veuillez insérer un fichier compatible jpg, png, gif, pdf (150 Mo max).","Message d'erreur");});this.on("success",function(file,data){if (data == 1){$("#droparea span").html("upload");var path = $("#title").html().replace(/\ > /g,'/').replace(/\ /g,'_');var folder_name = $("#title").html();open_path(path);}});}};$("#droparea").dropzone({url:"includes/upload.php"});$("#prospace_user").click(function(){$("#prospace_users").fadeIn(500);$("#prospace_files").hide();});$("#prospace_users_new").click(function(){$("#prospace_users_form").fadeIn(500);});$("#prospace_users_cancel").click(function(){$("#prospace_users_form").fadeOut(500);});$("#prospace_users_save").click(function(){var inputCheck = "on";var errorMessage = "Veuillez remplir tous les champs du formulaire.";$("#prospace_users_form input[type=text]").each(function(){var inputValue = $(this).val();var inputId = $(this).attr("id");if (inputValue == "" || inputValue == "__ __ __ __ __"){inputCheck = "off";color(this);} else if (inputId == "email" && validateEmail(inputValue) == "ERROR"){if (inputCheck == "off"){errorMessage = "Veuillez remplir tous les champs du formulaire
et vérifier votre adresse e-mail.";} else {errorMessage = "Veuillez vérifier votre adresse e-mail.";}inputCheck = "off";color(this);}});if (inputCheck == "on"){var lastname = $("#nom").val().toUpperCase();var firstname = $("#prenom").val();var email = $("#email").val().toLowerCase();var status = $("input[name=status]:checked").val();$.ajax({type:"GET",url:"includes/espacepro.php",data:"action=newUser&lastname="+encodeURIComponent(lastname) + "&firstname="+encodeURIComponent(firstname) + "&email="+encodeURIComponent(email) + "&status="+encodeURIComponent(status),success:function(data){data = data.split("[BRK]");if (data[0] == 1){$("#usersList").prepend(''+lastname+' '+firstname+' / '+email+' / '+status+'
');$("#prospace_users_form").hide();$("#prospace_users_form input[type=text]").val("");} else if (data[0] == "stop"){jAlert("Utilisateur déjà enregistré.","MESSAGE D'ERREUR");}}});} else {jAlert(errorMessage,"MESSAGE D'ERREUR");}});}function folder_open(id){if (id != 1){if ($("#level"+id).has("ul") && $("#level"+id+" ul").is(":hidden")){$("#level"+id+" ul").show();} else if ($("#level"+id).has("ul") && $("#level"+id+" ul").is(":visible") && $("#level"+id+" .name").first().hasClass("selected")){$("#level"+id+" ul").hide()}}var folder_name = $("#level"+id+" .name").first().find("span").html().replace(/\ /g,'_');var path = "documents-téléchargeables";if ($("#level"+id).parent().parent().find(".name").length && $("#level"+id).parent().parent().find(".name").find("span").html() != "documents-téléchargeables"){path += "/"+$("#level"+id).parent().parent().find(".name span").html().replace(/\ /g,'_')+"/"+folder_name;} else if (folder_name != "documents-téléchargeables"){path += "/"+folder_name;}open_path(path);}function open_path(path){$("#prospace_files").fadeIn(500);$("#prospace_users").hide();$("#title").html(path.replace(/\//g," > ").replace(/\_/g," "));$("#prospace_folders .name").removeClass("selected");setTimeout(function(){$("#"+path.replace(/\//g,'-')).addClass("selected")},100);$.ajax({type:"GET",url:"includes/espacepro.php",data:"action=folder_content&path="+encodeURIComponent(path),success:function(data){ data = data.split("[BRK]"); if (data[0] == 1) { $("#prospace_files .folder,#prospace_files .file").remove(); $("#prospace_files ul").append(data[1]); }}});}function createFolder(level){var path = $("#"+level+" .name").first().attr("id");var newname = $("#"+path+" input").val().replace(/\ /g,'_');var oldname = $("#"+path+" span").html();var action = "newfolder"; if (oldname != ""){ action = "editfolder"; } else { oldname = "nouveau"; }var folderClass = $("#"+level).attr("class");var checkName = "off";$("."+folderClass+" .name span").each(function(){var checkContent = $(this).html();if (checkContent == newname && newname != oldname){ checkName = "on"; }});if (checkName == "off"){$("#"+path+" input").hide();path = path.replace(/\-/g,'/').replace("documents/téléchargeables","documents-téléchargeables");$.ajax({type:"GET",url:"includes/espacepro.php",data:"action="+action+"&path="+path+"&oldname="+oldname+"&newname="+newname,success:function(data){ if (data == 1){ open_path(path.replace('/'+oldname,'/'+newname)); $("#"+level+" .name").first().attr("id",path.replace(/\//g,'-').replace('-'+oldname,'-'+newname)); $("#"+path.replace(/\//g,'-').replace('-'+oldname,'-'+newname)+" span").html(newname.replace(/\_/g,' ')).show(); $("#"+path.replace(/\//g,'-').replace('-'+oldname,'-'+newname)+" input").val(newname.replace(/\_/g,' ')); if ($("#"+path.replace(/\//g,'-').replace('-'+oldname,'-'+newname)).parent().find("ul li").length){ $("#"+path.replace(/\//g,'-').replace('-'+oldname,'-'+newname)).parent().find("ul li .name").each(function(){var id = $(this).attr("id").replace('-'+oldname,'-'+newname);$(this).attr("id",id);}); } }}});} else {jAlert("Veuillez donner un autre nom à votre dossier.","ERREUR",function(answer){if (answer){ $("#"+level+" .name input").select(); }});}}function deleteFile(path,fileName){jConfirm("Êtes-vous sûr de vouloir supprimer
le fichier « " + fileName + "».","ERREUR",function(answer){if (answer){$("#"+fileName.replace(/\./g,'-')).fadeOut(500,function(){$(this).remove()});$.get("/includes/espacepro.php",{action:"deleteFile",path:path});}});}function validateEmail(email){var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var result = "ERROR";if(regex.test(email)){ result = "GOOD"; }return result;}function userTrash(id){var userName = $("#name"+id).html();jConfirm("Êtes-vous sûr de vouloir supprimer
l'utilisateur « " + userName + "».","ERREUR",function(answer){if (answer){$("#user"+id).fadeOut(500,function(){$(this).remove()});$.get("/includes/espacepro.php",{action:"userTrash",id:id});}});}function userSend(id){var userName = $("#name"+id).html();jConfirm("Êtes-vous sûr de vouloir envoyer les
identifiants à l'utilisateur « " + userName + "».","ERREUR",function(answer){if (answer){var imgSrc = $("#user"+id+" .userSend").attr("src").replace("plane1","plane2");$("#user"+id+" .userSend").attr("src",imgSrc);$.get("/includes/espacepro.php",{action:"userSend",id:id});jAlert("Identifiants envoyés !","CONFIRMATION");}});}