/*----------------------------------------------------------------------------\
|   Animation du titre                                                        |
|                                                                             |
|     eclos@chez.com                                                          |
|                                                                             |
|-----------------------------------------------------------------------------|
| Created 1998-10 |            (c) Laurent Courbet          | Updated 2004-01 |
\----------------------------------------------------------------------------*/

Animator.isSupported = typeof document.createElement != "undefined" &&
	typeof document.documentElement != "undefined" &&
	typeof document.documentElement.offsetWidth == "number";

function Animator(oElement) {

	this._unitIncrement = 1;
	this._unitTimeStep = 60;
	this._timer = null; 
	this._left=0;
  this._top=0;
  this._maxPos = 0; 

	if (Animator.isSupported && oElement) {
		this.document = oElement.ownerDocument || oElement.document;
		
		this.element = oElement;
    this.element.className = "Anim";
    //if(typeof(this.element.style)=="object") 
    try{
      this.element.style.position="relative";
      this.element.style.display="inline";
      this.element.style.zIndex="2";
    }catch(E){
      this.element.style.position="static";
    }
    //else this.element.position="relative";

	}

}

Animator.prototype.showMe = function () {
  if(typeof(this.element.style)=="object")
    {this.element.style.visibility = 'visible'}
  else{this.element.visibility = 'show';} 
};
Animator.prototype.hideMe = function () {
  if(typeof(this.element.style)=="object")
    {this.element.style.visibility = 'hidden'}
  else{this.element.visibility = 'hide'}
};

Animator.prototype.moveH = function (from, to, step, timeInc) {
  if (!Animator.isSupported) return;
	var oThis = this;

  if(this._timer == null){ // inits
   	this._unitTimeStep = timeInc;
  	this._unitIncrement = step; //from<to?((to-from)/step):((from-to)/step);
    this._left = from;
    this._maxPos = to; 
  }
//  if(typeof(this.element.style)=="object"){ 
    this.element.style.left = this._left;
//  }else{
//    this.element.left = this._left; //Th.oElem.moveBy(step,0);
//  }
  this._left += this._unitIncrement; 
  if( this._unitIncrement > 0) this._left =Math.min(this._left, this._maxPos);
  else this._left =Math.max(this._left, this._maxPos);
  //alert("apres:"+this._left);

  if( ((this._unitIncrement > 0) && (this._left < this._maxPos)) ||
      ((this._unitIncrement < 0) && (this._left > this._maxPos)) ) {
    this._timer = window.setTimeout(function () {oThis.moveH();}, this._unitTimeStep);
  }else this._timer = null;


};

//</SCRIPT>
