// Auto défilement if(Object.isUndefined(AutoDefilSpeed)) var AutoDefilSpeed=4000; if(Object.isUndefined(AutoDefilOnload)) var AutoDefilOnload=true; // IE (effet) if(Object.isUndefined(EffetTransition)) var EffetTransition=true; if(Object.isUndefined(EffetTransitionIE)) var EffetTransitionIE=true; if(Object.isUndefined(DurationEffetTransition1)) var DurationEffetTransition1=1; // Global Variable var IdPosition = "Position"; var TabSrcPhotoGrande = Array(); var IdGrandePhoto = "GrandePhoto"; // ------------------------------------------------------------ // // OBSERVE // // ------------------------------------------------------------ // //function Observe(IdElement,NumPhoto) { Event.observe(IdElement, EventChangePhoto, function (e) { ChangePhoto(NumPhoto); RestartAutoDefil();} ); } Event.observe(window, 'load', Init, false); // ------------------------------------------------------------ // // INIT // // ------------------------------------------------------------ // //var photoNum=""; function Init() { // Définitl'id de la grande photo if(!Object.isElement($(IdGrandePhoto))) IdGrandePhoto="tofcentrale"; // Définit l'id de l'element de position if(!Object.isElement($(IdPosition))) IdPosition="position"; if(TabSrcPhotoGrande.length) { // Affichage de la premiere photo DisplayPicture(1); // Auto Defil if(AutoDefilOnload) PlayAutoDefil(); // Click on photo grande Event.observe(IdGrandePhoto, "click", AfficherPopup); // Creation de la popup var PopPhoto = ""; PopPhoto = ""; PopPhoto+= ""; // Insertion de la popup new Insertion.Bottom(document.body, PopPhoto); } } // ----------------------------------------------------------- // // DISPLAY PICTURE // // ----------------------------------------------------------- // var bToggle = 0; var IdPosition="Position"; function Changephoto(source) { DisplayPicture(source); } function DisplayPicture(NumPhoto) { if(TabSrcPhotoGrande.length>0) { // Changement de photo if(EffetTransitionIE && Prototype.Browser.IE && window.createPopup && $(IdGrandePhoto).style.filter!="" && $(IdGrandePhoto).style.filter!=null && $(IdGrandePhoto).filters!=null) { $(IdGrandePhoto).filters[0].Apply(); if (bToggle) { bToggle = 0; $(IdGrandePhoto).src=TabSrcPhotoGrande[NumPhoto];} else { bToggle = 1; $(IdGrandePhoto).src=TabSrcPhotoGrande[NumPhoto];} $(IdGrandePhoto).filters[0].Play(); } else { $(IdGrandePhoto).setOpacity(0); $(IdGrandePhoto).src=TabSrcPhotoGrande[NumPhoto]; new Effect.Appear($(IdGrandePhoto), {duration: 0.5, queue: 'end'}); } // Maj de la position if($(IdPosition)!=null) $(IdPosition).innerHTML=NumPhoto; } } // ------------------------------------------------------------ // // PHOTO SUIVANTE // // ------------------------------------------------------------ // function PhotoSuivante() { if($(IdPosition).innerHTML < TabSrcPhotoGrande.length-1) DisplayPicture(eval($(IdPosition).innerHTML)+1); else DisplayPicture(1); RestartAutoDefil(); } // ------------------------------------------------------------ // // PHOTO PRECEDENTE // // ------------------------------------------------------------ // function PhotoPrecedente() { if($(IdPosition).innerHTML > 1) DisplayPicture(eval($(IdPosition).innerHTML)-1); RestartAutoDefil(); } // ------------------------------------------------------------ // // PLAY AUTO DEFIL // // ------------------------------------------------------------ // var TimeOutId =""; var Autodefil=false; function PlayAutoDefil() { Autodefil=true; TimeOutId=setTimeout ( DoAutoDefil, AutoDefilSpeed ); } function DoAutoDefil() { Autodefil=true; if($(IdPosition).innerHTML < TabSrcPhotoGrande.length-1) DisplayPicture(eval($(IdPosition).innerHTML)+1); else DisplayPicture(1); TimeOutId=setTimeout ( PlayAutoDefil, AutoDefilSpeed ); } // ------------------------------------------------------------ // // PLAY AUTO DEFIL // // ------------------------------------------------------------ // function RestartAutoDefil() { if(Autodefil) { StopAutoDefil(); PlayAutoDefil(); } } // ------------------------------------------------------------ // // STOP AUTO DEFIL // // ------------------------------------------------------------ // function StopAutoDefil() { clearTimeout(TimeOutId); Autodefil=false; } // ------------------------------------------------------------ // // CHANGE PHOTO NEWS // // ------------------------------------------------------------ // function ChangePhotoNews(obj) { $("grande_photo").src=obj.src; } // ------------------------------------------------------------ // // DEFIL D // // ------------------------------------------------------------ // cpt1=0; // La fonction qui fait défiler le menu vers la gauche function DefilD(id) { var TailleMinis=$('minis').offsetWidth; var blok=$(id).style; var LEFT = blok.left.replace('px',''); if (LEFT>=-(TailleMinis-610)) blok.left=(Number(LEFT)-1)+"px"; if (LEFT<-(TailleMinis-610)) return; if (cpt1>10) { cpt1=0; return; } cpt1++; id2=id; setTimeout('DefilD(id2)', 1); } // ------------------------------------------------------------ // // DEFIL G // // ------------------------------------------------------------ // cpt2=0; function DefilG(id)// La fonction qui fait défiler le menu vers la droite { var blok=$(id).style; var LEFT = blok.left.replace('px',''); if (LEFT<=3) blok.left=(Number(LEFT)+1)+"px"; if (LEFT>3) return; if (cpt2>10) { cpt2=0; return; } cpt2++; id2=id; setTimeout('DefilG(id2)', 1); } // ------------------------------------------------------------ // // OPACITER // // ------------------------------------------------------------ // function Opaciter(cur,which) { if(document.getElementById) { if (which==0) { if(document.all) cur.filters.alpha.opacity=100; else cur.style.setProperty("-moz-opacity", 1, ""); } else { if(document.all) cur.filters.alpha.opacity=40 else cur.style.setProperty("-moz-opacity", .4, ""); } } } // ------------------------------------------------------------ // // AFFICHER POPUP // // ------------------------------------------------------------ // function AfficherPopup() { if(TabSrcPhotoMaxi.length>1) { // Affichage de la popup if(Prototype.Browser.IE && version > 6) { document.getElementById("overlay").style.opacity=0.84; //document.getElementById("overlay").filters.alpha.opacity=84; document.getElementById("overlay").style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=84)'; document.getElementById("overlay").style.display="block"; document.getElementById("Container").style.opacity=1; //document.getElementById("Container").filters.alpha.opacity=1; document.getElementById("Container").style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'; document.getElementById("Container").style.display="block"; } else new Effect.Parallel([ new Effect.Appear($('overlay'), {from:0, to:0.84}),new Effect.Appear($('Container'), {from:0, to:0.99}) ], {duration: 1}); if(!PopupAlreadyCreate) { InitPopup(); // Evenement pour l'affichage de la popup Event.observe(document, 'mousemove', function (e) { var MouseX=Event.pointerX(e); var MouseY=Event.pointerY(e); var WidthMenu=$('LinkContainer').offsetWidth; var HeightMenu=$('LinkContainer').offsetHeight; var MenuCoinXGauche=Position.cumulativeOffset($("LinkContainer"))[0]; var MenuCoinXDroit=MenuCoinXGauche+WidthMenu; var MenuCoinYHaut=Position.cumulativeOffset($("LinkContainer"))[1]; var MenuCoinYBas=MenuCoinYHaut+HeightMenu; if(MouseX>MenuCoinXGauche && MouseXMenuCoinYHaut && MouseY 6) { document.getElementById("LinkContainer").style.opacity=0.7; document.getElementById("LinkContainer").style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=70)'; document.getElementById("LinkContainer").style.display="block"; } else new Effect.Appear($('LinkContainer'), {duration: 0.5, from:0 , to:0.7 }); } }); } } } // ------------------------------------------------------------ // // CLICK ON DIAPO // // ------------------------------------------------------------ // function ClickOnDiapo() { var arVersion = navigator.appVersion.split("MSIE"); var version = parseFloat(arVersion[1]); //if(Prototype.Browser.IE && version > 6) console.log(IdGrandePhoto); //$(IdGrandePhoto).click(); //else AfficherPopup(); AfficherPopup(); }