
var fhAnimation=fhClasse.creer({initialise:function(opt){this.options={duree:0};this.initOptions(opt);if(this.options.executer){this.numFonction=0;this.executer(this.options.executer[this.numFonction]);}
return this;},executer:function(opt){eval('this.'+opt['fonction']+'(opt);');},initOptions:function(opt){fhObjet.etendre(this.options,opt);if(this.timer)this.timer.arreter();this.timer=null;this.ips=25;this.intervalle=1000/this.ips;this.nbDeFois=parseFloat(this.options.duree/this.intervalle);this.compteur=0;},anime:function(opt){this.initOptions(opt);if(this.options.duree>0){this.prepareAnimation();this.timer=new fhTimer({fonction:this.anime_(),duree:this.intervalle,intervalle:true});}},anime_:function(opt){var o=this;return function(){o.positionne_()();o.redimensionne_()();}},positionne:function(opt){this.initOptions(opt);if(this.options.duree>0){this.prepareAnimation();this.timer=new fhTimer({fonction:this.positionne_(),duree:this.intervalle,intervalle:true});}},deplace:function(opt){this.positionne(opt);},positionne_:function(){var o=this;return function(){if(o.compteur<=o.nbDeFois){if(o.options['haut']!=undefined){o.hautI+=o.hautA;o.options.element.style.top=o.hautI+'px';}
if(o.options['gauche']!=undefined){o.gaucheI+=o.gaucheA;o.options.element.style.left=o.gaucheI+'px';}}else{if(o.options['haut']!=undefined)o.options.element.style.top=o.hautF+'px';if(o.options['gauche']!=undefined)o.options.element.style.left=o.gaucheF+'px';}
o.gestionCompteur();}},agrandi:function(opt){this.redimensionne(opt);},redimensionne:function(opt){this.initOptions(opt);if(this.options.duree>0){this.prepareAnimation();this.timer=new fhTimer({fonction:this.redimensionne_(),duree:this.intervalle,intervalle:true});}},prepareAnimation:function(){if(this.options['taillex']){this.options['largeur']=(parseInt(this.options.element.style.width)+parseInt(this.options['taillex']))+'px';delete this.options['taillex'];}
if(this.options['tailley']){this.options['hauteur']=(parseInt(this.options.element.style.height)+parseInt(this.options['tailley']))+'px';delete this.options['tailley'];}
if(this.options['x']){this.options['gauche']=(parseInt(this.options.element.style.left)+parseInt(this.options['x']))+'px';delete this.options['x'];}
if(this.options['y']){this.options['haut']=(parseInt(this.options.element.style.top)+parseInt(this.options['y']))+'px';delete this.options['y'];}
if(this.options['hauteur']!=undefined){this.hauteurD=parseInt(this.options.element.style.height);this.hauteurI=this.hauteurD;this.hauteurF=parseInt(this.options['hauteur']);this.hauteurA=parseFloat((this.hauteurF-this.hauteurD)/this.nbDeFois);}
if(this.options['largeur']!=undefined){this.largeurD=parseInt(this.options.element.style.width);this.largeurI=this.largeurD;this.largeurF=parseInt(this.options['largeur']);this.largeurA=parseFloat((this.largeurF-this.largeurD)/this.nbDeFois);}
if(this.options['haut']!=undefined){this.hautD=parseInt(this.options.element.offsetTop);this.hautI=this.hautD;this.options.element.style.top=this.hautD+'px';this.hautF=parseInt(this.options['haut']);this.hautA=parseFloat((this.hautF-this.hautD)/this.nbDeFois);}
if(this.options['gauche']!=undefined){this.gaucheD=parseInt(this.options.element.offsetLeft);this.gaucheI=this.gaucheD;this.options.element.style.left=this.gaucheD+'px';this.gaucheF=parseInt(this.options['gauche']);this.gaucheA=parseFloat((this.gaucheF-this.gaucheD)/this.nbDeFois);}},redimensionne_:function(){var o=this;return function(){if(o.compteur<=o.nbDeFois){if(o.options['hauteur']!=undefined){o.hauteurI+=o.hauteurA;o.options.element.style.height=o.hauteurI+'px';}
if(o.options['largeur']!=undefined){o.largeurI+=o.largeurA;o.options.element.style.width=o.largeurI+'px';}}else{if(o.options['hauteur']!=undefined)o.options.element.style.height=o.hauteurF+'px';if(o.options['largeur']!=undefined)o.options.element.style.width=o.largeurF+'px';}
o.gestionCompteur();}},gestionCompteur:function(){if(this.compteur>this.nbDeFois){this.compteur=0;this.timer.arreter();if(this.options.fonctionTermine){if(!this.options.fonctionTermine()){this.options.fonctionTermine=null;}}
if(this.options.executer){this.numFonction++;if(this.options.executer[this.numFonction]){this.executer(this.options.executer[this.numFonction]);}}}
this.compteur++;},arreter:function(){this.timer.arreter();this.compteur=0;},pause:function(){},continuer:function(){}})