//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License.

MooTools.More={version:"1.2.2.2"};Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a);},compute:function(g,h,j){var c={};
for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c;},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);
}}return this;},start:function(c){if(!this.check(c)){return this;}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);
a[b]=e.from;g[b]=e.to;}}return this.parent(h,j);}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);
if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=$(b);this.parent(a);var c=this.element.retrieve("wrapper");
this.wrapper=c||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);
this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";
this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]);
return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this;
}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]];
var g=[[d,c],[-this.offset,0]];var f;switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a);
},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode]();
this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide");
if(a){a.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b));},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a);
}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(d,e){d=d||"toggle";
var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e);
this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});


/*SQUEEZBOX*/


var SqueezeBox={presets:{size:{x:600,y:450},sizeLoading:{x:200,y:150},marginInner:{x:20,y:20},marginImage:{x:50,y:75},handler:false,target:null,closable:true,closeBtn:true,zIndex:65555,overlayOpacity:0.7,classWindow:'',classOverlay:'',overlayFx:{},resizeFx:{},contentFx:{},parse:false,parseSecure:false,ajaxOptions:{},onOpen:$empty,onClose:$empty,onUpdate:$empty,onResize:$empty,onMove:$empty,onShow:$empty,onHide:$empty},initialize:function(presets){if(this.options)return this;this.presets=$merge(this.presets,presets);this.options={};this.setOptions(this.presets).build();this.bound={window:this.reposition.bind(this,[null]),scroll:this.checkTarget.bind(this),close:this.close.bind(this),key:this.onKey.bind(this)};this.isOpen=this.isLoading=false;return this;},build:function(){this.overlay=new Element('div',{id:'sbox-overlay',styles:{display:'none',zIndex:this.options.zIndex}});this.content=new Element('div',{id:'sbox-content'});this.closeBtn=new Element('a',{id:'sbox-btn-close',href:'#'});this.win=new Element('div',{id:'sbox-window',styles:{display:'none',zIndex:this.options.zIndex+2}}).adopt(this.closeBtn,this.content);this.fx={overlay:new Fx.Tween(this.overlay,$merge({property:'opacity',onStart:Events.prototype.clearChain,duration:250,link:'cancel'},this.options.overlayFx)).set(0),win:new Fx.Morph(this.win,$merge({onStart:Events.prototype.clearChain,unit:'px',duration:750,transition:Fx.Transitions.Quint.easeOut,link:'cancel',unit:'px'},this.options.resizeFx)),content:new Fx.Tween(this.content,$merge({property:'opacity',duration:250,link:'cancel'},this.options.contentFx)).set(0)};$(document.body).adopt(this.overlay,this.win);},assign:function(to,options){return to.addEvent('click',function(){return!SqueezeBox.fromElement(this,options);});},fromElement:function(from,options){this.initialize();if(this.element)this.trash();this.element=$(from);this.setOptions($merge(this.presets,options||{}));if(this.element&&this.options.parse){var obj=this.element.getProperty(this.options.parse);if(obj&&(obj=JSON.decode(obj,this.options.parseSecure)))this.setOptions(obj);}this.assignOptions();this.url=((this.element)?(this.options.url||this.element.get('href')):from)||'';var handler=this.options.handler;if(handler)return this.setContent(handler,this.parsers[handler].call(this,true));var ret=false;this.parsers.some(function(parser,key){var content=parser.call(this);if(content){ret=this.setContent(key,content);return true;}return false;},this);return ret;},assignOptions:function(){this.overlay.set('class',this.options.classOverlay);this.win.set('class',this.options.classWindow);if(Browser.Engine.trident4)this.win.addClass('sbox-window-ie6');},close:function(e){var stoppable=($type(e)=='event');if(stoppable)e.stop();if(!this.isOpen||(stoppable&&!$lambda(this.options.closable).call(this,e)))return this;this.fx.overlay.start(0).chain(this.toggleOverlay.bind(this));this.win.setStyle('display','none');this.trash();this.toggleListeners();this.isOpen=false;this.fireEvent('onClose',[this.content]);$('sbox-content').empty();return this;},trash:function(){this.element=this.asset=null;this.options={};this.removeEvents().setOptions(this.presets).callChain();},onError:function(){this.asset=null;this.setContent('string','Error during loading');},setContent:function(handler,content){if(!this.handlers[handler])return false;this.content.className='sbox-content-'+handler;this.applyTimer=this.applyContent.delay(this.fx.overlay.options.duration,this,this.handlers[handler].call(this,content));if(this.overlay.retrieve('opacity'))return this;this.toggleOverlay(true);this.fx.overlay.start(this.options.overlayOpacity);return this.reposition();},applyContent:function(content,size){this.applyTimer=$clear(this.applyTimer);this.hideContent();if(!content){this.toggleLoading(true);}else{if(this.isLoading)this.toggleLoading(false);this.fireEvent('onUpdate',[this.content],20);}this.content.empty();if(['string','array',false].contains($type(content)))this.content.set('html',content||'');else this.content.adopt(content);this.callChain();if(!this.isOpen){this.toggleListeners(true);this.resize(size,true);this.isOpen=true;this.fireEvent('onOpen',[this.content]);}else{this.resize(size);}},resize:function(size,instantly){var box=document.getSize(),scroll=document.getScroll();this.size=$merge((this.isLoading)?this.options.sizeLoading:this.options.size,size);var to={width:this.size.x,height:this.size.y,left:(scroll.x+(box.x-this.size.x-this.options.marginInner.x)/2).toInt(),top:(scroll.y+(box.y-this.size.y-this.options.marginInner.y)/2).toInt()};$clear(this.showTimer||null);this.hideContent();if(!instantly){this.fx.win.start(to).chain(this.showContent.bind(this));}else{this.win.setStyles(to).setStyle('display','');this.showTimer=this.showContent.delay(50,this);}return this.reposition();},toggleListeners:function(state){var fn=(state)?'addEvent':'removeEvent';this.closeBtn[fn]('click',this.bound.close);this.overlay[fn]('click',this.bound.close);document[fn]('keydown',this.bound.key)[fn]('mousewheel',this.bound.scroll);window[fn]('resize',this.bound.window)[fn]('scroll',this.bound.window);},toggleLoading:function(state){this.isLoading=state;this.win[(state)?'addClass':'removeClass']('sbox-loading');if(state)this.fireEvent('onLoading',[this.win]);},toggleOverlay:function(state){this.overlay.setStyle('display',(state)?'':'none');$(document.body)[(state)?'addClass':'removeClass']('body-overlayed');},showContent:function(){if(this.content.get('opacity'))this.fireEvent('onShow',[this.win]);this.fx.content.start(1);},hideContent:function(){if(!this.content.get('opacity'))this.fireEvent('onHide',[this.win]);this.fx.content.set(0);},onKey:function(e){switch(e.key){case'esc':this.close(e);case'up':case'down':return false;}},checkTarget:function(e){return this.content.hasChild(e.target);},reposition:function(){var size=document.getSize(),scroll=document.getScroll();this.overlay.setStyles({left:scroll.x+'px',top:scroll.y+'px',width:size.x+'px',height:size.y+'px'});this.win.setStyles({left:(scroll.x+(size.x-this.win.offsetWidth)/2).toInt()+'px',top:(scroll.y+(size.y-this.win.offsetHeight)/2).toInt()+'px'});return this.fireEvent('onMove',[this.overlay,this.win]);},removeEvents:function(type){if(!this.$events)return this;if(!type)this.$events=null;else if(this.$events[type])this.$events[type]=null;return this;},extend:function(properties){return $extend(this,properties);},handlers:new Hash(),parsers:new Hash()};SqueezeBox.extend(new Events($empty)).extend(new Options($empty)).extend(new Chain($empty));SqueezeBox.parsers.extend({image:function(preset){return(preset||(/\.(?:jpg|png|gif)$/i).test(this.url))?this.url:false;},clone:function(preset){if($(this.options.target))return $(this.options.target);if(this.element&&!this.element.parentNode)return this.element;var bits=this.url.match(/#([\w-]+)$/);return(bits)?$(bits[1]):(preset?this.element:false);},ajax:function(preset){return(preset||(this.url&&!(/^(?:javascript|#)/i).test(this.url)))?this.url:false;},iframe:function(preset){return(preset||this.url)?this.url:false;},string:function(preset){return true;}});SqueezeBox.handlers.extend({image:function(url){var size,tmp=new Image();this.asset=null;tmp.onload=tmp.onabort=tmp.onerror=(function(){tmp.onload=tmp.onabort=tmp.onerror=null;if(!tmp.width){this.onError.delay(10,this);return;}var box=document.getSize();box.x-=this.options.marginImage.x;box.y-=this.options.marginImage.y;size={x:tmp.width,y:tmp.height};for(var i=2;i--;){if(size.x>box.x){size.y*=box.x/size.x;size.x=box.x;}else if(size.y>box.y){size.x*=box.y/size.y;size.y=box.y;}}size.x=size.x.toInt();size.y=size.y.toInt();this.asset=$(tmp);tmp=null;this.asset.setProperties({width:size.x,height:size.y});if(this.isOpen)this.applyContent(this.asset,size);}).bind(this);tmp.src=url;if(tmp&&tmp.onload&&tmp.complete)tmp.onload();return(this.asset)?[this.asset,size]:null;},clone:function(el){return el.clone();},adopt:$arguments(0),ajax:function(url){this.asset=new Request.HTML($merge({method:'get'},this.options.ajaxOptions)).addEvents({onSuccess:function(resp){this.applyContent(resp);this.asset=null;}.bind(this),onFailure:this.onError.bind(this)});this.asset.send.delay(10,this.asset,[{url:url}]);},iframe:function(url){return new Element('iframe',$merge({src:url,frameBorder:0,width:this.options.size.x,height:this.options.size.y},this.options.iframeOptions));},string:function(str){return str;}});SqueezeBox.handlers.url=SqueezeBox.handlers.ajax;SqueezeBox.parsers.url=SqueezeBox.parsers.ajax;SqueezeBox.parsers.adopt=SqueezeBox.parsers.clone;


/* SCRIPT */


function retour_accueil(){document.location.href="/index.php";}
/*
window.addEvent('domready',function(){var sizeD=window.getCoordinates();var middleD=(sizeD.height/3)*2;if($('chemin')!=null)
{var coo=$('chemin').getCoordinates();var h=coo.height;var cached=true;$('chemin').tween('bottom',-(h));$(document).addEvent('mousemove',function(evt){var posY=evt.client.y
if(posY>middleD)
{if(cached)
{$('chemin').tween('bottom',0);cached=false;}}
else if(posY<middleD)
{if(!cached)
{$('chemin').tween('bottom',-(h));cached=true;}}});}
var tabFl=new Hash();var getFlower=function(){var tab_fleur=new Array('/media/fleurs/fleur1.png','/media/fleurs/fleur5.png','/media/fleurs/fleur6.png');var val=2;var timer=3000;var count=0;var coW=$('body').getSize();var scroll=window.getScrollSize();var maxL=(coW.x+(scroll.x-coW.x))-250;var maxH=(coW.y+(scroll.y-coW.y))-250;var halfL=maxL/2;var halfH=maxH/2;for(var i=0;i<20;i++)
{var top=Math.floor((maxH)*Math.random()+1);var left=Math.floor((maxL)*Math.random()+1);var tmp=new Element('img',{'src':tab_fleur.getRandom(),'id':'fleur'+i,'styles':{'position':'absolute','top':top,'left':left,'z-index':'0'}});if(top<halfH)
{tmp.dirY=true;}
else
{tmp.dirY=false;}
if(left<halfL)
{tmp.dirX=true;}
else
{tmp.dirX=false;}
tabFl.set(i,tmp);tabFl.get(i).inject($('body'),'top');}
var move=function()
{for(var a=0;a<tabFl.getLength();a++)
{if($defined(tabFl.get(a)))
{var elem=tabFl.get(a);var tt=elem.getPosition();if(tt.y>=maxH){elem.destroy();tabFl.erase(a);}
else if(tt.x>=maxL){elem.destroy();tabFl.erase(a);}
if(elem.dirY)
{elem.setStyle('top',tt.y+val);}
else
{elem.setStyle('top',tt.y-val);}
if(elem.dirX)
{elem.setStyle('left',tt.x+val);}
else
{elem.setStyle('left',tt.x-val);}}}}}
var deleteFlower=function()
{tabFl.each(function(value,key){value.destroy();});}
var reloadFlower=function()
{tabFl.each(function(value,key){value.destroy();});getFlower();}
getFlower.delay(2000);if($("multi_onglet")!=null)
{$("multi_onglet").getChildren('dt').each(function(value){value.addEvent('click',reloadFlower);})}});
*/
/*ONGLET*/

var multi_onglet=new Class({params:{dt_active:'#000',dt_bg:'#FFF',dt_active_color:"#FFF",dt_color:'#000',dt_active_border:'none',dt_border:'none',sameHeight:false},options:{cible:null,liste_dt:null,liste_dd:null,nb:0,pos_dt:0,display:0,ddHeight:0},initialize:function(to,option){this.params=$merge(this.params,option);this.options.cible=to;this.options.cible.setStyle('position','relative');this.options.liste_dt=this.options.cible.getChildren('dt');this.options.liste_dd=this.options.cible.getChildren('dd');this.options.nb=this.options.liste_dt.length;this.construct();},construct:function(){if(this.options.nb>1){for(var i=0;i<this.options.nb;i++){this.options.liste_dt[i].setStyles({'position':'absolute','top':'0','left':this.options.pos_dt,'display':'block','cursor':'pointer'});this.options.liste_dt[i].num=i;this.options.liste_dt[i].options=this.options;this.options.liste_dt[i].params=this.params;this.options.liste_dt[i].addEvent('click',this.display);if(i==0){this.options.liste_dt[i].setStyles({'background':this.params.dt_bg_active,'color':this.params.dt_active_color,'border':this.params.dt_active_border});}var coodt=this.options.liste_dt[i].getCoordinates();var coodd=this.options.liste_dd[i].getCoordinates();this.options.ddHeight=coodd.height>this.options.ddHeight?coodd.height:this.options.ddHeight;this.options.liste_dd[i].setStyles({'position':'relative','top':(coodt.height-1)+'px','padding-top':'10px'});if(i>0){this.options.liste_dd[i].setStyle('display','none');}this.options.pos_dt+=coodt.width+4;}if(this.params.sameHeight){for(var i=0;i<this.options.nb;i++){this.options.liste_dd[i].setStyle('height',this.options.ddHeight+'px');}}}else
{this.options.liste_dt[0].setStyle('display','none');}this.options.liste_dd[0].setStyle('opacity','1.0');},display:function(){var next=this.getNext();if(this.num!=this.options.display){this.options.liste_dd[this.options.display].setStyle('display','none');next.setStyle('display','block');next.setStyle('opacity','0.0');next.tween('opacity','1.0');;this.options.liste_dt[this.options.display].setStyles({'background':this.params.dt_bg,'color':this.params.dt_color,'border':this.params.dt_border});this.options.liste_dt[this.num].setStyles({'background':this.params.dt_bg_active,'color':this.params.dt_active_color,'border':this.params.dt_active_border});}this.options.display=this.num;}});

/*CAROUZEL*/

var carouselPat=new Class({options:{auto:true,time:5000,inter:null,cible:null,liste:null,listeLi:null,nb:null,cooMasque:null,cooLi:null,next:null,previous:null,nbElementV:null,movePx:0,pos:0,lgUl:0,click:0,maxClick:0,tabDot:new Array(),verifClick:null},initialize:function(to,option){$merge(this.params,option||{});this.options.cible=to;if(this.options.cible.tagName!="UL"){var enfant=this.options.cible.getChildren('ul');this.options.liste=enfant[0];}else
{this.options.liste=this.options.cible;}this.options.cooMasque=this.options.cible.getCoordinates();this.options.listeLi=this.options.liste.getChildren('li');this.options.cooLi=this.options.listeLi[0].getCoordinates();this.options.nb=this.options.listeLi.length;this.construct();},construct:function(){this.options.cible.setStyle('overflow','hidden');this.options.nbElementV=Math.floor(this.options.cooMasque.width/this.options.cooLi.width);this.options.movePx=this.options.nbElementV*this.options.cooLi.width;this.options.lgUl=(this.options.cooLi.width*this.options.nb)-this.options.nbElementV;this.options.maxClick=Math.floor((this.options.lgUl/this.options.cooLi.width)/this.options.nbElementV);if(this.options.maxClick>0){this.makeDot();this.makeBt();this.options.cible.options=this.options;this.options.next.addEvent('click',function(evt){var p=this.getCoordinates();this.options.cible.fireEvent('mouseover',{client:{x:p.left,y:p.top}});});this.options.previous.addEvent('click',function(evt){var p=this.getCoordinates();this.options.cible.fireEvent('mouseover',{client:{x:p.left,y:p.top}});});$each(this.options.tabDot,function(o,i){o.addEvent('click',function(evt){var p=this.getCoordinates();this.options.cible.fireEvent('mouseover',{client:{x:p.left,y:p.top}});});});this.options.cible.options=this.options;this.options.cible.addEvent('mouseover',function(evt){var R=(this.options.cooMasque.width/4)*3;var L=(this.options.cooMasque.width/4);var posMouse=(evt.client.x-this.options.cooMasque.left);if(posMouse<L){this.options.previous.tween('left',0);}else
{this.options.previous.tween('left',-58);}if(posMouse>R){this.options.next.tween('right',0);}else
{this.options.next.tween('right',-58);}if(this.options.click==this.options.maxClick){this.options.next.setStyle('display','none');}else
{this.options.next.setStyle('display','block');}if(this.options.click==0){this.options.previous.setStyle('display','none');}else
{this.options.previous.setStyle('display','block');}});this.options.cible.fireEvent('mouseover',{client:{x:((this.options.cooMasque.width/2)+this.options.cooMasque.left),y:((this.options.cooMasque.height/2)+this.options.cooMasque.top)}});}this.options.liste.tween('left',this.options.pos+'px');if(this.options.auto==true)this.options.inter=this.autoSlide.periodical(this.options.time,this);},makeBt:function(){var spanNext=new Element('span',{'html':'next >>'});var spanPrevious=new Element('span',{'html':'<< previous'});this.options.next=new Element('a',{'href':'#','class':'next_soutient','styles':{'opacity':.8},'events':{'click':function(e){if(this.options.inter)$clear(this.options.inter);if(this.options.click!=this.options.maxClick){this.options.tabDot[this.options.click].set('class','dotNotActive');this.options.pos=(this.options.pos-this.options.movePx);this.options.liste.tween('left',this.options.pos+'px');this.options.click++;this.options.tabDot[this.options.click].set('class','dotActive');}return false;}}});spanNext.inject(this.options.next);this.options.previous=new Element('a',{'href':'#','class':'previous_soutient','styles':{'display':'none','opacity':.8},'events':{'click':function(){if(this.options.inter)$clear(this.options.inter);if(this.options.click>0){this.options.tabDot[this.options.click].set('class','dotNotActive');this.options.pos=(this.options.pos+this.options.movePx);this.options.liste.tween('left',this.options.pos+'px');this.options.click--;this.options.tabDot[this.options.click].set('class','dotActive');}return false;}}});spanPrevious.inject(this.options.previous);this.options.next.options=this.options;this.options.previous.options=this.options;this.options.next.inject(this.options.cible);this.options.previous.inject(this.options.cible);},makeDot:function(){var d=new Element('div',{'class':'dotDiv','styles':{'width':(10*(this.options.maxClick+1))+'px'}});for(var i=0;i<=this.options.maxClick;i++){if(i==this.options.click){this.options.tabDot[i]=new Element('div',{'class':'dotActive','events':{'click':function(){if(this.options.inter)$clear(this.options.inter);this.options.tabDot[this.options.click].set('class','dotNotActive');this.options.pos=-(this.options.movePx*this.nb);this.options.liste.tween('left',this.options.pos+'px');this.options.click=this.nb;this.options.tabDot[this.options.click].set('class','dotActive');}}});}else
{this.options.tabDot[i]=new Element('div',{'class':'dotNotActive','events':{'click':function(){if(this.options.inter)$clear(this.options.inter);this.options.tabDot[this.options.click].set('class','dotNotActive');this.options.pos=-(this.options.movePx*this.nb);this.options.liste.tween('left',this.options.pos+'px');this.options.click=this.nb;this.options.tabDot[this.options.click].set('class','dotActive');}}});}this.options.tabDot[i].options=this.options;this.options.tabDot[i].nb=i;this.options.tabDot[i].inject(d);}d.inject(this.options.cible);},autoSlide:function(){if(this.options.click==0){this.options.autoMove=true;}else if(this.options.click==this.options.maxClick){this.options.autoMove=false;}this.options.tabDot[this.options.click].set('class','dotNotActive');if(this.options.autoMove==true){this.options.pos=(this.options.pos-this.options.movePx);this.options.click++;}else
{this.options.pos=(this.options.pos+this.options.movePx);this.options.click--;}this.options.liste.tween('left',this.options.pos+'px');this.options.tabDot[this.options.click].set('class','dotActive');this.options.cible.fireEvent('mouseover',{client:{x:((this.options.cooMasque.width/2)+this.options.cooMasque.left),y:((this.options.cooMasque.height/2)+this.options.cooMasque.top)}});}});


/*RECHERCHE*/

//permet de comparer deux date au format euro
function getDate(strDate){	  
	    day = strDate.substring(0,2);
		month = strDate.substring(3,5);
		year = strDate.substring(6,10);
		d = new Date();
		d.setDate(day);
		d.setMonth(month-1);
		d.setFullYear(year); 
		return d;  
	  }
	  
	  
	  
	  


