var message_erreur = ""; var boutons_actifs = false; var boutons_actifs2 = false; var boutons_actifs3 = false; var bouton_actif_scroll = false; var nb_sliders = 0; var clear_timeout1 = -1; var clear_timeout2 = -1; var clear_timeout3 = -1; var clear_timeout4 = -1; var timeout_scroll = -1; var timing_diaporama = 3000; var libelles_js = {'lire_suite_fr': "Lire la suite", 'lire_suite_en': "Read more", 'fermer_fr': "Fermer", 'fermer_en': "Close", }; window.onload = function() { check_resize(); maj_menu(); // ANCRE if(window.location.hash) { $(document).scrollTop( $(window.location.hash).offset().top ); } } $(document).ready(function () { // RESIZE $(window).resize(function() { check_resize(); maj_menu(); }); check_resize(); maj_menu(); boutons_actifs = true; boutons_actifs2 = true; boutons_actifs3 = true; bouton_actif_scroll = true; // COOKIE if($("div.panneau_cookie").length == 1) { setTimeout(function() { $("div.panneau_cookie").css({display:'block'}); $("div.panneau_cookie").css({bottom:(-$("div.panneau_cookie").outerHeight())+'px'}); $("div.panneau_cookie").animate({bottom:'0'}, 350, 'easeOutQuad'); }, 800); } // ANCRE if(window.location.hash) { $(document).scrollTop( $(window.location.hash).offset().top ); } // RETOUR TOP $(document).scroll(function() { if(bouton_actif_scroll) { $(".retour_haut").stop().fadeIn(300); clearTimeout(timeout_scroll); timeout_scroll = setTimeout(function() { $(".retour_haut").stop().fadeOut(300); }, 1500); } }); $(".retour_haut").hover(function() { if(bouton_actif_scroll) { $(this).show(); clearTimeout(timeout_scroll); } }, function() { timeout_scroll = setTimeout(function() { $(".retour_haut").stop().fadeOut(300); }, 1000); }); }); function scroll_top_website() { var body = $("html, body"); bouton_actif_scroll = false; body.stop().animate({scrollTop:0}, 500, 'swing', function() { $(".retour_haut").fadeOut(300, function() { bouton_actif_scroll = true; }); }); } /* INIT DIAPORAMA */ function init_diaporama(type_diaporama, id_bloc) { clear_timeout1 = setTimeout(function() { next_diaporama(type_diaporama, id_bloc)}, timing_diaporama); } function next_diaporama(type_diaporama, id_bloc) { if(type_diaporama == 'a') { var next_val = $("#bloc_cryo"+id_bloc+" .navigation li.li_nav").closest('.selected').index() + 1; if(next_val >= $("#bloc_cryo"+id_bloc+" .navigation li.li_nav").length) { next_val = 0; } change_diaporama(id_bloc, 'a', next_val, false); clear_timeout1 = setTimeout(function() { next_diaporama(type_diaporama, id_bloc)}, timing_diaporama); } } function change_diaporama(id_bloc, type_bloc, val, user_action) { switch(type_bloc) { case 'a': if(boutons_actifs2 && !$("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo").eq(val).hasClass('selected')) { if(user_action) { clearTimeout(clear_timeout1); clear_timeout1 = setTimeout(function() { next_diaporama('a', id_bloc)}, timing_diaporama); } boutons_actifs2 = false; $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo.selected").css({zIndex:'11'}); $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo").eq(val).css({zIndex:'12'}); $(".navigation .li_nav.selected").removeClass('selected'); $(".navigation .li_nav").eq(val).addClass('selected'); if($("#bloc_cryo"+id_bloc+" .liste_textes_bloc").length > 0) { $("#bloc_cryo"+id_bloc+" .liste_textes_bloc .li_texte.selected").fadeOut(150, function() { $("#bloc_cryo"+id_bloc+" .liste_textes_bloc .li_texte").eq(val).fadeIn(150, function() { $("#bloc_cryo"+id_bloc+" .liste_textes_bloc .li_texte.selected").removeClass('selected'); $(this).addClass('selected'); }); }); } $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo").eq(val).fadeIn(300, function() { $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo.selected").hide(); $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo.selected").removeClass('selected'); $(this).addClass('selected'); boutons_actifs2 = true; }); } break; case 's': var next_val = $("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").closest('.selected').index() + Number(val); if(next_val >= $("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").length) next_val = 0; else if(next_val == -1) next_val = $("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").length -1; if(boutons_actifs3 && !$("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").eq(next_val).hasClass('selected') && ($("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").closest('.selected').index() != 0 || val != -1) && ($("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").closest('.selected').index() != $("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").length-1 || val != 1)) { $("#bloc_cryo"+id_bloc+" .navigation_top a").removeClass('inactif'); if(next_val == 0) $("#bloc_cryo"+id_bloc+" .navigation_top .fleche_gauche").addClass('inactif'); else if(next_val == $("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").length -1) $("#bloc_cryo"+id_bloc+" .navigation_top .fleche_droite").addClass('inactif'); if($("#bloc_cryo"+id_bloc+" .deplie").length > 0) { replie_suite_diapo("bloc_cryo"+id_bloc, $("#bloc_cryo"+id_bloc+" .liste_photos_bloc li.li_photo").closest('.selected').index()); } if(user_action) clearTimeout(clear_timeout2); boutons_actifs3 = false; $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo.selected").css({zIndex:'11'}); $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo").eq(next_val).css({zIndex:'12'}); $("#bloc_cryo"+id_bloc+" .liste_textes_bloc .li_texte.selected").fadeOut(150, function() { $("#bloc_cryo"+id_bloc+" .liste_textes_bloc .li_texte").eq(next_val).fadeIn(150, function() { $("#bloc_cryo"+id_bloc+" .liste_textes_bloc .li_texte.selected").removeClass('selected'); $(this).addClass('selected'); }); }); $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo").eq(next_val).fadeIn(300, function() { $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo.selected").hide(); $("#bloc_cryo"+id_bloc+" .liste_photos_bloc .li_photo.selected").removeClass('selected'); $(this).addClass('selected'); boutons_actifs3 = true; }); } break; } } function maj_menu() { if (window.matchMedia('(min-width: 800px)').matches) { $(".menu_principal .li_principal .retour_ligne_resp").addClass("invisible"); $(".menu_principal").css({width:'100%'}); $(".menu_principal").css({height:"auto"}); var menu_h = $(".menu_principal").height(); $(".menu_principal").css({width:'2500px'}); if($(".menu_principal").height() != menu_h) $(".menu_principal .li_principal .retour_ligne_resp").removeClass("invisible"); $(".menu_principal").css({width:'100%'}); } else { $(".menu_principal .li_principal .retour_ligne_resp").removeClass("invisible"); $(".menu_principal").css({height:"0", paddingBottom:'0'}); $(".lien_deplie").removeClass('selected'); } } function deplie_menu() { if(boutons_actifs) { boutons_actifs = false; if($(".lien_deplie").hasClass('selected')) { $(".lien_deplie").removeClass('selected'); $(".menu_principal").animate({height:"0", paddingBottom:'0'}, 300, function() { boutons_actifs = true; }); } else { $(".lien_deplie").addClass('selected'); $(".menu_principal").css({height:"auto"}); var menu_height = $(".menu_principal").height(); $(".menu_principal").css({height:"0"}); $(".menu_principal").animate({height:menu_height+"px", paddingBottom:'65px'}, 300, function() { boutons_actifs = true; }); } } } /* FERMETURE DES COOKIES */ function allow_cookies() { $("div.panneau_cookie").animate({bottom:(-$("div.panneau_cookie").outerHeight())+'px'}, 350, 'easeOutQuad', function() { $(this).remove(); }); mes_data = 'requete=accept_cookie'; mes_data += '&acces_repertoires='+acces_repertoires; $.ajax({ type: "POST", url: "includes/requetes.php", data: mes_data, success: function(msg){ if(msg.substr(0,2) == "ok") { } else alert_perso("erreur : "+msg,true); } }); } function check_resize() { console.log('width : '+$(window).width()+' | height : '+$(window).height()); // LARGEUR DES BOUTONS if($(".bloc_cryo.bloc_boutons").length > 0) { for(var i=0;i<$(".bloc_cryo.bloc_boutons").length;i++) { if($(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").length == 3) { var largeur_bouton = -1; for(var j=0;j<$(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").length;j++) { if($(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(j).width() > largeur_bouton) largeur_bouton = $(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(j).width(); } $(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").css({width:largeur_bouton+'px'}); } else if($(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").length > 1) { $(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").css({width:'auto'}); if($(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(0).width() < $(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(1).width()) $(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(0).css({width:($(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(1).width())+'px'}); else $(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(1).css({width:($(".bloc_cryo.bloc_boutons:eq("+i+") .bouton_cryo").eq(0).width())+'px'}); } } } if($("body").prop('clientWidth') < 800) { var largeur_panneau = $(".panneau_central").width(); // BLOCS A ET G var height_img_a = (largeur_panneau * 460 / 900); $(".panneau_central .bloc_a").css({height:(height_img_a * 2)+'px'}); $(".panneau_central .bloc_a .liste_textes_bloc").css({width:'100%', height:(height_img_a + (largeur_panneau * 230 / 900))+'px', lineHeight:'120%', top:(height_img_a - (largeur_panneau * 230 / 900))+'px'}); $(".panneau_central .bloc_a .liste_textes_bloc .li_texte").css({width:'90%', height:'auto', marginTop:((largeur_panneau * 230 / 900) + height_img_a/2 - 80)+'px'}); $(".panneau_central .bloc_g").css({height:(largeur_panneau * 900 / 1800)+'px'}); $(".panneau_central .bloc_g .liste_photos_bloc").css({width:largeur_panneau+'px'}); // BLOCS D, E ET F $(".panneau_central .bloc_image .section_titre").css({width:largeur_panneau+'px'}); // BLOC H $(".panneau_central .bloc_cryo_h").css({height:(largeur_panneau * 1013 / 1800)+'px'}); // BLOCS M ET N $(".panneau_central .bloc2_image .part_texte").css({height:'auto'}); // BLOCS Q, R, S ET T $(".panneau_central .bloc2_diapo .part_image").css({height:Math.ceil(largeur_panneau * 600 / 900)+'px'}); $(".panneau_central .bloc2_diapo .part_texte").css({height:'auto'}); // INSTAGRAM $("#be6d327e3e0900683666587f424db3a9970aeab7fe2765614cea9e1c6a50a5e0").css({width:largeur_panneau+'px', height:(largeur_panneau * 300 / 1800)+'px'}); // BLOC Z $(".panneau_central .bloc2_textes .part_texte").css({height:'auto'}); // ORDRE DES BLOCS (O, P, S, T) for(var i=0;i<$(".panneau_central .bloc2_image.bloc_o").length;i++) { $(".panneau_central .bloc2_image.bloc_o:eq("+i+") .part_texte").prependTo($(".panneau_central .bloc2_image.bloc_o").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_image.bloc_p").length;i++) { $(".panneau_central .bloc2_image.bloc_p:eq("+i+") .part_texte").prependTo($(".panneau_central .bloc2_image.bloc_p").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_diapo.bloc_s").length;i++) { $(".panneau_central .bloc2_diapo.bloc_s:eq("+i+") .part_texte").prependTo($(".panneau_central .bloc2_diapo.bloc_s").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_diapo.bloc_t").length;i++) { $(".panneau_central .bloc2_diapo.bloc_t:eq("+i+") .part_texte").prependTo($(".panneau_central .bloc2_diapo.bloc_t").eq(i)); } } else if($("body").prop('clientWidth') < 1800) { var largeur_panneau = $(".panneau_central").width(); // BLOCS A ET G $(".panneau_central .bloc_a").css({height:(largeur_panneau * 460 / 1800)+'px'}); $(".panneau_central .bloc_a .liste_textes_bloc").css({width:(largeur_panneau/2)+'px', height:(largeur_panneau * 460 / 1800)+'px', lineHeight:(largeur_panneau * 460 / 1800)+'px', top:'0'}); $(".panneau_central .bloc_a .liste_textes_bloc .li_texte").css({width:(largeur_panneau/2)+'px', height:((largeur_panneau * 460 / 1800))+'px', marginTop:'0'}); $(".panneau_central .bloc_g").css({height:(largeur_panneau * 900 / 1800)+'px'}); $(".panneau_central .bloc_g .liste_photos_bloc").css({width:largeur_panneau+'px'}); // BLOCS D, E ET F $(".panneau_central .bloc_image .section_titre").css({width:largeur_panneau+'px'}); // BLOC H $(".panneau_central .bloc_cryo_h").css({height:(largeur_panneau * 1013 / 1800)+'px'}); // BLOCS M ET N $(".panneau_central .bloc2_image .degrade").css({width:(largeur_panneau/2)+'px'}); // BLOCS Q, R, S ET T $(".panneau_central .bloc2_diapo .part_image").css({height:Math.ceil(largeur_panneau * 600 / 1800)+'px'}); if($("body").prop('clientWidth') < 1000) $(".panneau_central .bloc2_diapo .part_texte").css({height:(-50 + (largeur_panneau * 600 / 1800))+'px'}); else $(".panneau_central .bloc2_diapo .part_texte").css({height:(-100 + (largeur_panneau * 600 / 1800))+'px'}); // INSTAGRAM $("#be6d327e3e0900683666587f424db3a9970aeab7fe2765614cea9e1c6a50a5e0").css({width:largeur_panneau+'px', height:(largeur_panneau * 300 / 1800)+'px'}); // BLOC Z $(".panneau_central .bloc2_textes .part_texte").css({height:'auto'}); for(var i=0;i<$(".panneau_central .bloc2_textes").length;i++) { if($(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).height() > $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).height()) { $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).css({height:$(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).height()+'px'}); $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).css({height:$(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).height()+'px'}); } else { $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).css({height:$(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).height()+'px'}); $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).css({height:$(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).height()+'px'}); } } // ORDRE DES BLOCS (O, P, S, T) for(var i=0;i<$(".panneau_central .bloc2_image.bloc_o").length;i++) { $(".panneau_central .bloc2_image.bloc_o:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_image.bloc_o").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_image.bloc_p").length;i++) { $(".panneau_central .bloc2_image.bloc_p:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_image.bloc_p").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_diapo.bloc_s").length;i++) { $(".panneau_central .bloc2_diapo.bloc_s:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_diapo.bloc_s").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_diapo.bloc_t").length;i++) { $(".panneau_central .bloc2_diapo.bloc_t:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_diapo.bloc_t").eq(i)); } } else { // BLOCS A ET G $(".panneau_central .bloc_a").css({height:'460px'}); $(".panneau_central .bloc_a .liste_textes_bloc").css({width:'900px', height:'460px', lineHeight:'460px', top:'0'}); $(".panneau_central .bloc_a .liste_textes_bloc .li_texte").css({width:'900px', height:'430px', marginTop:'0'}); $(".panneau_central .bloc_g").css({height:'900px'}); $(".panneau_central .bloc_g .liste_photos_bloc").css({width:'1800px'}); // BLOCS D, E ET F $(".panneau_central .bloc_image .section_titre").css({width:'1800px'}); // BLOC H $(".panneau_central .bloc_cryo_h").css({height:'1013px'}); // BLOCS M ET N $(".panneau_central .bloc2_image .degrade").css({width:(largeur_panneau/2)+'px'}); // BLOCS Q, R, S ET T $(".panneau_central .bloc2_diapo .part_image").css({height:'600px'}); $(".panneau_central .bloc2_diapo .part_texte").css({height:'500px'}); // INSTAGRAM $("#be6d327e3e0900683666587f424db3a9970aeab7fe2765614cea9e1c6a50a5e0").css({width:'1800px', height:'300px'}); // BLOC Z $(".panneau_central .bloc2_textes .part_texte").css({height:'auto'}); for(var i=0;i<$(".panneau_central .bloc2_textes").length;i++) { if($(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).height() > $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).height()) $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).css({height:$(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).height()+'px'}); else $(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(0).css({height:$(".panneau_central .bloc2_textes:eq("+i+") .part_texte").eq(1).height()+'px'}); } // ORDRE DES BLOCS (O, P, S, T) for(var i=0;i<$(".panneau_central .bloc2_image.bloc_o").length;i++) { $(".panneau_central .bloc2_image.bloc_o:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_image.bloc_o").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_image.bloc_p").length;i++) { $(".panneau_central .bloc2_image.bloc_p:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_image.bloc_p").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_diapo.bloc_s").length;i++) { $(".panneau_central .bloc2_diapo.bloc_s:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_diapo.bloc_s").eq(i)); } for(var i=0;i<$(".panneau_central .bloc2_diapo.bloc_t").length;i++) { $(".panneau_central .bloc2_diapo.bloc_t:eq("+i+") .part_texte").appendTo($(".panneau_central .bloc2_diapo.bloc_t").eq(i)); } } // BLOCKS TARIFS if($(".bloc_tarifs").length > 0) { $(".bloc_tarifs").prev().css({padding:'0'}); $(".bloc_tarifs .span_lib").css({width:'auto'}); $(".bloc_tarifs .span_detail").css({width:'auto'}); $(".bloc_tarifs .span_prix").css({width:'auto'}); for(var i=0;i<$(".bloc_tarifs").length;i++) { var largeur_max = -1; var largeur_max_prix = -1; var largeur_max_details = -1; for(var j = 0;j<$(".bloc_tarifs:eq("+i+") li").length;j++) { if($(".bloc_tarifs:eq("+i+") li:eq("+j+") .span_lib").width() > largeur_max) largeur_max = $(".bloc_tarifs:eq("+i+") li:eq("+j+") .span_lib").width(); if($(".bloc_tarifs:eq("+i+") li:eq("+j+") .span_detail").width() > largeur_max_details) largeur_max_details = $(".bloc_tarifs:eq("+i+") li:eq("+j+") .span_detail").width(); if($(".bloc_tarifs:eq("+i+") li:eq("+j+") .span_prix").width() > largeur_max_prix) largeur_max_prix = $(".bloc_tarifs:eq("+i+") li:eq("+j+") .span_prix").width(); } $(".bloc_tarifs:eq("+i+") .span_lib").css({width:(largeur_max + 1)+'px'}); $(".bloc_tarifs:eq("+i+") .span_detail").css({width:(largeur_max_details + 1)+'px'}); $(".bloc_tarifs:eq("+i+") .span_prix").css({width:(largeur_max_prix + 1)+'px'}); while($(".bloc_tarifs:eq("+i+")").width() < $(".bloc_tarifs:eq("+i+") .span_lib").eq(0).outerWidth() + $(".bloc_tarifs:eq("+i+") .span_prix").eq(0).outerWidth() + $(".bloc_tarifs:eq("+i+") .span_detail").eq(0).outerWidth() + 23) { largeur_max -= 3; largeur_max_details -= 3; $(".bloc_tarifs:eq("+i+") .span_lib").css({width:(largeur_max + 1)+'px'}); $(".bloc_tarifs:eq("+i+") .span_detail").css({width:(largeur_max_details + 1)+'px'}); } } } // BOUTON LIRE LA SUITE (BLOCS M N O P Q R S T) if($("body").prop('clientWidth') < 800) { $(".bloc_cryo.bloc2_image .part_texte").css({height:'auto'}); $(".bloc_cryo.bloc2_image .part_texte .texte_cryo").css({height:'auto'}); $(".bloc_cryo.bloc2_image .part_texte .texte_cryo .degrade").remove(); $(".bloc_cryo.bloc2_image .part_texte .lire_suite").remove(); $(".bloc_cryo.bloc2_diapo .part_texte").css({height:'auto'}); $(".bloc_cryo.bloc2_diapo .part_texte .texte_cryo").css({height:'auto'}); $(".bloc_cryo.bloc2_diapo .part_texte .texte_cryo .degrade").remove(); $(".bloc_cryo.bloc2_diapo .part_texte .lire_suite").remove(); $(".bloc_cryo.bloc2_image .part_image").css({height:'auto'}); } else { if($(".bloc_cryo.bloc2_image").length > 0 || $(".bloc_cryo.bloc2_diapo").length > 0) { for(var i=0;i<$(".bloc_cryo.bloc2_image").length;i++) { $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo").css({height:'auto'}); $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte").css({height:'auto'}); $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo .degrade").remove(); $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .lire_suite").remove(); $(".bloc_cryo.bloc2_image:eq("+i+") .part_image").css({height:Math.floor($(".panneau_central").width() * 600 / 1800)+''}); if($(".bloc_cryo.bloc2_image:eq("+i+") .part_texte").outerHeight() -1 > $(".bloc_cryo.bloc2_image:eq("+i+") .part_image").outerHeight()) { if($(".bloc_cryo.bloc2_image").eq(i).hasClass('bloc_n') || $(".bloc_cryo.bloc2_image").eq(i).hasClass('bloc_p')) var extra_class = ' style2'; else var extra_class = ''; if($("body").prop('clientWidth') < 1000) $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo").css({height:(($(".panneau_central").width() * 600 / 1800) - 80)+'px'}) else $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo").css({height:(($(".panneau_central").width() * 600 / 1800) - 130)+'px'}) $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo").append('
'); $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte").append('
'+libelles_js["lire_suite_"+langue]+'
'); } else { if($("body").prop('clientWidth') < 1000) $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo").css({height:(($(".panneau_central").width() * 600 / 1800) - 50)+'px'}) else $(".bloc_cryo.bloc2_image:eq("+i+") .part_texte .texte_cryo").css({height:(($(".panneau_central").width() * 600 / 1800) - 100)+'px'}) } $(".bloc_cryo.bloc2_image").eq(i).css({height:($(".bloc_cryo.bloc2_image:eq("+i+") .part_image").height())+'px'}) $(".bloc_cryo.bloc2_image .part_texte").eq(i).css({height:$(".bloc_cryo.bloc2_image:eq("+i+") .part_image").height()+'px'}) } for(var i=0;i<$(".bloc_cryo.bloc2_diapo").length;i++) { for(var j=0;j<$(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte").length;j++) { $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+") .texte_cryo").css({height:'auto'}); $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+")").css({height:'auto'}); $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+") .texte_cryo .degrade").remove(); $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+") .lire_suite").remove(); $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_image").css({height:Math.floor($(".panneau_central").width() * 600 / 1800)+''}); var text_height = Number($(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte").css('paddingTop').substr(0, $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte").css('paddingTop').length-2)) + $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+")").outerHeight(); if(text_height > $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_image").outerHeight()) { if($(".bloc_cryo.bloc2_diapo").eq(i).hasClass('bloc_r') || $(".bloc_cryo.bloc2_diapo").eq(i).hasClass('bloc_t')) var extra_class = ' style2'; else var extra_class = ''; if($("body").prop('clientWidth') < 1000) $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+") .texte_cryo").css({height:(($(".panneau_central").width() * 600 / 1800) - 80)+'px'}) else $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+") .texte_cryo").css({height:(($(".panneau_central").width() * 600 / 1800) - 130)+'px'}) $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+") .texte_cryo").append('
'); $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte .liste_textes_bloc .li_texte:eq("+j+")").append('
'+libelles_js["lire_suite_"+langue]+'
'); } $(".bloc_cryo.bloc2_diapo").eq(i).css({height:$(".bloc_cryo.bloc2_diapo:eq("+i+") .part_image").height()+'px'}); $(".bloc_cryo.bloc2_diapo:eq("+i+") .part_texte").css({height:$(".bloc_cryo.bloc2_diapo:eq("+i+") .part_image").height()+'px'}); } } } } } function deplie_langues() { if(!$(".panneau_langues a.current_langue").hasClass('open')) { var cur_height = $("header .panneau_langues").height(); $("header .panneau_langues").css({height:'auto'}); var next_height = $("header .panneau_langues").height(); $("header .panneau_langues").css({height:cur_height+'px'}); $(".panneau_langues a.current_langue").addClass('open'); $("header .panneau_langues").stop().animate({height:next_height+'px'}, 300); } else { $(".panneau_langues a.current_langue").removeClass('open'); $("header .panneau_langues").stop().animate({height:'20px'}, 300); } } function deplie_suite(bloc_id) { if($("#"+bloc_id).hasClass('bloc_n') || $("#"+bloc_id).hasClass('bloc_p')) var extra_class = ' style2'; else var extra_class = ''; var bloc_height = $("#"+bloc_id+" .texte_cryo").height(); $("#"+bloc_id+" .texte_cryo .degrade").remove(); $("#"+bloc_id+" .lire_suite").remove(); $("#"+bloc_id+" .texte_cryo").css({height:'auto'}); var next_height = $("#"+bloc_id+" .texte_cryo").height(); $("#"+bloc_id+" .texte_cryo").css({height:(bloc_height)+'px'}); $("#"+bloc_id+" .part_texte").css({height:'auto'}); $("#"+bloc_id+"").css({height:'auto'}); $("#"+bloc_id+" .texte_cryo").animate({height:(next_height)+'px'}, 300, function() { $("#"+bloc_id+" .texte_cryo").parent().append('
'+libelles_js['fermer_'+langue]+'
'); }); } function deplie_suite_diapo(bloc_id, num_texte) { if($("#"+bloc_id).hasClass('bloc_r') || $("#"+bloc_id).hasClass('bloc_t')) var extra_class = ' style2'; else var extra_class = ''; var bloc_height = $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").height(); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .degrade").remove(); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .lire_suite").remove(); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").css({height:'auto'}); var next_height = $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").height(); $("#"+bloc_id).css({height:'auto'}); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").css({height:(bloc_height)+'px'}); $("#"+bloc_id+" .part_texte").animate({height:(next_height + 30)+'px'}, 300); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").animate({height:(next_height)+'px'}, 300, function() { $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+")").append('
'+libelles_js['fermer_'+langue]+'
'); }); } function replie_suite(bloc_id) { if($("#"+bloc_id).hasClass('bloc_n') || $("#"+bloc_id).hasClass('bloc_p')) var extra_class = ' style2'; else var extra_class = ''; var supp_marge = 30 + Number($("#"+bloc_id+" .part_texte").css("paddingTop").substr(0, $("#"+bloc_id+" .part_texte").css("paddingTop").length - 2)) * 2; $("#"+bloc_id+" .lire_suite").remove(); $("#"+bloc_id+" .texte_cryo").animate({height:($("#"+bloc_id+" img").parent().outerHeight() - supp_marge)+'px'}, 300, function() { $("#"+bloc_id+" .texte_cryo").append('
'); $("#"+bloc_id+" .texte_cryo").parent().append('
'+libelles_js["lire_suite_"+langue]+'
'); $("#"+bloc_id).css({height:($("#"+bloc_id+" .part_image").height())+'px'}); $("#"+bloc_id+" .part_texte").css({height:$("#"+bloc_id+" .part_image").height()+'px'}); }); } function replie_suite_diapo(bloc_id, num_texte) { if($("#"+bloc_id).hasClass('bloc_r') || $("#"+bloc_id).hasClass('bloc_t')) var extra_class = ' style2'; else var extra_class = ''; var supp_marge = Number($("#"+bloc_id+" .part_texte ").css("paddingTop").substr(0, $("#"+bloc_id+" .part_texte ").css("paddingTop").length-2)) * 2; $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .lire_suite").remove(); $("#"+bloc_id+" .part_texte").animate({height:($("#"+bloc_id+" .part_image").outerHeight() - supp_marge)+'px'}, 300); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").animate({height:($("#"+bloc_id+" .part_image").outerHeight() - 30 - supp_marge)+'px'}, 300, function() { $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").append('
'); $("#"+bloc_id+" .part_texte .liste_textes_bloc .li_texte:eq("+num_texte+") .texte_cryo").parent().append('
'+libelles_js["lire_suite_"+langue]+'
'); $("#"+bloc_id).css({height:$("#"+bloc_id+" .part_image").height()+'px'}); $("#"+bloc_id+" .part_texte").css({height:$("#"+bloc_id+" .part_image").height()+'px'}); }); } ///////////////////////////////////////////////////////////////////// ////////////// ///////////// ////////////// ///////////// ////////////// FONCTIONS DIVERSES ///////////// ////////////// ///////////// ////////////// ///////////// ///////////////////////////////////////////////////////////////////// //////////// PERMET D'ENVOYER UNE ALERT PERSONNALISEE function alert_perso(message,affiche_ok) { remove_alert_perso(); var conteneur_alert = ''; conteneur_alert += '
' conteneur_alert += '
' conteneur_alert += '
close
' conteneur_alert += '
' conteneur_alert += message; if(affiche_ok == true) conteneur_alert += '
'; conteneur_alert += '
'; conteneur_alert += '
'; conteneur_alert += '
'; $("body").append(conteneur_alert); if($(window).width() <= 900) { $("div#panneau_conteneur_alert_perso").css({width:'80%'}); $("div#panneau_conteneur_alert_perso").css({marginTop:(-$("#panneau_conteneur_alert_perso").innerHeight()/2)+'px', marginLeft:(-$("#panneau_conteneur_alert_perso").innerWidth()/2)+'px'}); } else { $("div#panneau_conteneur_alert_perso").css({width:'30%'}); $("div#panneau_conteneur_alert_perso").css({marginTop:(-$("#panneau_conteneur_alert_perso").innerHeight()/2)+'px', marginLeft:(-$("#panneau_conteneur_alert_perso").innerWidth()/2)+'px'}); } $("div#panneau_alert_perso div#panneau_conteneur_alert_perso").hide(); $("div#panneau_alert_perso div#panneau_conteneur_alert_perso").fadeIn(300); $("div#panneau_alert_perso input.bouton_confirm_alert_perso").eq(0).focus(); } function remove_alert_perso() { $("#panneau_alert_perso").fadeOut(300,function() { $(this).remove(); }); } // to defear the loading of stylesheets // just add it right before the tag // and before any js inclusion (for performance) function loadStyleSheet(src){ if (document.createStyleSheet) document.createStyleSheet(src); else { var stylesheet = document.createElement('link'); stylesheet.href = src; stylesheet.rel = 'stylesheet'; stylesheet.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(stylesheet); } } function charge_uploader() { $('#filer_input').filer({ showThumbs: true, templates: { box: '', item: '
  • \
    \
    \
    \
    \
    \ {{fi-name | limitTo: 25}}\ {{fi-size2}}\
    \ {{fi-image}}\
    \
    \
      \
    • {{fi-progressBar}}
    • \
    \
      \
    • \
    \
    \
    \
    \
  • ', itemAppend: '
  • \
    \
    \
    \
    \
    \ {{fi-name | limitTo: 25}}\ {{fi-size2}}\
    \ {{fi-image}}\
    \
    \
      \
    • {{fi-icon}}
    • \
    \
      \
    • \
    \
    \
    \
    \
  • ', progressBar: '
    ', itemAppendToEnd: false, removeConfirmation: true, _selectors: { list: '.jFiler-items-list', item: '.jFiler-item', progressBar: '.bar', remove: '.jFiler-item-trash-action' } },uploadFile: { url: "includes/upload.php", data: null, type: 'POST', enctype: 'multipart/form-data', beforeSend: function(){}, success: function(data, el){ var parent = el.find(".jFiler-jProgressBar").parent(); el.find(".jFiler-jProgressBar").fadeOut("slow", function(){ $("
    Uploadé
    ").hide().appendTo(parent).fadeIn("slow"); }); var tmp = data.split('[name] => '); var tmp2 = tmp[1].split(/\n/); if(file_list_upload != '') file_list_upload += '|'; file_list_upload += tmp2[0]; }, error: function(el){ var parent = el.find(".jFiler-jProgressBar").parent(); el.find(".jFiler-jProgressBar").fadeOut("slow", function(){ $("
    Erreur
    ").hide().appendTo(parent).fadeIn("slow"); }); }, statusCode: null, onProgress: null, onComplete: null }, onRemove: function(itemEl, file, id, listEl, boxEl, newInputEl, inputEl){ var file = file.name; $.post(acces_repertoires+'includes/remove_file.php', {file: file}); } }); } ///////// FONCTION PERMETTANT DE CHARGER UNE ANIMATION FLASH AVEC SWFOBJECT function charge_flash(id_alternatif,adresse,largeur,hauteur,variables) { if(variables != '') { var flashvars = {}; tab_var = variables.split(/###/g); for(var i=0;i\n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* The '%a' field must be filled".replace('%a',lib_lang)+"
    \n"; } return -1; } else { return true; } } else if(type == "password") { if($.trim($("input#"+nom_champ).val()) == "") { if(langue == 'fr') { message_erreur += "* Le champ '%a' doit être rempli".replace('%a',libelle_champ)+"
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* The '%a' field must be filled".replace('%a',lib_lang)+"
    \n"; } return -1; } else if($.trim($("input#"+nom_champ).val()).length < 8) { if(langue == 'fr') { message_erreur += "* Votre mot de passe doit comporter au moins 8 caractères
    \n"; } else { message_erreur += "* The password needs to contain at least 8 characters
    \n"; } return -1; } else { return true; } } else if(type == "int") { if($.trim($("input#"+nom_champ).val()) == "") { if(langue == 'fr') { message_erreur += "* Le champ '%a' doit être rempli".replace('%a',libelle_champ)+"
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* The '%a' field must be filled".replace('%a',lib_lang)+"
    \n"; } return -1; } else if(form_input_is_int($.trim($("#"+nom_champ).val())) == false) { if(langue == 'fr') { message_erreur += "* "+"Le champ '%a' doit être un entier".replace('%a',libelle_champ)+"
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* "+"Le '%a' field must be an integer".replace('%a',lib_lang)+"
    \n"; } return -1; } else { return true; } } else if(type == "double") { if($.trim($("#"+nom_champ).val()) == "") { if(langue == 'fr') { message_erreur += "* "+"Le champ '%a' doit être rempli".replace('%a',libelle_champ)+"
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* The '%a' field must be filled".replace('%a',lib_lang)+"
    \n"; } return -1; } else if(IsNumeric($.trim($("#"+nom_champ).val())) == false) { if(langue == 'fr') { message_erreur += "* "+"Le champ '%a' doit être un nombre".replace('%a',libelle_champ)+"
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* "+"Le '%a' field must be a number".replace('%a',lib_lang)+"
    \n"; } return -1; } else { return true; } } else if(type == "select") { if($("select#"+nom_champ).val() == -1) { if(langue == 'fr') { message_erreur += "* Vous devez sélectionner une valeur pour le champ '"+libelle_champ+"'
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* You need to select a value for the '"+lib_lang+"' field
    \n"; } return -1; } else return true; } else if(type == "radio") { if($("input[name="+nom_champ+"]:checked").val() == undefined) { message_erreur += "* Vous devez sélectionner une valeur pour le champ '"+libelle_champ+"'
    \n"; return -1; } else return true; } else if(type == "email") { if($.trim($("input#"+nom_champ).val()) == "") { if(langue == 'fr') { message_erreur += "* Le champ '%a' doit être rempli".replace('%a',libelle_champ)+"
    \n"; } else { var lib_lang = $.trim($("#"+nom_champ+" ").siblings().eq(0).html()); if(lib_lang.substr(-1,1) == ':') lib_lang = lib_lang.substr(0,lib_lang.length-2); if(lib_lang == '') lib_lang = libelle_champ; message_erreur += "* The'%a' field must be filled".replace('%a',lib_lang)+"
    \n"; } return -1; } else { if(!is_email($("input#"+nom_champ).val())) { if(langue == 'fr') { message_erreur += "* L'adresse email que vous avez entrée n'est pas valide
    \n"; } else { message_erreur += "* The email address you entered is not correct
    \n"; } return -1; } else { return true; } } } else if(type == "url") { if($.trim($("input#"+nom_champ).val()) != "" && !isURL($("input#"+nom_champ).val())) { message_erreur += "* L'URL que vous avez entrée n'est pas valide
    \n"; return -1; } else { return true; } } else if(type == "date") { if($.trim($("#"+nom_champ).val()) == "") { message_erreur += "* Le champ '%a' doit être rempli".replace('%a',libelle_champ)+"
    \n"; return -1; } else if($.trim($("input#"+nom_champ).val()) != "" && !is_date_valide($("input#"+nom_champ).val())) { message_erreur += "* La date que vous avez entrée n'est pas valide
    \n"; return -1; } else { return true; } } } function form_input_is_int(input){ return !isNaN(input)&&parseInt(input)==input; } function IsNumeric(input) { return (input - 0) == input && input.length > 0; } /////// SERT A FORMATER UNE STRING EN UN ENTIER A 2 CHIFFRES function format_entier(valeur) { var temp = new String(valeur); if (temp.length==1) return ("0"+temp); else return valeur; } function is_date_valide(var_string) { if($.trim(var_string).length != 10) return false; if(var_string.charAt(2) != "/" || var_string.charAt(5) != "/") return false; if(parseInt(var_string.substr(0,2),10) < 1 || parseInt(var_string.substr(0,2),10) > 31 || parseInt(var_string.substr(3,2),10) < 1 || parseInt(var_string.substr(3,2),10) > 12 || parseInt(var_string.substr(6,4),10) < 2008 || parseInt(var_string.substr(6,4),10) > 2050) return false; return true; } ///////// FONCTION PERMETTANT DE TESTER SI UN EMAIL EST CORRECT function is_email(var_email) { var saisie,saisie1,saisie2,saisie3; saisie = var_email.indexOf("@"); if (saisie!=(-1)) { longueur = var_email.length; saisie1 = var_email.substring(saisie+1,longueur); saisie2 = saisie1.indexOf("."); longueur = saisie1.length; saisie3 = saisie1.substring(saisie2+1,longueur); if (saisie2==(-1)) return false; else { if (saisie3 == "") return false; else return true; } } else return false; } ///////// FONCTION PERMETTANT DE TESTER SI UNE URL EST CORRECTE function isURL(argvalue) { if(argvalue.substr(0,7) != 'http://') { argvalue = "http://"+argvalue; } if (argvalue.indexOf(" ") != -1) return false; else if (argvalue.indexOf("http://") == -1) return false; else if (argvalue == "http://") return false; else if (argvalue.indexOf("http://") > 0) return false; argvalue = argvalue.substring(7, argvalue.length); if (argvalue.indexOf(".") == -1) return false; else if (argvalue.indexOf(".") == 0) return false; else if (argvalue.charAt(argvalue.length - 1) == ".") return false; if (argvalue.indexOf("/") != -1) { argvalue = argvalue.substring(0, argvalue.indexOf("/")); if (argvalue.charAt(argvalue.length - 1) == ".") return false; } if (argvalue.indexOf(":") != -1) { if (argvalue.indexOf(":") == (argvalue.length - 1)) return false; else if (argvalue.charAt(argvalue.indexOf(":") + 1) == ".") return false; argvalue = argvalue.substring(0, argvalue.indexOf(":")); if (argvalue.charAt(argvalue.length - 1) == ".") return false; } return true; } function number_format(number, decimals, dec_point, thousands_sep) { number = (number+'').replace(',', '').replace(' ', ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + Math.round(n * k) / k; }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '').length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1).join('0'); } return s.join(dec); }