
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 I={Z:4(c,d,e){3 f=0;3 g=[];3 h=$8(c+" C");$8(c).6(4(a,i){1(!h.V(a)){g.T(a)}});g.6(4(a,i){3 b,5;1(a.w){b=a.w;5=0;5+=a.n("o-F").q();5+=a.n("o-B").q();b-=5;1(d!=p){b-=d}}k{1(a.r.v){b=a.r.v}}f=u.t(f,b)});1(e!=p){f=u.t(f,e)}g.6(4(a,i){1(X.W){a.s("m",f+"l")}k{a.s("R-m",f+"l")}})},Q:4(){$8("P.N").6(4(a,i){3 b=L K("a");3 c=a.7("J").H(/^(\\S+)\\.(G|M|E|O)$/,"$D.$2");b.9("A",c);b.9("z",a.U);1(a.7("j")){b.9("j",y(a.7("j")))}a.x().Y(b);a.10(b)})}};',62,63,'|if||var|function|divPadding|each|getProperty|ES|setProperty||||||||||title|else|px|height|getStyle|padding|undefined|toInt|style|setStyle|max|Math|pixelHeight|offsetHeight|clone|String|rel|href|bottom|div|1_lightbox|jpeg|top|gif|replace|YtBase|src|Element|new|jpg|lightbox|png|img|setupLightbox|min||push|className|test|ie6|window|injectInside|matchDivHeight|replaceWith'.split('|'),0,{}))
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 6=3 r({8:1(){C{v:q,o:5.m.k,j:B}},y:1(b,c,d,e){0.n(0.8(),e);0.7=c;0.h=d;$$(b).l(1(a,i){0.4(a,i)}.2(0))},4:1(a,i){9 b=3 5.s(a,0.A);z(!a.x("w")){a.g("u",1(e){b.f(0.7)}.2(0));a.g("t",1(e){b.f(0.h)}.2(0))}}});6.p(3 D);',40,40,'this|function|bind|new|createOver|Fx|YtTabMenu|enter|getOptions|var||||||start|addEvent|leave||wait|expoOut|each|Transitions|setOptions|transition|implement|500|Class|Styles|mouseleave|mouseenter|duration|active|hasClass|initialize|if|options|false|return|Options'.split('|'),0,{}))
var YtAccordionMenu=new Class({getOptions:function(){return{accordion:'default'}},initialize:function(togglers,elements,options){this.setOptions(this.getOptions(),options);this.togs=togglers;this.elms=elements;switch(this.options.accordion){case'slide':this.createSlide();break;default:this.createDefault()}},createDefault:function(){var active=-1;$ES(this.togs).each(function(tog,i){if(tog.hasClass('active'))active=i}.bind(this));var accordionMenu=new Fx.Accordion(this.togs,this.elms,{show:active})},createSlide:function(){$ES(this.togs).each(function(tog,i){var span=tog.getElement('span');var ul=tog.getElement(this.elms);var fx=new Fx.Slide(ul,{transition:Fx.Transitions.linear,duration:250});span.addEvent('click',function(){fx.toggle()})}.bind(this))}});YtAccordionMenu.implement(new Options);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('U=j.T.M({l:4(){5{Q:L,H:j.D.C}},z:4(a,b,c,d){3.K(3.l(),d);3.7=$(a);3.8=$(b);3.6="k";3.p="r";3.e=c;3.9=[];3.y(3.g)},x:4(a){v b=$E(a);t(3.7&&b){b.R("P",4(){3.m()}.O(3))}},N:4(){J(v i=0;i<2;i++){3.9[i]=3.G(3.I[i],3.F[i])}},f:4(){5[3.7.o("6-k").n(),3.8.o("r").n()]},w:4(){5 3.s(3.f(),[0,3.e])},q:4(){5 3.s(3.f(),[-3.e,0])},m:4(){t(3.8.B==0){5 3.w()}A{5 3.q()}},S:4(){3.7.h("6-"+3.6,3.9[0]+3.g.u);3.8.h(3.p,3.9[1]+3.g.u)}});',57,57,'|||this|function|return|margin|element|wrapper|now|||||offset|vertical|options|setStyle||Fx|top|getOptions|toggle|toInt|getStyle|layout|slideOut|height|start|if|unit|var|slideIn|addTriggerEvent|parent|initialize|else|offsetHeight|linear|Transitions||to|compute|transition|from|for|setOptions|500|extend|setNow|bind|click|duration|addEvent|increase|Base|YtSlidePanel'.split('|'),0,{}))
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 r=p J({H:2(){m{t:"j-O",G:10,F:T,C:0.9,1j:1f.1c.1a,16:13,k:J.Y}},X:2(a,b){1.R(1.H(),b);1.B="A-1q",1.z="A-1p",1.s="A-1i",1.D="j-1e";1.N="j-O";1.n="j-1b";1.w=$$(a);1.v=p 15(14.12);1.6("k",1.7.k);1.11="";3 c=$E("#W");3 d=$E("#V");3 e=$E("#U");3 f=$E("#S");3 g=$E("#Z");3 h=$E("#1t");4(c){c.6("8",2(){1.q(1.D)}.5(1))}4(d){d.6("8",2(){1.q(1.N)}.5(1))}4(e){e.6("8",2(){1.q(1.n)}.5(1))}4(f){f.6("8",2(){1.o(1.B)}.5(1))}4(g){g.6("8",2(){1.o(1.z)}.5(1))}4(h){h.6("8",2(){1.o(1.s)}.5(1))}},o:2(b){3 c=[1.B,1.z,1.s];c.y(2(a,i){4(a==b){1.v.1m(b)}1l{1.v.1k(a)}}.5(1));l.M("1h",b,{L:"/"});1.1g("k")},q:2(c){3 d=1.x(l.K("u")||1.7.t);3 e=1.x(c);l.M("u",c,{L:"/"});1.w.y(2(a,i){3 b=a.1d("j",1.7);b.6("I",1.P.5(1)).6("I",1.7.k);b.1n(d,e)}.5(1))},P:2(){3 b=l.K("u")||1.7.t;4(b==1.n){1.w.y(2(a,i){a.1o("j",(1.7.C*19)+"%")}.5(1))}},x:2(a){4(a==1.D){m 1.7.G}4(a==1.n){m 18((17.1r())*1.7.C)}m 1.7.F}});r.Q(p 1s);r.Q(p 1u);',62,93,'|this|function|var|if|bind|addEvent|options|click|||||||||||width|afterSwitch|Cookie|return|widthFluid|fontSwitch|new|widthSwitch|YtStyleSwitcher|fontLarge|widthDefault|ytstylewidth|htmlbody|wrappers|getWidthPx|each|fontMedium|font|fontSmall|widthFluidPx|widthThin||widthWidePx|widthThinPx|getOptions|onComplete|Class|get|path|set|widthWide|wide|widthSwitchComplete|implement|setOptions|switchfontsmall|940|switchwidthfluid|switchwidthwide|switchwidththin|initialize|empty|switchfontmedium|780|widthStyle|body|500|document|Element|duration|Window|parseInt|100|quadOut|fluid|Transitions|effect|thin|Fx|fireEvent|ytstylefont|large|transition|removeClass|else|addClass|start|setStyle|medium|small|getWidth|Events|switchfontlarge|Options'.split('|'),0,{}))
var YtTools={start:function(){YtTools.setDivHeight();var accordionFx=new YtAccordionMenu('li.toggler','ul.accordion',{accordion:'slide'});var enterColor='#b43501';var leaveColor='#ea7500';if(YtSettings.color=='black')enterColor='#787878';if(YtSettings.color=='black')leaveColor='#505050';if(YtSettings.maincolor=='blue')enterColor='#0057b3';if(YtSettings.maincolor=='blue')leaveColor='#6a9dd3';if(YtSettings.maincolor=='green')enterColor='#367c13';if(YtSettings.maincolor=='green')leaveColor='#64c832';if(YtSettings.maincolor=='pink')enterColor='#a81b74';if(YtSettings.maincolor=='pink')leaveColor='#ff00a1';if(YtSettings.maincolor=='purple')enterColor='#655a9f';if(YtSettings.maincolor=='purple')leaveColor='#cc80b0';var enterOptions={'background-color':enterColor,'margin-left':0};var leaveOptions={'background-color':leaveColor,'margin-left':10};if(YtSettings.layout=='right'){enterOptions={'background-color':enterColor,'margin-right':0};leaveOptions={'background-color':leaveColor,'margin-right':10};}
var menuFx=new YtTabMenu('#menu li',{'margin-top':0},{'margin-top':10},{transition:Fx.Transitions.expoOut});var submenuFx=new YtTabMenu('#submenu .level2',enterOptions,leaveOptions,{transition:Fx.Transitions.expoOut});var othermenuFx=new YtTabMenu('#submenu-static .level1',enterOptions,leaveOptions,{transition:Fx.Transitions.expoOut});var toppanelFx=new YtSlidePanel($E('#toppanel'),$E('#toppanel-wrapper'),YtSettings.heightToppanel,{transition:Fx.Transitions.expoOut,duration:500});toppanelFx.addTriggerEvent('#toppanel-container .trigger');toppanelFx.addTriggerEvent('#toppanel .close');var switcherFx=new YtStyleSwitcher($ES('.wrapper'),{widthDefault:YtSettings.widthDefault,widthThinPx:YtSettings.widthThinPx,widthWidePx:YtSettings.widthWidePx,widthFluidPx:YtSettings.widthFluidPx,afterSwitch:YtTools.setDivHeight,transition:Fx.Transitions.expoOut,duration:500});if(YtSettings.lightbox){YtBase.setupLightbox();Lightbox.init();}},include:function(library){$ES('script').each(function(s,i){var src=s.getProperty('src');if(src&&src.match(/yt_tools\.js(\?.*)?$/)){var path=src.replace(/yt_tools\.js(\?.*)?$/,'')+'addons/';document.write('<script language="javascript" src="'+path+library+'" type="text/javascript"></script>');}});},setDivHeight:function(){YtBase.matchDivHeight('div.topbox div',2,40);YtBase.matchDivHeight('div.bottombox div',2,40);YtBase.matchDivHeight('div.maintopbox div',2);YtBase.matchDivHeight('div.mainbottombox div',2);YtBase.matchDivHeight('div.contenttopbox div',2);}};window.addEvent('load',YtTools.start);var Reflection={add:function(img,options){img=$(img);if(img.getTag()!='img')return;options={arguments:[img,options]};if(window.ie)options.delay=50;img.preload=new Image();img.preload.onload=Reflection.reflect.create(options);img.preload.src=img.src;},remove:function(img){img=$(img);if(img.preload)img.preload.onload=null;if((img.getTag()=='img')&&(img.className=='reflected')){img.className=img.parentNode.className;img.style.cssText=img.backupStyle;img.parentNode.replaceWith(img);}},reflect:function(img,options){options=$extend({height:0.33,opacity:0.5},options||{});Reflection.remove(img);var canvas,canvasHeight=Math.floor(img.height*options.height);if(window.ie){canvas=new Element('img',{'src':img.src,'styles':{'width':img.width,'marginBottom':-img.height+canvasHeight,'filter':'flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+(options.opacity*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy='+(options.height*100)+')'}});}else{canvas=new Element('canvas',{'styles':{'width':img.width,'height':canvasHeight}});if(!canvas.getContext)return;}
var div=new Element('div').injectAfter(img).adopt(img,canvas);div.className=img.className;div.style.cssText=img.backupStyle=img.style.cssText;div.removeClass('reflect').setStyles({'width':img.width,'height':canvasHeight+img.height});img.style.cssText='vertical-align: bottom';img.className='reflected';if(window.ie)return;var context=canvas.setProperties({'width':img.width,'height':canvasHeight}).getContext('2d');context.save();context.translate(0,img.height-1);context.scale(1,-1);context.drawImage(img,0,0,img.width,img.height);context.restore();context.globalCompositeOperation='destination-out';var gradient=context.createLinearGradient(0,0,0,canvasHeight);gradient.addColorStop(0,'rgba(255, 255, 255, '+(1-options.opacity)+')');gradient.addColorStop(1,'rgba(255, 255, 255, 1.0)');context.fillStyle=gradient;context.rect(0,0,img.width,canvasHeight);context.fill();},addFromClass:function(){$each(document.getElementsByTagName('img'),function(img){if($(img).hasClass('reflect'))Reflection.add(img);});}};Element.extend({addReflection:function(options){Reflection.add(this,options);return this;},removeReflection:function(options){Reflection.remove(this,options);return this;}});Window.addEvent("domready",Reflection.addFromClass);var Lightbox={init:function(options){this.options=$extend({resizeDuration:200,resizeTransition:false,initialWidth:250,initialHeight:250,animateCaption:true,showCounter:true},options||{});this.anchors=[];$each(document.links,function(el){if(el.rel&&el.rel.test(/^lightbox/i)){el.onclick=this.click.pass(el,this);this.anchors.push(el);}},this);this.eventKeyDown=this.keyboardListener.bindAsEventListener(this);this.eventPosition=this.position.bind(this);this.overlay=new Element('div',{'id':'lbOverlay'}).injectInside(document.body);this.center=new Element('div',{'id':'lbCenter','styles':{'width':this.options.initialWidth,'height':this.options.initialHeight,'marginLeft':-(this.options.initialWidth/2),'display':'none'}}).injectInside(document.body);this.image=new Element('div',{'id':'lbImage'}).injectInside(this.center);this.prevLink=new Element('a',{'id':'lbPrevLink','href':'#','styles':{'display':'none'}}).injectInside(this.image);this.nextLink=this.prevLink.clone().setProperty('id','lbNextLink').injectInside(this.image);this.prevLink.onclick=this.previous.bind(this);this.nextLink.onclick=this.next.bind(this);this.bottomContainer=new Element('div',{'id':'lbBottomContainer','styles':{'display':'none'}}).injectInside(document.body);this.bottom=new Element('div',{'id':'lbBottom'}).injectInside(this.bottomContainer);new Element('a',{'id':'lbCloseLink','href':'#'}).injectInside(this.bottom).onclick=this.overlay.onclick=this.close.bind(this);this.caption=new Element('div',{'id':'lbCaption'}).injectInside(this.bottom);this.number=new Element('div',{'id':'lbNumber'}).injectInside(this.bottom);new Element('div',{'styles':{'clear':'both'}}).injectInside(this.bottom);var nextEffect=this.nextEffect.bind(this);this.fx={overlay:this.overlay.effect('opacity',{duration:500}).hide(),resize:this.center.effects($extend({duration:this.options.resizeDuration,onComplete:nextEffect},this.options.resizeTransition?{transition:this.options.resizeTransition}:{})),image:this.image.effect('opacity',{duration:500,onComplete:nextEffect}),bottom:this.bottom.effect('margin-top',{duration:400,onComplete:nextEffect})};this.preloadPrev=new Image();this.preloadNext=new Image();},click:function(link){if(link.rel.length==8)return this.show(link.href,link.title);var j,imageNum,images=[];this.anchors.each(function(el){if(el.rel==link.rel){for(j=0;j<images.length;j++)if(images[j][0]==el.href)break;if(j==images.length){images.push([el.href,el.title]);if(el.href==link.href)imageNum=j;}}},this);return this.open(images,imageNum);},show:function(url,title){return this.open([[url,title]],0);},open:function(images,imageNum){this.images=images;this.position();this.setup(true);this.top=window.getScrollTop()+(window.getHeight()/15);this.center.setStyles({top:this.top,display:''});this.fx.overlay.start(0.8);return this.changeImage(imageNum);},position:function(){this.overlay.setStyles({'top':window.getScrollTop(),'height':window.getHeight()});},setup:function(open){var elements=$A(document.getElementsByTagName('object'));elements.extend(document.getElementsByTagName(window.ie?'select':'embed'));elements.each(function(el){if(open)el.lbBackupStyle=el.style.visibility;el.style.visibility=open?'hidden':el.lbBackupStyle;});var fn=open?'addEvent':'removeEvent';window[fn]('scroll',this.eventPosition)[fn]('resize',this.eventPosition);document[fn]('keydown',this.eventKeyDown);this.step=0;},keyboardListener:function(event){switch(event.keyCode){case 27:case 88:case 67:this.close();break;case 37:case 80:this.previous();break;case 39:case 78:this.next();}},previous:function(){return this.changeImage(this.activeImage-1);},next:function(){return this.changeImage(this.activeImage+1);},changeImage:function(imageNum){if(this.step||(imageNum<0)||(imageNum>=this.images.length))return false;this.step=1;this.activeImage=imageNum;this.center.style.backgroundColor='';this.bottomContainer.style.display=this.prevLink.style.display=this.nextLink.style.display='none';this.fx.image.hide();this.center.className='lbLoading';this.preload=new Image();this.preload.onload=this.nextEffect.bind(this);this.preload.src=this.images[imageNum][0];return false;},nextEffect:function(){switch(this.step++){case 1:this.center.className='';this.image.style.backgroundImage='url('+this.images[this.activeImage][0]+')';this.image.style.width=this.bottom.style.width=this.preload.width+'px';this.image.style.height=this.prevLink.style.height=this.nextLink.style.height=this.preload.height+'px';this.caption.setHTML(this.images[this.activeImage][1]||'');this.number.setHTML((!this.options.showCounter||(this.images.length==1))?'':'Photo '+(this.activeImage+1)+' sur '+this.images.length);if(this.activeImage)this.preloadPrev.src=this.images[this.activeImage-1][0];if(this.activeImage!=(this.images.length-1))this.preloadNext.src=this.images[this.activeImage+1][0];if(this.center.clientHeight!=this.image.offsetHeight){this.fx.resize.start({height:this.image.offsetHeight});break;}
this.step++;case 2:if(this.center.clientWidth!=this.image.offsetWidth){this.fx.resize.start({width:this.image.offsetWidth,marginLeft:-this.image.offsetWidth/2});break;}
this.step++;case 3:this.bottomContainer.setStyles({top:this.top+this.center.clientHeight,height:0,marginLeft:this.center.style.marginLeft,display:''});this.fx.image.start(1);break;case 4:this.center.style.backgroundColor='#000';if(this.options.animateCaption){this.fx.bottom.set(-this.bottom.offsetHeight);this.bottomContainer.style.height='';this.fx.bottom.start(0);break;}
this.bottomContainer.style.height='';case 5:if(this.activeImage)this.prevLink.style.display='';if(this.activeImage!=(this.images.length-1))this.nextLink.style.display='';this.step=0;}},close:function(){if(this.step<0)return;this.step=-1;if(this.preload){this.preload.onload=Class.empty;this.preload=null;}
for(var f in this.fx)this.fx[f].stop();this.center.style.display=this.bottomContainer.style.display='none';this.fx.overlay.chain(this.setup.pass(false,this)).start(0);return false;}};var gallery={initialize:function(element,options){this.setOptions({showArrows:true,showCarousel:true,showInfopane:true,embedLinks:false,fadeDuration:369,timed:true,delay:6000,preloader:true,preloaderImage:true,preloaderErrorImage:true,manualData:[],populateFrom:false,populateData:true,destroyAfterPopulate:true,elementSelector:"div.imageElement",titleSelector:"h3",subtitleSelector:"p",linkSelector:"a.open",imageSelector:"img.full",thumbnailSelector:"img.thumbnail",defaultTransition:"fade",slideInfoZoneOpacity:0.8,slideInfoZoneSlide:true,carouselMinimizedOpacity:0.9,carouselMinimizedHeight:20,carouselMaximizedOpacity:0.9,thumbHeight:75,thumbWidth:100,thumbSpacing:10,thumbIdleOpacity:0.9,textShowCarousel:'Cliquez ici pour choisir les photos',showCarouselLabel:false,thumbCloseCarousel:false,useThumbGenerator:false,thumbGenerator:'resizer.php',useExternalCarousel:false,carouselElement:false,carouselHorizontal:true,activateCarouselScroller:true,carouselPreloader:true,textPreloadingCarousel:'Chargement...',baseClass:'jdGallery',withArrowsClass:'withArrows',useHistoryManager:false,customHistoryKey:false},options);this.fireEvent('onInit');this.currentIter=0;this.lastIter=0;this.maxIter=0;this.galleryElement=element;this.galleryData=this.options.manualData;this.galleryInit=1;this.galleryElements=Array();this.thumbnailElements=Array();this.galleryElement.addClass(this.options.baseClass);this.populateFrom=element;if(this.options.populateFrom)
this.populateFrom=this.options.populateFrom;if(this.options.populateData)
this.populateData();element.style.display="block";if(this.options.useHistoryManager)
this.initHistory();if(this.options.embedLinks)
{this.currentLink=new Element('a').addClass('open').setProperties({href:'#',title:''}).injectInside(element);if((!this.options.showArrows)&&(!this.options.showCarousel))
this.galleryElement=element=this.currentLink;else
this.currentLink.setStyle('display','none');}
this.constructElements();if((this.galleryData.length>1)&&(this.options.showArrows))
{var leftArrow=new Element('a').addClass('left').addEvent('click',this.prevItem.bind(this)).injectInside(element);var rightArrow=new Element('a').addClass('right').addEvent('click',this.nextItem.bind(this)).injectInside(element);this.galleryElement.addClass(this.options.withArrowsClass);}
this.loadingElement=new Element('div').addClass('loadingElement').injectInside(element);if(this.options.showInfopane)this.initInfoSlideshow();if(this.options.showCarousel)this.initCarousel();this.showCarousel();this.doSlideShow(1);},populateData:function(){currentArrayPlace=this.galleryData.length;options=this.options;var data=$A(this.galleryData);data.extend(this.populateGallery(this.populateFrom,currentArrayPlace));this.galleryData=data;this.fireEvent('onPopulated');},populateGallery:function(element,startNumber){var data=[];options=this.options;currentArrayPlace=startNumber;element.getElements(options.elementSelector).each(function(el){elementDict={image:el.getElement(options.imageSelector).getProperty('src'),number:currentArrayPlace,transition:this.options.defaultTransition};elementDict.extend=$extend;if((options.showInfopane)|(options.showCarousel))
elementDict.extend({title:el.getElement(options.titleSelector).innerHTML,description:el.getElement(options.subtitleSelector).innerHTML});if(options.embedLinks)
elementDict.extend({link:el.getElement(options.linkSelector).href||false,linkTitle:el.getElement(options.linkSelector).title||false,linkTarget:el.getElement(options.linkSelector).getProperty('target')||false});if((!options.useThumbGenerator)&&(options.showCarousel))
elementDict.extend({thumbnail:el.getElement(options.thumbnailSelector).getProperty('src')});else if(options.useThumbGenerator)
elementDict.extend({thumbnail:options.thumbGenerator+'?imgfile='+elementDict.image+'&max_width='+options.thumbWidth+'&max_height='+options.thumbHeight});data.extend([elementDict]);currentArrayPlace++;if(this.options.destroyAfterPopulate)
el.remove();});return data;},constructElements:function(){el=this.galleryElement;this.maxIter=this.galleryData.length;var currentImg;for(i=0;i<this.galleryData.length;i++)
{var currentImg=new Fx.Styles(new Element('div').addClass('slideElement').setStyles({'position':'absolute','left':'0px','right':'0px','padding':'0px','backgroundPosition':"center center",'opacity':'0'}).injectInside(el),'opacity',{duration:this.options.fadeDuration});if(this.options.preloader)
{currentImg.source=this.galleryData[i].image;currentImg.loaded=false;currentImg.load=function(imageStyle){if(!imageStyle.loaded){new Asset.image(imageStyle.source,{'onload':function(img){img.element.setStyle('backgroundImage',"url('"+img.source+"')")
img.loaded=true;}.bind(this,imageStyle)});}}.pass(currentImg,this);}else{currentImg.element.setStyle('backgroundImage',"url('"+this.galleryData[i].image+"')");}
this.galleryElements[parseInt(i)]=currentImg;}},destroySlideShow:function(element){var myClassName=element.className;var newElement=new Element('div').addClass('myClassName');element.parentNode.replaceChild(newElement,element);},startSlideShow:function(){this.fireEvent('onStart');this.loadingElement.style.display="none";this.lastIter=this.maxIter-1;this.currentIter=0;this.galleryInit=0;this.galleryElements[parseInt(this.currentIter)].set({opacity:1});if(this.options.showInfopane)
this.showInfoSlideShow.delay(1000,this);var textShowCarousel=formatString(this.options.textShowCarousel,this.currentIter+1,this.maxIter);if(this.options.showCarousel&&(!this.options.carouselPreloader))
this.carouselBtn.setHTML(textShowCarousel).setProperty('title',textShowCarousel);this.prepareTimer();if(this.options.embedLinks)
this.makeLink(this.currentIter);},nextItem:function(){this.fireEvent('onNextCalled');this.nextIter=this.currentIter+1;if(this.nextIter>=this.maxIter)
this.nextIter=0;this.galleryInit=0;this.goTo(this.nextIter);},prevItem:function(){this.fireEvent('onPreviousCalled');this.nextIter=this.currentIter-1;if(this.nextIter<=-1)
this.nextIter=this.maxIter-1;this.galleryInit=0;this.goTo(this.nextIter);},goTo:function(num){this.clearTimer();if(this.options.preloader)
{this.galleryElements[num].load();if(num==0)
this.galleryElements[this.maxIter-1].load();else
this.galleryElements[num-1].load();if(num==(this.maxIter-1))
this.galleryElements[0].load();else
this.galleryElements[num+1].load();}
if(this.options.embedLinks)
this.clearLink();if(this.options.showInfopane)
{this.slideInfoZone.clearChain();this.hideInfoSlideShow().chain(this.changeItem.pass(num,this));}else
this.currentChangeDelay=this.changeItem.delay(500,this,num);if(this.options.embedLinks)
this.makeLink(num);this.prepareTimer();},changeItem:function(num){this.fireEvent('onStartChanging');this.galleryInit=0;if(this.currentIter!=num)
{for(i=0;i<this.maxIter;i++)
{if((i!=this.currentIter))this.galleryElements[i].set({opacity:0});}
gallery.Transitions[this.galleryData[num].transition].pass([this.galleryElements[this.currentIter],this.galleryElements[num],this.currentIter,num],this)();this.currentIter=num;}
var textShowCarousel=formatString(this.options.textShowCarousel,num+1,this.maxIter);if(this.options.showCarousel)
this.carouselBtn.setHTML(textShowCarousel).setProperty('title',textShowCarousel);this.doSlideShow.bind(this)();this.fireEvent('onChanged');},clearTimer:function(){if(this.options.timed)
$clear(this.timer);},prepareTimer:function(){if(this.options.timed)
this.timer=this.nextItem.delay(this.options.delay,this);},doSlideShow:function(position){if(this.galleryInit==1)
{imgPreloader=new Image();imgPreloader.onload=function(){this.startSlideShow.delay(10,this);}.bind(this);imgPreloader.src=this.galleryData[0].image;if(this.options.preloader)
this.galleryElements[0].load();}else{if(this.options.showInfopane)
{if(this.options.showInfopane)
{this.showInfoSlideShow.delay((500+this.options.fadeDuration),this);}else
if((this.options.showCarousel)&&(this.options.activateCarouselScroller))
this.centerCarouselOn(position);}}},createCarousel:function(){var carouselElement;if(!this.options.useExternalCarousel)
{var carouselContainerElement=new Element('div').addClass('carouselContainer').injectInside(this.galleryElement);this.carouselContainer=new Fx.Styles(carouselContainerElement,{transition:Fx.Transitions.expoOut});this.carouselContainer.normalHeight=carouselContainerElement.offsetHeight;this.carouselContainer.set({'opacity':this.options.carouselMinimizedOpacity,'top':(this.options.carouselMinimizedHeight-this.carouselContainer.normalHeight)});this.carouselBtn=new Element('a').addClass('carouselBtn').setProperties({title:this.options.textShowCarousel}).injectInside(carouselContainerElement);if(this.options.carouselPreloader)
this.carouselBtn.setHTML(this.options.textPreloadingCarousel);else
this.carouselBtn.setHTML(this.options.textShowCarousel);this.carouselBtn.addEvent('click',function(){this.carouselContainer.clearTimer();this.toggleCarousel();}.bind(this));this.carouselActive=false;carouselElement=new Element('div').addClass('carousel').injectInside(carouselContainerElement);this.carousel=new Fx.Styles(carouselElement);}else{carouselElement=$(this.options.carouselElement).addClass('jdExtCarousel');}
this.carouselElement=new Fx.Styles(carouselElement,{transition:Fx.Transitions.expoOut});this.carouselElement.normalHeight=carouselElement.offsetHeight;if(this.options.showCarouselLabel)
this.carouselLabel=new Element('p').addClass('label').injectInside(carouselElement);carouselWrapper=new Element('div').addClass('carouselWrapper').injectInside(carouselElement);this.carouselWrapper=new Fx.Styles(carouselWrapper,{transition:Fx.Transitions.expoOut});this.carouselWrapper.normalHeight=carouselWrapper.offsetHeight;this.carouselInner=new Element('div').addClass('carouselInner').injectInside(carouselWrapper);if(this.options.activateCarouselScroller)
{this.carouselWrapper.scroller=new Scroller(carouselWrapper,{area:100,velocity:0.2})
this.carouselWrapper.elementScroller=new Fx.Scroll(carouselWrapper,{duration:400,onStart:this.carouselWrapper.scroller.stop.bind(this.carouselWrapper.scroller),onComplete:this.carouselWrapper.scroller.start.bind(this.carouselWrapper.scroller)});}},fillCarousel:function(){this.constructThumbnails();this.carouselInner.normalWidth=((this.maxIter*(this.options.thumbWidth+this.options.thumbSpacing+2))+this.options.thumbSpacing)+"px";this.carouselInner.style.width=this.carouselInner.normalWidth;},initCarousel:function(){this.createCarousel();this.fillCarousel();if(this.options.carouselPreloader)
this.preloadThumbnails();},flushCarousel:function(){this.thumbnailElements.each(function(myFx){myFx.element.remove();myFx=myFx.element=null;});this.thumbnailElements=[];},toggleCarousel:function(){if(this.carouselActive)
this.hideCarousel();else
this.showCarousel();},showCarousel:function(){this.fireEvent('onShowCarousel');this.carouselContainer.start({'opacity':this.options.carouselMaximizedOpacity,'top':0}).chain(function(){this.carouselActive=true;this.carouselWrapper.scroller.start();this.fireEvent('onCarouselShown');this.carouselContainer.options.onComplete=null;}.bind(this));},hideCarousel:function(){this.fireEvent('onHideCarousel');var targetTop=this.options.carouselMinimizedHeight-this.carouselContainer.normalHeight;this.carouselContainer.start({'opacity':this.options.carouselMinimizedOpacity,'top':targetTop}).chain(function(){this.carouselActive=false;this.carouselWrapper.scroller.stop();this.fireEvent('onCarouselHidden');this.carouselContainer.options.onComplete=null;}.bind(this));},constructThumbnails:function(){element=this.carouselInner;for(i=0;i<this.galleryData.length;i++)
{var currentImg=new Fx.Style(new Element('div').addClass("thumbnail").setStyles({backgroundImage:"url('"+this.galleryData[i].thumbnail+"')",backgroundPosition:"center center",backgroundRepeat:'no-repeat',marginLeft:this.options.thumbSpacing+"px",width:this.options.thumbWidth+"px",height:this.options.thumbHeight+"px"}).injectInside(element),"opacity",{duration:200}).set(this.options.thumbIdleOpacity);currentImg.element.addEvents({'mouseover':function(myself){myself.clearTimer();myself.start(0.99);if(this.options.showCarouselLabel)
$(this.carouselLabel).setHTML('<span class="number">'+(myself.relatedImage.number+1)+"/"+this.maxIter+":</span> "+myself.relatedImage.title);}.pass(currentImg,this),'mouseout':function(myself){myself.clearTimer();myself.start(this.options.thumbIdleOpacity);}.pass(currentImg,this),'click':function(myself){this.goTo(myself.relatedImage.number);if(this.options.thumbCloseCarousel)
this.hideCarousel();}.pass(currentImg,this)});currentImg.relatedImage=this.galleryData[i];this.thumbnailElements[parseInt(i)]=currentImg;}},log:function(value){if(console.log)
console.log(value);},preloadThumbnails:function(){var thumbnails=[];for(i=0;i<this.galleryData.length;i++)
{thumbnails[parseInt(i)]=this.galleryData[i].thumbnail;}
this.thumbnailPreloader=new Preloader();this.thumbnailPreloader.addEvent('onComplete',function(){var textShowCarousel=formatString(this.options.textShowCarousel,this.currentIter+1,this.maxIter);this.carouselBtn.setHTML(textShowCarousel).setProperty('title',textShowCarousel);}.bind(this));this.thumbnailPreloader.load(thumbnails);},clearThumbnailsHighlights:function()
{for(i=0;i<this.galleryData.length;i++)
{this.thumbnailElements[i].clearTimer();this.thumbnailElements[i].start(0.2);}},changeThumbnailsSize:function(width,height)
{for(i=0;i<this.galleryData.length;i++)
{this.thumbnailElements[i].clearTimer();this.thumbnailElements[i].element.setStyles({'width':width+"px",'height':height+"px"});}},centerCarouselOn:function(num){if(!this.carouselWallMode)
{var carouselElement=this.thumbnailElements[num];var position=carouselElement.element.offsetLeft+(carouselElement.element.offsetWidth/2);var carouselWidth=this.carouselWrapper.element.offsetWidth;var carouselInnerWidth=this.carouselInner.offsetWidth;var diffWidth=carouselWidth/2;var scrollPos=position-diffWidth;this.carouselWrapper.elementScroller.scrollTo(scrollPos,0);}},initInfoSlideshow:function(){this.slideInfoZone=new Fx.Styles(new Element('div').addClass('slideInfoZone').injectInside($(this.galleryElement))).set({'opacity':0});var slideInfoZoneTitle=new Element('h2').injectInside(this.slideInfoZone.element);var slideInfoZoneDescription=new Element('p').injectInside(this.slideInfoZone.element);this.slideInfoZone.normalHeight=this.slideInfoZone.element.offsetHeight;this.slideInfoZone.element.setStyle('opacity',0);},changeInfoSlideShow:function()
{this.hideInfoSlideShow.delay(10,this);this.showInfoSlideShow.delay(500,this);},showInfoSlideShow:function(){this.fireEvent('onShowInfopane');this.slideInfoZone.clearTimer();element=this.slideInfoZone.element;element.getElement('h2').setHTML(this.galleryData[this.currentIter].title);element.getElement('p').setHTML(this.galleryData[this.currentIter].description);if(this.options.slideInfoZoneSlide)
this.slideInfoZone.start({'opacity':[0,this.options.slideInfoZoneOpacity],'height':[0,this.slideInfoZone.normalHeight]});else
this.slideInfoZone.start({'opacity':[0,this.options.slideInfoZoneOpacity]});if(this.options.showCarousel)
this.slideInfoZone.chain(this.centerCarouselOn.pass(this.currentIter,this));return this.slideInfoZone;},hideInfoSlideShow:function(){this.fireEvent('onHideInfopane');this.slideInfoZone.clearTimer();if(this.options.slideInfoZoneSlide)
this.slideInfoZone.start({'opacity':0,'height':0});else
this.slideInfoZone.start({'opacity':0});return this.slideInfoZone;},makeLink:function(num){this.currentLink.setProperties({href:this.galleryData[num].link,title:this.galleryData[num].linkTitle})
if(!((this.options.embedLinks)&&(!this.options.showArrows)&&(!this.options.showCarousel)))
this.currentLink.setStyle('display','block');},clearLink:function(){this.currentLink.setProperties({href:'',title:''});if(!((this.options.embedLinks)&&(!this.options.showArrows)&&(!this.options.showCarousel)))
this.currentLink.setStyle('display','none');},flushGallery:function(){this.galleryElements.each(function(myFx){myFx.element.remove();myFx=myFx.element=null;});this.galleryElements=[];},changeData:function(data){this.galleryData=data;this.clearTimer();this.flushGallery();if(this.options.showCarousel)this.flushCarousel();this.constructElements();if(this.options.showCarousel)this.fillCarousel();if(this.options.showInfopane)this.hideInfoSlideShow();this.galleryInit=1;this.lastIter=0;this.currentIter=0;this.doSlideShow(1);},initHistory:function(){this.fireEvent('onHistoryInit');this.historyKey=this.galleryElement.id+'-picture';if(this.options.customHistoryKey)
this.historyKey=this.options.customHistoryKey();this.history=HistoryManager.register(this.historyKey,[1],function(values){if(parseInt(values[0])-1<this.maxIter)
this.goTo(parseInt(values[0])-1);}.bind(this),function(values){return[this.historyKey,'(',values[0],')'].join('');}.bind(this),this.historyKey+'\\((\\d+)\\)');this.addEvent('onChanged',function(){this.history.setValue(0,this.currentIter+1);}.bind(this));this.fireEvent('onHistoryInited');}};gallery=new Class(gallery);gallery.implement(new Events);gallery.implement(new Options);gallery.Transitions=new Abstract({fade:function(oldFx,newFx,oldPos,newPos){oldFx.options.transition=newFx.options.transition=Fx.Transitions.linear;oldFx.options.duration=newFx.options.duration=this.options.fadeDuration;if(newPos>oldPos)newFx.start({opacity:1});else
{newFx.set({opacity:1});oldFx.start({opacity:0});}},crossfade:function(oldFx,newFx,oldPos,newPos){oldFx.options.transition=newFx.options.transition=Fx.Transitions.linear;oldFx.options.duration=newFx.options.duration=this.options.fadeDuration;newFx.start({opacity:1});oldFx.start({opacity:0});},fadebg:function(oldFx,newFx,oldPos,newPos){oldFx.options.transition=newFx.options.transition=Fx.Transitions.linear;oldFx.options.duration=newFx.options.duration=this.options.fadeDuration/2;oldFx.start({opacity:0}).chain(newFx.start.pass([{opacity:1}],newFx));}});var Preloader=new Class({Implements:[Events,Options],options:{root:'',period:100},initialize:function(options){this.setOptions(options);},load:function(sources){this.index=0;this.images=[];this.sources=this.temps=sources;this.total=this.sources.length;this.fireEvent('onStart',[this.index,this.total]);this.timer=this.progress.periodical(this.options.period,this);this.sources.each(function(source,index){this.images[index]=new Asset.image(this.options.root+source,{'onload':function(){this.index++;if(this.images[index])this.fireEvent('onLoad',[this.images[index],index,source]);}.bind(this),'onerror':function(){this.index++;this.fireEvent('onError',[this.images.splice(index,1),index,source]);}.bind(this),'onabort':function(){this.index++;this.fireEvent('onError',[this.images.splice(index,1),index,source]);}.bind(this)});},this);},progress:function(){this.fireEvent('onProgress',[Math.min(this.index,this.total),this.total]);if(this.index>=this.total)this.complete();},complete:function(){$clear(this.timer);this.fireEvent('onComplete',[this.images]);},cancel:function(){$clear(this.timer);}});Preloader.implement(new Events,new Options);function formatString(){var num=arguments.length;var oStr=arguments[0];for(var i=1;i<num;i++){var pattern="\\{"+(i-1)+"\\}";var re=new RegExp(pattern,"g");oStr=oStr.replace(re,arguments[i]);}
return oStr;}
var gallerySet=gallery.extend({initialize:function(element,options){this.setOptions({manualSetData:[],gallerySelector:"div.galleryElement",galleryTitleSelector:"h2",textGallerySelector:'Galleries',textShowGallerySelector:'Other Galleries',textGalleryInfo:'{0} pictures',startWithSelector:true,textShowCarousel:'{0}/{1} Pictures',carouselPreloader:false},options);this.gallerySet=this.options.manualSetData;this.addEvent('onPopulated',this.createGallerySelectorTab.bind(this));this.addEvent('onPopulated',this.createGallerySelector.bind(this));this.startWithSelectorFn=this.toggleGallerySelector.pass(true,this);if(this.options.startWithSelector)
this.addEvent('onGallerySelectorCreated',this.startWithSelectorFn);this.parent(element,this.options);},populateData:function(){options=this.options;var data=$A(this.gallerySet);this.populateFrom.getElements(options.gallerySelector).each(function(galEl){currentGalArrayPlace=0;galleryDict={title:galEl.getElement(options.galleryTitleSelector).innerHTML,elements:[]}
galleryDict.elements.extend(this.populateGallery(galEl,0));data.extend([galleryDict]);if(this.options.destroyAfterPopulate)
galEl.remove();},this);this.gallerySet=data;this.galleryData=data[0].elements;this.currentGallery=0;this.fireEvent('onPopulated');},changeGallery:function(number)
{if(number!=this.currentGallery)
{this.changeData(this.gallerySet[number].elements);this.maxIter=this.gallerySet[number].elements.length;this.currentGallery=number;this.gallerySelectorBtn.setHTML(this.gallerySet[number].title);this.fireEvent('onGalleryChanged');}
this.toggleGallerySelector(false);},createGallerySelectorTab:function(){this.gallerySelectorBtn=new Element('a').addClass('gallerySelectorBtn').setProperties({title:this.options.textShowGallerySelector}).setHTML(this.options.textShowGallerySelector).addEvent('click',function(){this.toggleGallerySelector(true);}.bind(this)).injectInside(this.galleryElement);this.addEvent('onShowCarousel',function(){this.gallerySelectorBtn.setStyle('zIndex',10)}.bind(this));this.addEvent('onCarouselHidden',function(){this.gallerySelectorBtn.setStyle('zIndex',15)}.bind(this));},createGallerySelector:function(){this.gallerySelector=new Fx.Styles(new Element('div').addClass('gallerySelector').injectInside(this.galleryElement).setStyles({'display':'none','opacity':'0'}));this.gallerySelectorTitle=new Element('h2').setHTML(this.options.textGallerySelector).injectInside(this.gallerySelector.element);var gallerySelectorHeight=this.galleryElement.offsetHeight-50-10-2;this.gallerySelectorWrapper=new Fx.Style(new Element('div').addClass('gallerySelectorWrapper').setStyle('height',gallerySelectorHeight+"px").injectInside(this.gallerySelector.element));this.gallerySelectorInner=new Element('div').addClass('gallerySelectorInner').injectInside(this.gallerySelectorWrapper.element);this.gallerySelectorWrapper.scroller=new Scroller(this.gallerySelectorWrapper.element,{area:100,velocity:0.3}).start();this.createGalleryButtons();this.fireEvent('onGallerySelectorCreated');},createGalleryButtons:function(){var galleryButtonWidth=((this.galleryElement.offsetWidth-30)/2)-14;this.gallerySet.each(function(galleryItem,index){var button=new Element('div').addClass('galleryButton').injectInside(this.gallerySelectorInner).addEvents({'mouseover':function(myself){myself.button.addClass('hover');}.pass(galleryItem,this),'mouseout':function(myself){myself.button.removeClass('hover');}.pass(galleryItem,this),'click':function(myself,number){this.changeGallery.pass(number,this)();}.pass([galleryItem,index],this)}).setStyle('width',galleryButtonWidth);galleryItem.button=button;var thumbnail="";if(this.options.showCarousel)
thumbnail=galleryItem.elements[0].thumbnail;else
thumbnail=galleryItem.elements[0].image;new Element('div').addClass('preview').setStyle('backgroundImage',"url('"+thumbnail+"')").injectInside(button);new Element('h3').setHTML(galleryItem.title).injectInside(button);new Element('p').addClass('info').setHTML(formatString(this.options.textGalleryInfo,galleryItem.elements.length)).injectInside(button);},this);new Element('br').injectInside(this.gallerySelectorInner).setStyle('clear','both');},toggleGallerySelector:function(state){if(state)
this.gallerySelector.start({'opacity':1}).element.setStyle('display','block');else
this.gallerySelector.start({'opacity':0});},initHistory:function(){this.fireEvent('onHistoryInit');this.historyKey=this.galleryElement.id+'-gallery';if(this.options.customHistoryKey)
this.historyKey=this.options.customHistoryKey();this.history=HistoryManager.register(this.historyKey,[1,1],function(values){this.changeGallery.pass(parseInt(values[0])-1,this).delay(10);if(this.gallerySelector)
this.toggleGallerySelector.pass(false,this).delay(500);this.goTo.pass(parseInt(values[1])-1,this).delay(100);}.bind(this),function(values){return[this.historyKey,'(',values[0],')','-picture','(',values[1],')'].join('');}.bind(this),this.historyKey+'\\((\\d+)\\)-picture\\((\\d+)\\)');updateHistory=function(){this.history.setValue(0,this.currentGallery+1);this.history.setValue(1,this.currentIter+1);}.bind(this);this.addEvent('onChanged',updateHistory);this.addEvent('onGalleryChanged',updateHistory);this.fireEvent('onHistoryInited');}});var Autocompleter={};Autocompleter.Base=new Class({options:{minLength:1,useSelection:false,markQuery:true,inheritWidth:true,maxChoices:10,injectChoice:null,onSelect:Class.empty,onShow:Class.empty,onHide:Class.empty,customTarget:null,className:'autocompleter-choices',zIndex:42,observerOptions:{},fxOptions:{},overflown:[]},initialize:function(el,options){this.setOptions(options);this.element=$(el);this.build();this.observer=new Observer(this.element,this.prefetch.bind(this),$merge({delay:400},this.options.observerOptions));this.value=this.observer.value;this.queryValue=null;},build:function(){if($(this.options.customTarget))this.choices=this.options.customTarget;else{this.choices=new Element('ul',{'class':this.options.className,styles:{zIndex:this.options.zIndex}}).injectInside(document.body);this.fix=new OverlayFix(this.choices);}
this.fx=this.choices.effect('opacity',$merge({wait:false,duration:200},this.options.fxOptions)).addEvent('onStart',function(){if(this.fx.now)return;this.choices.setStyle('display','');this.fix.show();}.bind(this)).addEvent('onComplete',function(){if(this.fx.now)return;this.choices.setStyle('display','none');this.fix.hide();}.bind(this)).set(0);this.element.setProperty('autocomplete','off').addEvent(window.ie?'keydown':'keypress',this.onCommand.bindWithEvent(this)).addEvent('mousedown',this.onCommand.bindWithEvent(this,[true])).addEvent('focus',this.toggleFocus.bind(this,[true])).addEvent('blur',this.toggleFocus.bind(this,[false])).addEvent('trash',this.destroy.bind(this));},destroy:function(){this.choices.remove();},toggleFocus:function(state){this.focussed=state;if(!state)this.hideChoices();},onCommand:function(e,mouse){if(mouse&&this.focussed)this.prefetch();if(e.key&&!e.shift)switch(e.key){case'enter':if(this.selected&&this.visible){this.choiceSelect(this.selected);e.stop();}return;case'up':case'down':if(this.observer.value!=(this.value||this.queryValue))this.prefetch();else if(this.queryValue===null)break;else if(!this.visible)this.showChoices();else{this.choiceOver((e.key=='up')?this.selected.getPrevious()||this.choices.getLast():this.selected.getNext()||this.choices.getFirst());this.setSelection();}
e.stop();return;case'esc':this.hideChoices();return;}
this.value=false;},setSelection:function(){if(!this.options.useSelection)return;var startLength=this.queryValue.length;if(this.element.value.indexOf(this.queryValue)!=0)return;var insert=this.selected.inputValue.substr(startLength);if(document.getSelection){this.element.value=this.queryValue+insert;this.element.selectionStart=startLength;this.element.selectionEnd=this.element.value.length;}else if(document.selection){var sel=document.selection.createRange();sel.text=insert;sel.move("character",-insert.length);sel.findText(insert);sel.select();}
this.value=this.observer.value=this.element.value;},hideChoices:function(){if(!this.visible)return;this.visible=this.value=false;this.observer.clear();this.fx.start(0);this.fireEvent('onHide',[this.element,this.choices]);},showChoices:function(){if(this.visible||!this.choices.getFirst())return;this.visible=true;var pos=this.element.getCoordinates(this.options.overflown);this.choices.setStyles({left:pos.left,top:pos.bottom});if(this.options.inheritWidth)this.choices.setStyle('width',pos.width);this.fx.start(1);this.choiceOver(this.choices.getFirst());this.fireEvent('onShow',[this.element,this.choices]);},prefetch:function(){if(this.element.value.length<this.options.minLength)this.hideChoices();else if(this.element.value==this.queryValue)this.showChoices();else this.query();},updateChoices:function(choices){this.choices.empty();this.selected=null;if(!choices||!choices.length)return;if(this.options.maxChoices<choices.length)choices.length=this.options.maxChoices;choices.each(this.options.injectChoice||function(choice,i){var el=new Element('li').setHTML(this.markQueryValue(choice));el.inputValue=choice;this.addChoiceEvents(el).injectInside(this.choices);},this);this.showChoices();},choiceOver:function(el){if(this.selected)this.selected.removeClass('autocompleter-selected');this.selected=el.addClass('autocompleter-selected');},choiceSelect:function(el){if(el.inputValue.match("affinez votre")||el.inputValue.match("______")){}else{var tab=this.element.value.split(',');if(tab.length==1){this.observer.value=this.element.value=el.inputValue;}else if(tab.length<5){var val='';for(var i=0;i<tab.length-1;i++){val=val+tab[i]+', ';}
val=val+el.inputValue;this.observer.value=this.element.value=val;}else{alert('Vous ne pouvez saisir que 4 lieux maximum.');var val='';for(var i=0;i<tab.length-1;i++){val=val+tab[i]+', ';}
this.observer.value=this.element.value=val;}
this.hideChoices();this.fireEvent('onSelect',[this.element],20);}},markQueryValue:function(txt){return(this.options.markQuery&&this.queryValue)?txt.replace(new RegExp('^('+this.queryValue.escapeRegExp()+')','i'),'<span class="autocompleter-queried">$1</span>'):txt;},addChoiceEvents:function(el){return el.addEvents({mouseover:this.choiceOver.bind(this,[el]),mousedown:this.choiceSelect.bind(this,[el])});}});Autocompleter.Base.implement(new Events);Autocompleter.Base.implement(new Options);Autocompleter.Local=Autocompleter.Base.extend({options:{minLength:0,filterTokens:null},initialize:function(el,tokens,options){this.parent(el,options);this.tokens=tokens;if(this.options.filterTokens)this.filterTokens=this.options.filterTokens.bind(this);},query:function(){this.hideChoices();this.queryValue=this.element.value;this.updateChoices(this.filterTokens());},filterTokens:function(token){var regex=new RegExp('^'+this.queryValue.escapeRegExp(),'i');return this.tokens.filter(function(token){return regex.test(token);});}});Autocompleter.Ajax={};Autocompleter.Ajax.Base=Autocompleter.Base.extend({options:{postVar:'value',postData:{},ajaxOptions:{},onRequest:Class.empty,onComplete:Class.empty},initialize:function(el,url,options){this.parent(el,options);this.ajax=new Ajax(url,$merge({autoCancel:true},this.options.ajaxOptions));this.ajax.addEvent('onComplete',this.queryResponse.bind(this));this.ajax.addEvent('onFailure',this.queryResponse.bind(this,[false]));},query:function(){var data=$extend({},this.options.postData);var val=this.element.value.split(',');if(val.length==1){data[this.options.postVar]=this.element.value;}else{data[this.options.postVar]=val[val.length-1].replace(/(^\s*)|(\s*$)/g,'');}
this.fireEvent('onRequest',[this.element,this.ajax]);this.ajax.request(data);},queryResponse:function(resp){this.value=this.queryValue=this.element.value;this.selected=false;this.hideChoices();this.fireEvent(resp?'onComplete':'onFailure',[this.element,this.ajax],20);}});Autocompleter.Ajax.Json=Autocompleter.Ajax.Base.extend({queryResponse:function(resp){this.parent(resp);var choices=Json.evaluate(resp||false);if(!choices||!choices.length)return;this.updateChoices(choices);}});Autocompleter.Ajax.Xhtml=Autocompleter.Ajax.Base.extend({options:{parseChoices:null},queryResponse:function(resp){this.parent(resp);if(!resp)return;this.choices.setHTML(resp).getChildren().each(this.options.parseChoices||this.parseChoices,this);this.showChoices();},parseChoices:function(el){var value=el.innerHTML;el.inputValue=value;el.setHTML(this.markQueryValue(value));}});var OverlayFix=new Class({initialize:function(el){this.element=$(el);if(window.ie){this.element.addEvent('trash',this.destroy.bind(this));this.fix=new Element('iframe',{properties:{frameborder:'0',scrolling:'no',src:'javascript:false;'},styles:{position:'absolute',border:'none',display:'none',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'}}).injectAfter(this.element);}},show:function(){if(this.fix)this.fix.setStyles($extend(this.element.getCoordinates(),{display:'',zIndex:(this.element.getStyle('zIndex')||1)-1}));return this;},hide:function(){if(this.fix)this.fix.setStyle('display','none');return this;},destroy:function(){this.fix.remove();}});var Observer=new Class({options:{periodical:false,delay:1000},initialize:function(el,onFired,options){this.setOptions(options);this.addEvent('onFired',onFired);this.element=$(el);this.listener=this.fired.bind(this);this.value=this.element.getValue();if(this.options.periodical)this.timer=this.listener.periodical(this.options.periodical);else this.element.addEvent('keyup',this.listener);},fired:function(){var value=this.element.getValue();if(this.value==value)return;this.clear();this.value=value;this.timeout=this.fireEvent.delay(this.options.delay,this,['onFired',[value]]);},clear:function(){$clear(this.timeout);return this;}});Observer.implement(new Options);Observer.implement(new Events);function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='<object ';for(var i in objAttrs)
str+=i+'="'+objAttrs[i]+'" ';str+='>';for(var i in params)
str+='<param name="'+i+'" value="'+params[i]+'" /> ';str+='<embed ';for(var i in embedAttrs)
str+=i+'="'+embedAttrs[i]+'" ';str+=' ></embed></object>';document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_SW_RunContent(){var ret=AC_GetArgs
(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":ret.objAttrs[args[i]]=args[i+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"id":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;}