function affMentions(url){ var adresse = url || "/mentions.php"; var fen = window.open(adresse,"Mentions","width=700,height=500,menubar=yes,status=no,resizable=no,location=no,toolbar=no,scrollbars=yes"); fen.focus(); } //Nous donne la position du scroll... function getPageScroll( ) { var xScroll, yScroll; if (self.pageYOffset) { // Some browser yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) { // All other browsers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } var arrayPageScroll = {'xScroll':xScroll,'yScroll':yScroll}; return arrayPageScroll; } Shadowbox.init({ language: "fr", players: ['img', 'html', 'iframe', 'php'], modal: true, handleOversize: "drag" }); /** * Ouvre un ShadowBox avec : * URL : l'url de la page ou image à afficher * PARAMS : Query String pour l'adresse * TODO => passer la taille en paramètres... **/ function shadow_open(url, params, titre, w, h){ if (url == "" || url == undefined) { alert('Pas de page à afficher...'); return; } if (titre == undefined) { titre = ""; } reg = new RegExp('^[0-9]*$', 'g'); if (!reg.test(w)) { w = 700; } reg = new RegExp('^[0-9]*$', 'g'); if (!reg.test(h)) { h = 'auto'; } params += '&w='+w+'&h='+h; Shadowbox.open({ content: url+'?'+params, player: "iframe", title: titre, height: h, width: w }); } /* $(function(){ positionFooter(); function positionFooter(){ if($(document).height() > ($('#global').height() + $('#header').height() + $('#menu').height())){ $("#global").css({height:$(document).height()-$('#header').height()}) $(".aside").css({height:$(document).height()-$('#header').height()}) $("#footer").css({position: "absolute",bottom:0}) } } $(window) .resize(positionFooter) }); */ $(document).ready(function(){ /*changement de format dans les titres (contenus et aside)*/ $(".gabarit_14 .article:odd").addClass('odd'); $(".gabarit_14 .article:even").addClass('even'); $(".gabarit_14 .article") .addClass('biggerlink') .css({'cursor': 'pointer'}) .click(function(){ window.location = $(this).find('a').attr('href'); }) .hover( function(){$(this).addClass('hover')}, function(){$(this).removeClass('hover')} ); /*ajout des classes odd/even*/ $('.listRub li:odd').addClass('odd'); $('.aside .article h2').prepend(''); $('.titreRubrique, .titre_article, .actualites h3 ').each(function(){ var titre = $(this).html(); pattern = /\*(.+)\*/; if(matches = titre.match(pattern)){ titre = titre.replace(matches[0], ''+matches[1]+''); $(this).html(titre); } }); $(".actualites").carousel( { pagination: true } ); $("body:not(.home) .slideshow.paginate").parent().carousel({ pagination: true, loop: true, autoSlide: true, prevBtn:'

Précédent

', nextBtn:'

Suivant

' }); $(".home .galerie .divArticleImgGauche").carousel( { prevBtn:'

Précédent

', nextBtn:'

Suivant

', dispItems: 3 } ); $('body:not(.home) .galerie-wo-fancybox').before('
'); $('.galerie-wo-fancybox li:first-child').addClass('current'); $('body:not(.home) .galerie-wo-fancybox a').click(function(e){ e.preventDefault(); var img = ''; var description = ($(this).find('.imagelegende').length > 0)?$(this).find('.imagelegende').html():''; $('.galerie-zoom').html(img+'

'+description+'

'); $('.galerie-wo-fancybox').find('.current').removeClass('current'); $(this).parent().addClass('current'); }); /* -----------------------------------------------*/ $('a[rel*=shadowbox], .home .galerie-wo-fancybox li a').live('click', function(event) { Shadowbox.open(this); return false; }); /*vignettes essences*/ if($('.essences li').length > 0) { $('.essences li').each(function(){ $(this) .append('') .hover( function(){$(this).find('img').fadeIn(100)}, function(){$(this).find('img').fadeOut(100)} ) .find('img').hide() }) } /* slider home */ if(typeof $(this).cycle == 'function'){ $('#header img').wrap('
'); $.ajax({ type: 'GET', url: '/visuels.php', dataType: 'json', cache: false, error:function(xhr, status, errorThrown) { alert(errorThrown+'\n'+status+'\n'+xhr.statusText); }, success: function(data, textStatus) { var slides = data.slides; var visuels = new Array(); var titres = new Array(); for(visuel in slides){ visuels.push(visuel); titres.push(slides[visuel]); } $('#header img').attr('src', visuels.shift()); $('#header img').show(); var totalSlideCount = 1+ visuels.length; var $slideshow = $('#header .visuel'); /*$slideshow .after('') .after('') */ $slideshow.prepend(''); $slideshow.append(''); function onBefore(curr, next, opts, fwd) { if (!opts.addSlide) return; if (opts.slideCount == totalSlideCount) return; var nextSlideSrc = fwd ? visuels.shift() : visuels.pop(); opts.addSlide('', fwd == false); }; function onAfter(curr, next, opts, fwd) { $('#header span').html(slides[next.src]); }; /*$('#slidercontrols #resume a').toggle( function(e){ e.preventDefault(); $('.push dd .visuel').cycle('pause'); $(this).attr('title', 'Relancer le défilement automatique'); $(this).parent().addClass("paused"); }, function(e){ e.preventDefault(); $('.push dd .visuel').cycle('resume'); $(this).attr('title', 'Arrêter le défilement'); $(this).parent().removeClass("paused"); } );*/ /*$('#slidercontrols #diaporama-mode a').click(function(e){ e.preventDefault(); $('.group1').each(function(){ $(this).data('left', $(this).css('left')); $(this).animate({'left': '-5000px'}); }); $('.group2').each(function(){ $(this).data('top', $(this).css('top')); $(this).animate({'top': '-1000px'}); }) init_splash_animation(); });*/ $('#header .visuel').cycle({ fx: 'fade', /*prev: '#sliderprev', next: '#slidernext',*/ height: 304, startingSlide: Math.floor(Math.random() * 3)+1, speed: 500, fastOnEvent: 500, timeout: 5000, after: onAfter, before: onBefore }); } }) }; })