﻿/*============================ objet d'animation ===========================================*/
     var m;
     var _ar= new Array();
     
        function moveH(deCombien,qui)
        {
            iL=_ar.length;
            
            m = new move(deCombien,qui);
            _ar.push(m);
            m.Start(iL);
        }
        
        function move(deCombien,qui)
        {
            this.iId=null;
            this.qui=document.getElementById(qui);
            this.deCombien=deCombien;
            this.iStep=0;
            this.stepLatency=16;
            this.nbStepDesire=15; //40*16= 640 ms 
        }
        
        move.prototype.Start=function(iAr)
        {
            actif = true;
            if (this.iId==null)
            {   
                this.iId= window.setInterval('_ar['+iAr+'].NextStep()', this.stepLatency);
                //Set(this.iId, '_ar['+iAr+'].NextStep()', this.stepLatency);
                this.qui.style.left = memoire2+"px"; // Déclaration du positionnement initial
            }
            //var c = Sys.UI.DomElement.getBounds($get('sliderMini'+num));
            var d = document.getElementById('sliderGlobal').style.height.replace('px','');
            if(456 > d)
                document.getElementById('sliderGlobal').style.height=456+"px";
        }
        
        move.prototype.Stop=function ()
        {
            //window.clearInterval(this.iId);
            Clear(this.iId);
            memoire2 += pos; // Mise en mémoire du positionnement actuel.
            this.qui.style.left = memoire2+"px";
            actif = false;
            redim = true;
            //var c = Sys.UI.DomElement.getBounds($get('sliderMini'+num));
            var d = document.getElementById('sliderGlobal').style.height.replace('px','');
            if(456 < d)
                document.getElementById('sliderGlobal').style.height=456+"px";
        }
        
        move.prototype.NextStep=function()
        {
            if (this.iStep<this.nbStepDesire){
             // acc=parseInt(((1-(this.iStep/this.nbStepDesire*4)/4)-0.5)*this.deCombien/(this.nbStepDesire/2));
               this.qui.style.left = parseInt(this.qui.style.left.replace('px',''))+(parseInt(this.deCombien/this.nbStepDesire))+'px';
                this.iStep++;
            }
            else{
                this.Stop();
            }
        }
        
        function Set(ou, koi, combien)
        {
            ou = window.setInterval(koi, combien);
        }
        function Clear(ki)
        {
            window.clearInterval(ki);
        }

