function tween(elem, param, deb){		// if(param == 'backgroundColor') alert(typeof(deb));		//-----------------  VARIABLES		this.elem	= elem;		this.val	= deb;		this.param	= param;		this.end;		this.deb;						this.temps;		// this.pg;		this.ips 	= 40;				this.inter;		this.interval;		this.onComplete = function(){};		this.dist;		this.pos = 0; //entre 0 et 1 -> position du mouvement		this.transition = ease;						var obj = this;				this.setMove = function(end, temps){						if(end == this.end)return;			if(end == this.val){				this.onComplete();				return;			}			clearTimeout(this.interval);			this.end = end;			this.deb = this.val;			this.stopMvt();																	this.temps = temps;								this.inter = temps/this.ips;			this.pos = 0;									if(typeof(this.val) == 'array' || typeof(this.val) == 'object'){				var i;				this.dist = new Array();				this.deb = copy_array(this.val);				for(i=0; i<this.val.length;i++){					this.dist[i] = this.end[i] - this.deb[i];				}							}else{				this.dist = this.end - this.deb;							}						this.mvt();					}								this.mvt = function(){			this.pos += (1/this.inter);				var inc = this.transition(this.pos);						if(typeof(this.val) == 'array' || typeof(this.val) == 'object'){				for(i=0; i<this.val.length;i++){					this.val[i] = Math.round(this.deb[i] + (this.dist[i]*inc));				}						}else{				this.val = this.deb + this.dist*inc;			}									if(this.pos >=1){				this.fin();			}else{				move_param(this.elem, this.param, this.val);				this.interval = setTimeout(function(){obj.mvt()},this.ips,this);			}		}										this.fin = function(){			this.val = this.end;			move_param(this.elem, this.param, this.end);			this.onComplete();		}				this.stopMvt = function(){			clearTimeout(this.interval);		}				move_param(this.elem, this.param, this.val); // --- bouger le 1er truc	}function move_param(elem, param, val){	if(!isNaN(val)){		val = Math.floor(val);	}	switch(param){				case 'height' :		case 'width' :		case 'minWidth' :		case 'top' :		case 'left' :		case 'bottom' :		case 'right' :		case 'margin' :		case 'marginTop' :		case 'marginBottom' :		case 'marginLeft' :		case 'marginRight' :		case 'padding' :		case 'fontSize' :			if(isNaN(val))return;				elem.style[param] = val+'px';			break;		case 'opacity' :			if(isNaN(val))return;				mod_alpha(elem,val);			break;					case 'color' :		case 'backgroundColor' :			mod_color(elem,val,param);			break;	}	}function mod_alpha(elem, opa){	if(!elem) return;	elem.style.visibility = (opa ==0)?'hidden':'visible';		if(document.all && !window.opera){ 		 //elem.style.filter = "alpha(opacity=" + opa + ");";				elem.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=' + (opa) + ')';				if(opa>99){			elem.style.filter='';		}	}else{		var Val = opa/100;      elem.style.setProperty( "-moz-opacity", Val, "");      elem.style.setProperty( "-khtml-opacity", Val, "");      elem.style.setProperty( "opacity", Val, "");	  	}	}function mod_color(elem, vals, param){		if(!elem) return;	if(vals.length !=3)return;	var color = vals.join(',');	elem.style[param] = 'rgb('+color+')';}function linear(pos){		return pos;}function ease(pos){		if(pos >= 1) return 1		pos =  Math.cos(pos*(Math.PI));		pos -=1;		pos/=2;		pos = Math.abs(pos);		return pos;}function copy_array(var_array){	var i;	var ret = new Array();	for(i=0;i<var_array.length;i++){		ret[i] = var_array[i];	}	return ret;}
