
var fh_barre_progression=fhClasse.creer({initialise:function(id,vOptions){this.el=$(id);if(!this.el){var e_=getElementsByClassName(id,document.body);this.el=e_[0];}
this.imagefond=vOptions['img']||'';this.temps=vOptions['temps']*1000;this.intervalle=vOptions['int']||100;this.nbdefois=parseInt(this.temps/this.intervalle);this.compte=0;this.form=vOptions['form']||'';this.taille=parseInt(this.el.offsetWidth)/this.nbdefois;this.color=vOptions['couleur']||'white';this.fond=this.el.appendChild(document.createElement('div'));this.fond.style.backgroundColor=this.color;if(this.imagefond!=''){this.fond.style.backgroundImage='url('+this.imagefond+')';this.fond.style.backgroundRepeat='repeat-x';}
this.fond.style.width=0;this.fond.style.height="100%";this.fond.style.position="absolute";this.fond.style.left=0;this.attente=vOptions['a']*1000||0;var this_=this;setTimeout(function(){this_.lanceProgression();},this.intervalle+this.attente);},lanceProgression:function(){this.fond.style.width=parseInt(this.fond.style.width)+this.taille;this.compte++;var this_=this;if(this.compte<=this.nbdefois){setTimeout(function(){this_.lanceProgression();},this.intervalle);}else{if(this.form!=''){$(this.form).submit();}}}})
var fh_defile=fhClasse.creer({initialise:function(id,vOptions){this.el=$(id);if(!this.el){var e_=getElementsByClassName(id,document.body);this.el=e_[0];}
this.el.style.overflow='hidden';this.cloneDefilement();this.commence=vOptions['c']||1;this.nbAvantArret=vOptions['stop']||0;this.compte=0;this.vitesse=[];this.sens=[];this.sens_=[];this.depart=[];this.E1=[];this.E2=[];this.taille=[0,0];this.vitesse['h']=vOptions['vh']||20;this.vitesse['v']=vOptions['vv']||this.vitesse['h'];this.sens['h']=vOptions['sh']||2;this.sens['v']=vOptions['sv']||this.sens['h'];this.type=vOptions['t']||'h';this.stop=false;this.h=((this.type=='h')||(this.type=='d'));this.v=((this.type=='v')||(this.type=='d'));if(this.h){this.prepareDefilement('h');}
if(this.v){this.prepareDefilement('v');}
this.attente=vOptions['a']*1000||0;var this_=this;setTimeout(function(){this_.demarrer();},this_.attente);return this;},cloneDefilement:function(){this.$e1=this.el.childNodes[0];this.$e1.style.width="100%";this.$e1.style.position="absolute";this.$e2=this.$e1.cloneNode(true);this.el.appendChild(this.$e2);return false;},prepareDefilement:function(vt_){var overflow_=this.$e1.style.overflow;this.$e1.style.overflow="auto";this.taille[vt_]=(vt_=='h')?Math.max(parseInt(this.$e1.offsetWidth),parseInt(this.$e1.scrollWidth)):Math.max(parseInt(this.$e1.offsetHeight),parseInt(this.$e1.scrollHeight));this.$e1.style.overflow=overflow_;if(this.sens[vt_]>0){this.sens_[vt_]=1;}else{this.sens_[vt_]=-1;}
this.depart[vt_]=this.sens_[vt_]*this.taille[vt_];if(this.commence==1){if(vt_=='h'){this.$e1.style.left=fhPx(0);}
if(vt_=='v'){this.$e1.style.top=fhPx(0);}
if(vt_=='h'){this.$e2.style.left=fhPx(this.depart[vt_]);}
if(vt_=='v'){this.$e2.style.top=fhPx(this.depart[vt_]);}}
if(this.commence==0){if(this.sens[vt_]>0){if(vt_=='h'){this.$e1.style.left=fhPx(parseInt(this.el.offsetWidth)+this.taille[vt_]);}
if(vt_=='v'){this.$e1.style.top=fhPx(parseInt(this.el.offsetHeight)+this.taille[vt_]);}
if(vt_=='h'){this.$e2.style.left=fhPx(parseInt(this.el.offsetWidth)+2*this.taille[vt_]);}
if(vt_=='v'){this.$e2.style.top=fhPx(parseInt(this.el.offsetHeight)+2*this.taille[vt_]);}}else{if(vt_=='h'){this.$e1.style.left=fhPx(-1*this.taille[vt_]);}
if(vt_=='v'){this.$e1.style.top=fhPx(-1*this.taille[vt_]);}
if(vt_=='h'){this.$e2.style.left=fhPx(-2*this.taille[vt_]);}
if(vt_=='v'){this.$e2.style.top=fhPx(-2*this.taille[vt_]);}}}
this.$e1.style.display='';this.$e2.style.display='';return false;},arreter:function(){return this.stop=true;},demarrer:function(){this.stop=false;var this_=this;if(this.h){this.E1['h']=this.$e1;this.E2['h']=this.$e2;setInterval(this_.lanceDefilement('h'),this_.vitesse['h']);}
if(this.v){this.E1['v']=this.$e1;this.E2['v']=this.$e2;setInterval(this_.lanceDefilement('v'),this_.vitesse['v']);}
return false;},lanceDefilement:function(vt_){var o=this;return function(){var e1_=o.E1[vt_];var e2_=o.E2[vt_];if(o.stop){o.$e1=e1_;o.$e2=e2_;return false;}
if(vt_=='h'){e1_.style.left=fhPx(parseInt(e1_.offsetLeft)-o.sens[vt_]);e2_.style.left=fhPx(parseInt(e2_.offsetLeft)-o.sens[vt_]);}
if(vt_=='v'){e1_.style.top=fhPx(parseInt(e1_.offsetTop)-o.sens[vt_]);e2_.style.top=fhPx(parseInt(e2_.offsetTop)-o.sens[vt_]);}
if((o.nbAvantArret>0)&&((o.nbAvantArret-o.compte)==1)){if(vt_=='h'){if((o.sens_[vt_]>0)?(parseInt(e1_.style.left)<=0):(parseInt(e1_.style.left)>=0))o.compte++;}
if(vt_=='v'){if((o.sens_[vt_]>0)?(parseInt(e1_.style.top)<=0):(parseInt(e1_.style.top)>=0))o.compte++;}
if((o.nbAvantArret-o.compte)==0){o.compte=0;e1_.style.left=fhPx(0);e1_.style.top=fhPx(0);e2_.style.display='none';return false;}}
if(vt_=='h'){var bascule_=((o.sens_[vt_]>0)?((parseInt(e1_.style.left)+o.taille[vt_]*o.sens_[vt_])<=0):((parseInt(e1_.style.left)+o.taille[vt_]*o.sens_[vt_])>=0));}
if(vt_=='v'){var bascule_=((o.sens_[vt_]>0)?((parseInt(e1_.style.top)+o.taille[vt_]*o.sens_[vt_])<=0):((parseInt(e1_.style.top)+o.taille[vt_]*o.sens_[vt_])>=0));}
var this_=o;if(bascule_){o.compte++;if(vt_=='h'){e1_.style.left=fhPx(o.depart[vt_]);e1_.style.width=fhPx(o.taille[vt_]);}
if(vt_=='v'){e1_.style.top=fhPx(o.depart[vt_]);e1_.style.height=fhPx(o.taille[vt_]);}
o.E1[vt_]=e1_;o.E2[vt_]=e2_;}else{o.E1[vt_]=e1_;o.E2[vt_]=e2_;}
return false;}}})