function byId(b){return document.getElementById(b)}function byTN(b,a){a=a?a:document;return a.getElementsByTagName(b)}String.prototype.trim=function(){var b=this.replace(/^\s+/,''),a;for(a=b.length-1;a>=0;a--){if(/\S/.test(b.charAt(a))){b=b.substring(0,a+1);break}}return b};function transfer(b,a){var c,d={};for(c in a){d[c]=a[c]}for(c in b){d[c]=b[c]}return d}function setOpacity(b,a){a=(a==1)?0.99999:a;b.style.opacity=a;b.style.filter='alpha(opacity='+a*100+')';b.style.MozOpacity=a;b.style.KhtmlOpacity=a}function easeInOut(b,a,c,d,f){var h=a-b,g=b+(Math.pow(((1/c)*d),f)*h);return g}function getPos(b){var a={'r':0,'l':0,'t':0,'b':0},c=b;do{a.l+=c.offsetLeft;c=c.offsetParent}while(c!==null);a.r=a.l+b.offsetWidth;c=b;do{a.t+=c.offsetTop;c=c.offsetParent}while(c!==null);a.b=a.t+b.offsetHeight;return a}function pageDim(){var b=document,a=b.documentElement,c=b.body,d,f;f=a.scrollHeight;d=a.scrollWidth;if(a.clientHeight>f){f=a.clientHeight}if(a.clientWidth>d){d=a.clientWidth}if(c.scrollHeight>f){f=c.scrollHeight}if(c.scrollWidth>d){d=c.scrollWidth}return{'w':d,'h':f}}function scrolled(){var b,a;if(window.pageXOffset!==undefined){b=window.pageXOffset;a=window.pageYOffset}else{b=document.documentElement.scrollLeft?document.documentElement.scrollLeft:(document.body.scrollLeft?document.body.scrollLeft:0);a=document.documentElement.scrollTop?document.documentElement.scrollTop:(document.body.scrollTop?document.body.scrollTop:0)}return{'x':b,'y':a}}function winDim(){var b,a;if(window.innerWidth){b=window.innerWidth;a=window.innerHeight}else if(document.documentElement.clientWidth){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else if(document.body.clientWidth){b=document.body.clientWidth;a=document.body.clientHeight}else{alert("winDim() n'est pas parvenu � lire les dimentions de la fen�tre")}return{'w':b,'h':a}}function redimArea(b,a,c){c=typeof c=='object'?c:{};var d=c.max_w,f=c.min_w,h=c.max_h,g=c.max_h,i=b/a,k=a/b,j=a,l=b;if(ld)){l=d;j=l*k}if(h&&(j>h)){j=h;l=j*i}l=l<0?0:l;j=j<0?0:j;return{w:Math.round(l),h:Math.round(j)}}function Animate(k,j){this.defSettings={"elem":window.document.body,"from":{},"to":{},"restart":false,"ease":1,"duration":1000,"frameRate":30,"onFinish":false};this.defSettings=transfer(k,this.defSettings);this.guessProp=function(b){var a=this.options.elem;switch(b){case'width':return a.offsetWidth+'px';case'height':return a.offsetHeight+'px';case'top':return(typeof(getPos)=='undefined')?'0px':getPos(a,'t')+'px';case'bottom':return(typeof(getPos)=='undefined')?'0px':getPos(a,'b')+'px';case'left':return(typeof(getPos)=='undefined')?'0px':getPos(a,'l')+'px';case'right':return(typeof(getPos)=='undefined')?'0px':getPos(a,'r')+'px';case'borderWidth':return'1px';case'borderColor':return'rgb(0,0,0)';case'backgroundColor':return'rgb(255,255,255)';case'color':return'rgb(0,0,0)';case'opacity':return 1;default:return 0}return false};this.readProp=function(b){var a={},c;a.asked=b+'';a.unit=a.asked.match(/px|em|%/);a.clean=parseFloat(a.asked);c=a.asked.match(/rgb|(#[a-f0-9]{3,6})/i);if(typeof rgbString2Array=='function'&&typeof sharp2rgb=='function'&&c){a.clean=a.asked;a.rgb=rgbString2Array(sharp2rgb(a.asked));if(!a.rgb){a.rgb=rgbString2Array(a.asked)}}return a};this.readFromTo=function(b){if(!b){return false}var a,c,d,f,h={};if(typeof b=='string'){b=b.trim();var g=b.split(/;/);c=g.length;for(a=0;athis.gal.length-1?0:(b<0?this.gal.length-1:b);this.active=b;this.go(this.gal[b])},progImg:function(b){b=b===undefined?imZoom.active+1:b;imZoom.prog=setTimeout(function(){imZoom.goTo(b)},imZoom.options.slideDelay)},play:function(){if(!imZoom.prog){this.progImg();byId('izPlay').style.display='none';byId('izPause').style.display=''}},pause:function(){clearTimeout(imZoom.prog);imZoom.prog=0;byId('izPause').style.display='none';byId('izPlay').style.display=''},callback:function(b){if(typeof imZoom.options[b]==='function'&&byId('izImg')){imZoom.options[b]()}},change:function(){this.animCont.go({from:{opacity:1},to:{opacity:0},onFinish:function(){var a=byId('izImg');if(a){a.onload=function(){imZoom.setPos();var b=byId('izTitle');if(b&&imZoom.options.showTitle){b.innerHTML=imZoom.gal[imZoom.active].title}imZoom.animCont.go({to:{opacity:1},onFinish:function(){imZoom.callback('onChange');if(imZoom.prog){clearTimeout(imZoom.prog);imZoom.prog=0;imZoom.progImg()}}})};a.src=imZoom.gal[imZoom.active].href}}})},go:function(b,a){var c=0,d;var f;var h;var g;var i=byId('izCont');if(!i){a=typeof a==='object'?a:{};for(d in this.defaultOpt){if(typeof a[d]==='undefined'){a[d]=this.defaultOpt[d]}}this.options=a;while(this.gal[c]!==b&&c'}if(d.showNav&&this.gal.length>1){i.innerHTML+=' '+d.prevTxt+' '+d.playTxt+' '+d.nextTxt+''}if((d.showNav||d.showTitle)){i.style.display=''}var m=imZoom.getImgDim();i.style.display='none';l=new Animate({elem:g,to:{opacity:d.screenOpacity},from:{opacity:0},duration:d.openDuration,ease:d.animEase,frameRate:d.frameRate},1);this.animCont=new Animate({elem:k,duration:d.changeDuration,ease:d.animEase,frameRate:d.frameRate});this.animCont.go({duration:d.openDuration,to:{width:m.w+'px',height:m.h+'px',top:m.t+'px',left:m.l+'px'},from:{width:this.area.offsetWidth+'px',height:this.area.offsetHeight+'px',top:h.t+'px',left:h.l+'px'},onFinish:function(){if((d.showNav||d.showTitle)&&byId('izMeta')){byId('izMeta').style.display=''}imZoom.setPos();if(imZoom.options.autoPlay){imZoom.play()}imZoom.callback('onOpen')}})}}};if(window.attachEvent){window.attachEvent('onresize',imZoom.setPos);window.attachEvent('onscroll',imZoom.setPos)}else{window.addEventListener('resize',imZoom.setPos,false);window.addEventListener('scroll',imZoom.setPos,false)}