<!--
var scrollNS4 = (document.layers)? true:false;   			//NS 4 
var scrollIE4 = (document.all)? true:false;   				//IE 4 
var scrollDOM = (document.getElementById)? true:false;   //DOM

function scrollGetNS4Object(MyID,MyDocument)
	{
	var MyObject= eval('MyDocument.'+MyID);
  if (!(MyObject))
  	for(var i=0;i<MyDocument.layers.length;i++)
			{
			MyObject = scrollGetNS4Object(MyID,MyDocument.layers[i].document);
			if (MyObject) break;
			}
  return MyObject;
  }


function scrollGetObject(MyID)
	{
  if (scrollDOM) return document.getElementById(MyID);
  if (scrollIE4) return document.all[MyID];
  if (scrollNS4) return scrollGetNS4Object(MyID,window.document);
  return 0;
	} 

function scrollGetCSS(MyObject)
	{
  if (scrollDOM || scrollIE4) return MyObject.style;
  else if (scrollNS4) return MyObject;
  else return 0;
	}

function scrollGetHeight(MyObject)
	{ 
  if (scrollDOM || scrollIE4) return MyObject.offsetHeight;
  else if (scrollNS4) return MyObject.clip.height;
  else return 0;
	}
	
function scrollGetWidth(MyObject)
	{ 
  if (scrollDOM || scrollIE4) return MyObject.offsetWidth;
  else if (scrollNS4) return MyObject.clip.width;
  else return 0;
	}

function scrollGetTop(MyObject)
	{ 
  if (scrollDOM || scrollIE4) 
  	return (MyObject.offsetTop);
  if (scrollNS4) return MyObject.y;
  	return 0;
	}

function scrollGetLeft(MyObject)
	{ 
  if (scrollDOM || scrollIE4) return MyObject.offsetLeft;
  if (scrollNS4) return MyObject.x;
  return 0;
	}

function scrollMoveObject(myX,myY)
	{
  this.X = myX;
  this.Y = myY;
  if ( this.CSS ) {
    this.CSS.left=this.X+'px';
    this.CSS.top=this.Y+'px';
  }
  }

function scrollMoveObjectUp(mystep)
	{
  this.Y -= mystep;
  if ( this.CSS ) {
    this.CSS.top=this.Y+'px';
  }
  }

function scrollMoveObjectDown(mystep)
	{
  this.Y += mystep;
  if ( this.CSS ) {
    this.CSS.top=this.Y+'px';
  }
  }

function scrollCreateObject(DivId,MyObject)
		{
    if (MyObject)
    	this.Object = MyObject;
    else
    	this.Object = scrollGetObject(DivId);
    
    if (this.Object)
    	{
      this.CSS = scrollGetCSS(this.Object);
      this.Height = scrollGetHeight(this.Object);
      this.Width = scrollGetWidth(this.Object);
      this.X = scrollGetTop(this.Object);
      this.Y = scrollGetLeft(this.Object);
      this.Move = scrollMoveObject;
      this.Up = scrollMoveObjectUp;
      this.Down = scrollMoveObjectDown;
      }
    return this;
    }

function scrollDelTextNode(MyObject)
	{
  var node = MyObject.firstChild;
  var next;

  while (node)
  	{
    next = node.nextSibling;
    if (node.nodeType == 3)
      MyObject.removeChild(node);
    node = next;
  	}
  }

function scrollCreateChildren(MyObject,HoriSpacer,VertSpacer)
	{
  var i=0;
  var MyChildren = new Array();
  if (scrollDOM)
  	{
    scrollDelTextNode(MyObject);
    for (i=0;i<MyObject.childNodes.length;i++)
    	{
    	MyChildren[i] = new scrollCreateObject(0,MyObject.childNodes[i]);
      MyChildren[i].Move(i*HoriSpacer,i*VertSpacer);
      }
    return MyChildren;
    }
  if (scrollIE4)
  	{
    for (i=0;i<MyObject.children.length;i++)
    	{
      MyChildren[i] = new scrollCreateObject(0,MyObject.children(i));
      MyChildren[i].Move(i*HoriSpacer,i*VertSpacer);
      }
    return MyChildren;
    }
  if (scrollNS4)
  	{
    for (i=0;i<MyObject.document.layers.length;i++)
    	{
      MyChildren[i] = new scrollCreateObject(0,MyObject.layers[i]);
      MyChildren[i].Move(i*HoriSpacer,i*VertSpacer);
      }
    return MyChildren;   
    }
  }

function scrollScrollUp()
	{
  var MyInterval = this.Interval1;
  this.stop();
  for ( var j=0;j<this.Step;j++) {
  if (this.Children[this.FirstChildren].Y<-this.threshold)
  	{
    MyInterval = this.Interval2;    this.Children[this.FirstChildren].Down(this.TotalHeight);
    if (this.FirstChildren<this.Children.length-1)
    	{
    	this.FirstChildren++;
      this.threshold += this.Children[this.FirstChildren].Height;
      }
    else
    	{
    	this.FirstChildren = 0;
        this.threshold = this.Children[this.FirstChildren].Height+this.Spacer;
      }
      break;
    }
	for (var i=0;i<this.Children.length;i++)
  	{
    //this.Children[i].Up(this.Step);
	this.Children[i].Up(1);        
    }
  }
  this.ProcessId = setTimeout(this.name + '.scroll()', MyInterval);
  }

function scrollStartScroll()
	{
  if (this.ProcessId) {
    // Rien à faire : deja programmer
  } else {
    this.ProcessId = setTimeout(this.name + '.scroll()', 1000);
  }
}

  
function scrollStopScroll()
	{
  if (this.ProcessId)
    clearTimeout(this.ProcessId);
  this.ProcessId = null;
	}

function ScrollBox(BoxName, DivId, myStep, myTempo1, myTempo2, mySpacer)
	{
  this.name     = BoxName;
  this.Step  = myStep ? myStep : 1;
  this.Interval1 = myTempo1 ? myTempo1 : 100;
  this.Interval2 = myTempo2 ? myTempo2 : 100;
  this.Spacer = mySpacer ? mySpacer : 0;
  this.ProcessId	= null;
  this.Container = new scrollCreateObject(DivId);
  this.Children = new scrollCreateChildren(this.Container.Object,0,mySpacer);
  this.FirstChildren = 0;
  this.LastChildren = this.Children.length-1;
  this.threshold = this.Children[0].Height+this.Spacer;

  var myHeight = 0;
  for (var i=0;i<this.Children.length;i++) 
  	{
    myHeight += (this.Children[i].Height + this.Spacer);
    }
  this.TotalHeight = myHeight;
  this.Container.visibility = 'visible';
	}

ScrollBox.prototype.scroll = scrollScrollUp;
ScrollBox.prototype.start = scrollStartScroll;
ScrollBox.prototype.stop = scrollStopScroll;
//-->
