function Scrollbar(bloc)
{
	//Proprietes du bloc:
	//Calcul de la hauteur réčlle du bloc:
	this.blocParentHauteur=bloc.offsetHeight;
	this.blocHauteur=0;
	elms=bloc.getElementsByTagName("*");
	for(i=0;i<elms.length;i++)
		this.blocHauteur+=(elms[i].offsetHeight)?elms[i].offsetHeight-20:0;
	// alert(this.blocHauteur+" / "+bloc.parentNode.offsetHeight);
	
	this.maxScrollTop=this.blocParentHauteur-30;
	
	//Les styles:
	bloc.style.position="relative";
	bloc.style.overflow="hidden";
	
	this.scrollBarDiv=document.createElement("div");
	this.scrollBarDiv.className="scrollBar_Div";
	this.scrollBarDiv.style.left=(bloc.offsetLeft+bloc.offsetWidth-20)+"px"
	this.scrollBarDiv.style.bottom=(-bloc.offsetHeight+207)+"px"
	// this.scrollBarDiv.style.height=this.blocParentHauteur+"px";
	
	bloc.parentNode.className+=" scrollBar_Conteneur";
	
	
	this.bloc=bloc;
	
	// this.startX=-1;
	// this.startY=-1;
	
	this.startScroll=function(e)
	{
		this.startX=((e)?e.pageX:event.clientX);
		this.startY=((e)?e.pageY:event.clientY);
		this.sTop=this.style.marginTop.replace('px','')*1;
	}
	this.moveScroll=function(e)
	{
		if(this.ref.scroll.startY>1)
		{
			curX=((e)?e.pageX:event.clientX);
			curY=((e)?e.pageY:event.clientY);
			scrollY=this.ref.scroll.sTop+(curY-this.ref.scroll.startY);
			if(scrollY<0) scrollY=0;
			else if(scrollY>this.ref.maxScrollTop) scrollY=this.ref.maxScrollTop;
			this.ref.scroll.style.marginTop=scrollY+"px";
			// document.title=scrollY+"/"+this.ref.maxScrollTop;
			
			this.ref.deplacerBloc(scrollY);
		}
	}
	this.deplacerHaut=function()
	{
			scrollY=(this.ref.scroll.style.marginTop+"").replace('px','')*1-10;
			if(scrollY<0) scrollY=0;
			else if(scrollY>this.ref.maxScrollTop) scrollY=this.ref.maxScrollTop;
			this.ref.scroll.style.marginTop=scrollY+"px";
			// document.title=scrollY+"/"+this.ref.maxScrollTop;
			
			this.ref.deplacerBloc(scrollY);
	}
	this.deplacerBas=function()
	{
			scrollY=(this.ref.scroll.style.marginTop+"").replace('px','')*1+10;
			if(scrollY<0) scrollY=0;
			else if(scrollY>this.ref.maxScrollTop) scrollY=this.ref.maxScrollTop;
			this.ref.scroll.style.marginTop=scrollY+"px";
			// document.title=scrollY+"/"+this.ref.maxScrollTop;
			
			this.ref.deplacerBloc(scrollY);
	}
	this.endScroll=function()
	{
		this.ref.scroll.startY=-1;
		this.blur();
	}
	
	this.deplacerBloc=function(pos)
	{
		this.bloc.scrollTop=this.blocHauteur*(pos/this.maxScrollTop);
		// this.scrollBarDiv.style.bottom=(-this.blocHauteur*(pos/this.maxScrollTop))+"px";
	}
	
	
	
	this.scroll=document.createElement("div");
	this.scroll.className="scrollBar_Barre";
	this.scroll.onmousedown=this.startScroll;
	this.scrollBarDiv.onselectstart=new Function("return false");
	this.scrollBarDiv.onselect=new Function("return false");
	this.scrollBarDiv.ondragstart=new Function("return false");
	this.scrollBarDiv.ondrag=new Function("return false");
	this.scroll.ref=this;
	this.scrollBarDiv.onmouseup=this.endScroll;
	this.scrollBarDiv.onmousemove=this.moveScroll;
	
	this.scrollBarDiv.appendChild(this.scroll);
	
	btnHaut=document.createElement("input");
	btnHaut.className="scrollBar_Haut";
	btnHaut.type="button";
	btnHaut.ref=this;
	btnHaut.onclick=this.deplacerHaut;
	
	
	btnBas=document.createElement("input");
	btnBas.className="scrollBar_Bas";
	btnBas.type="button";
	btnBas.ref=this;
	btnBas.onclick=this.deplacerBas;
	
	
	this.scrollBarDiv.appendChild(btnHaut);
	this.scrollBarDiv.appendChild(btnBas);
	this.scrollBarDiv.ref=this;
	
	this.bloc.parentNode.appendChild(this.scrollBarDiv);


	
	
}
