function initPS(){psItems=[{src:"",w:-1,h:-1,msrc:"",href:"dinan-remparts-2014-photo.html",title:"Couronnes de fleurs"},{src:"_media/img/medium/je-te-le-dis-cetait-mieux-avant.jpg",w:600,h:440,msrc:"_media/img/thumb/je-te-le-dis-cetait-mieux-avant.jpg",href:"dinan-remparts-2014-photo2.html",title:"Je te le dis, c\'était mieux avant !"},{src:"_media/img/medium/la-dame-au-voile-dor-et-son-seigneur.jpg",w:426,h:600,msrc:"_media/img/thumb/la-dame-au-voile-dor-et-son-seigneur.jpg",href:"dinan-remparts-2014-photo3.html",title:"C\'est l\'or monseign\'or ! C\'est l\'or !"},{src:"_media/img/medium/les-comperes.jpg",w:600,h:358,msrc:"_media/img/thumb/les-comperes.jpg",href:"dinan-remparts-2014-photo4.html",title:"Les compères"},{src:"_media/img/medium/petit-chevalier.jpg",w:413,h:600,msrc:"_media/img/thumb/petit-chevalier.jpg",href:"dinan-remparts-2014-photo5.html",title:"Petit chevalier"},{src:"_media/img/medium/petite-blonde-au-baton.jpg",w:600,h:462,msrc:"_media/img/thumb/petite-blonde-au-baton.jpg",href:"dinan-remparts-2014-photo6.html",title:"Canaille blonde et son bâton"},{src:"_media/img/medium/baute-satyrique.jpg",w:382,h:600,msrc:"_media/img/thumb/baute-satyrique.jpg",href:"dinan-remparts-2014-photo7.html",title:"Beauté satyrique"},{src:"_media/img/medium/marchande-de-crepes.jpg",w:600,h:571,msrc:"_media/img/thumb/marchande-de-crepes.jpg",href:"dinan-remparts-2014-photo8.html",title:"Marchande de crêpes"},{src:"_media/img/medium/visite-en-famille.jpg",w:431,h:600,msrc:"_media/img/thumb/visite-en-famille.jpg",href:"dinan-remparts-2014-photo9.html",title:"Visite en famille"},{src:"_media/img/medium/cest-ou-le-pole-nord.jpg",w:427,h:600,msrc:"_media/img/thumb/cest-ou-le-pole-nord.jpg",href:"dinan-remparts-2014-photo10.html",title:"C\'est où le pole nord ?"},{src:"_media/img/medium/entre-croises.jpg",w:600,h:403,msrc:"_media/img/thumb/entre-croises.jpg",href:"dinan-remparts-2014-photo11.html",title:"Entre croisés"},{src:"_media/img/medium/fleur-de-lys.jpg",w:401,h:600,msrc:"_media/img/thumb/fleur-de-lys.jpg",href:"dinan-remparts-2014-photo12.html",title:"Fleur de lys"},{src:"_media/img/medium/glace-sous-le-soleil.jpg",w:600,h:353,msrc:"_media/img/thumb/glace-sous-le-soleil.jpg",href:"dinan-remparts-2014-photo13.html",title:"Glaces sous le soleil"},{src:"_media/img/medium/lareine-et-la-princesse.jpg",w:600,h:440,msrc:"_media/img/thumb/lareine-et-la-princesse.jpg",href:"dinan-remparts-2014-photo14.html",title:"La reine et la princesse"},{src:"_media/img/medium/le-parapluie.jpg",w:600,h:412,msrc:"_media/img/thumb/le-parapluie.jpg",href:"dinan-remparts-2014-photo15.html",title:"Le parapluie"},{src:"_media/img/medium/peau-de-bete.jpg",w:600,h:401,msrc:"_media/img/thumb/peau-de-bete.jpg",href:"dinan-remparts-2014-photo16.html",title:"Peau de bête"},{src:"_media/img/medium/damoiseau.jpg",w:357,h:600,msrc:"_media/img/thumb/damoiseau.jpg",href:"dinan-remparts-2014-photo17.html",title:"Damoiseau"},{src:"_media/img/medium/mixite-medievale.jpg",w:600,h:403,msrc:"_media/img/thumb/mixite-medievale.jpg",href:"dinan-remparts-2014-photo18.html",title:"Mixité médiévale"},{src:"_media/img/medium/robin-de-locksley-en-promenade.jpg",w:600,h:386,msrc:"_media/img/thumb/robin-de-locksley-en-promenade.jpg",href:"dinan-remparts-2014-photo19.html",title:"Robin de Locksley en viste à Dinan"},{src:"_media/img/medium/sms-medieval.jpg",w:390,h:600,msrc:"_media/img/thumb/sms-medieval.jpg",href:"dinan-remparts-2014-photo20.html",title:"SMS médiéval"},{src:"_media/img/medium/hommes-de-boue.jpg",w:600,h:384,msrc:"_media/img/thumb/hommes-de-boue.jpg",href:"dinan-remparts-2014-photo21.html",title:"Hommes de boue"},{src:"_media/img/medium/la-roulotte.jpg",w:600,h:412,msrc:"_media/img/thumb/la-roulotte.jpg",href:"dinan-remparts-2014-photo22.html",title:"La roulotte"}];}function openPS(e){var t=new PhotoSwipe(document.querySelectorAll(".pswp")[0],PhotoSwipeUI_Default,psItems,{index:e});var realViewportWidth,firstResize=!0,imageSrcWillChange;t.listen("beforeResize",function(){if(realViewportWidth=t.viewportSize.x*window.devicePixelRatio,"undefined"!=typeof t.currItem.stops)for(var s=0;st.currItem.stops[s].w||t.currItem.w>t.currItem.stops[s].w&&realViewportWidth<=t.currItem.stops[s].w)&&(imageSrcWillChange=!0);imageSrcWillChange&&!firstResize&&t.invalidateCurrItems(),firstResize&&(firstResize=!1),imageSrcWillChange=!1}),t.listen("gettingData",function(s,r){"undefined"==typeof r.org&&(r.org={},r.org.src=r.src,r.org.w=r.w,r.org.h=r.h,r.org.pratio=r.h>r.w?r.w/r.h:1,r.stops=[],r.w>=r.h?(r.w>=1600&&r.stops.push({w:r.w,h:r.h,dir:"/xlarge/"}),r.w>=1024&&r.stops.push({w:1024,h:1024*r.h/r.w,dir:"/large/"}),r.w>=768&&r.stops.push({w:768,h:768*r.h/r.w,dir:"/medium/"}),r.w>=480&&r.stops.push({w:480,h:480*r.h/r.w,dir:"/small/"})):r.h>=1600?(r.stops.push({h:1600,w:1600*r.w/r.h,dir:"/xlarge/"}),r.stops.push({h:1024,w:1024*r.w/r.h,dir:"/large/"}),r.stops.push({h:768,w:768*r.w/r.h,dir:"/medium/"}),r.stops.push({h:480,w:480*r.w/r.h,dir:"/small/"})):r.org.h>=1024?(r.stops.push({h:1024,w:1024*r.w/r.h,dir:"/large/"}),r.stops.push({h:768,w:768*r.w/r.h,dir:"/medium/"}),r.stops.push({h:480,w:480*r.w/r.h,dir:"/small/"})):r.org.h>=768?(r.stops.push({h:768,w:768*r.w/r.h,dir:"/medium/"}),r.stops.push({h:480,w:480*r.w/r.h,dir:"/small/"})):r.org.h>=480&&r.stops.push({h:480,w:480*r.w/r.h,dir:"/small/"}));for(var t=r.stops.length-1;t>=0;t--)if(r.stops[t].w>=realViewportWidth)return r.src=r.org.src.replace("/xlarge/",r.stops[t].dir).replace("/large/",r.stops[t].dir).replace("/medium/",r.stops[t].dir),r.w=r.stops[t].w,void(r.h=r.stops[t].h);r.src=r.org.src,r.w=r.org.w,r.h=r.org.h});t.init();if ($('.pswp__button--autoplay').length === 0)$('').insertAfter('.pswp__button--zoom');}$.urlParam = function(name){var results=new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);return results?results[1]||0:-1;};var i=$.urlParam('pid');if(i>=0) {document.addEventListener('DOMContentLoaded', function(){openPS(i-1);}, false);}function decMail2(e){var s=""+e.href,n=s.lastIndexOf("/"),w;if(s.substr(0,7)=="mailto:")return(true);if(n>0)s=s.substr(n+1);s=s.replace("?",":").replace("#","@").replace(/[a-z]/gi,function(t){return String.fromCharCode(t.charCodeAt(0)+(t.toLowerCase()<"n"?13:-13));});e.href=s;return(true);}function onChangeSiteLang(href){var i=location.href.indexOf("?");if(i>0)href+=location.href.substr(i);document.location.href=href;}initPS();$("#searchbox > input").click(function(){$(this).select();});if(location.href.indexOf("?")>0&&location.href.indexOf("twtheme=no")>0){if(typeof twLzyLoad!=="undefined"){window.addEventListener("load",twLzyLoad);window.addEventListener("scroll",twLzyLoad);window.addEventListener("resize",twLzyLoad);}$("#toolbar1,#toolbar2,#toolbar3,#footersmall,#footerfat").hide();var idbmk=location.href;idbmk=idbmk.substring(idbmk.lastIndexOf("#")+1,idbmk.lastIndexOf("?"));if(idbmk!="")$("html,body").animate({scrollTop:$("#"+idbmk).offset().top},0);}$(".dropdown-toggle").dropdown();function isElemVisible(el,treshold){var rc=el.getBoundingClientRect();return(rc.top<=window.innerHeight-treshold*(rc.bottom-rc.top)/100);}function twLzyLoad(){var elems=[].slice.call(document.querySelectorAll("img[data-src]"));elems.forEach(function(e){if(isElemVisible(e,0)){var scs=e.getAttribute("data-srcset");e.setAttribute("src", e.getAttribute("data-src"));e.removeAttribute("data-src");if(scs){e.setAttribute("srcset", scs);e.removeAttribute("data-srcset");}}})}window.addEventListener("load",twLzyLoad);window.addEventListener("scroll",twLzyLoad);window.addEventListener("resize",twLzyLoad);if(typeof onTOWebPageLoaded=="function") onTOWebPageLoaded();});