var Lui
var b

//##########################################
function SVP(ASC,AF)	//## Installation ##
//##########################################
{
	this.ASC=ASC;
	this.AF=AF;
	this.timg=new Array();	//~~~~ positions initiales ~~~~
	this.h=new Array();
	var i=-1;
	for ( var n=0;n<this.ASC.childNodes.length;n++ )
	{	// tous les éléments
		if (this.ASC.childNodes[n].src)
		{	// les 2 1ères images
			i++;
			this.timg[i]=this.ASC.childNodes[n];
			this.Adresses(i);
			if ( i>=2) n=this.ASC.childNodes.length;
		}
	}
	this.timg[2]=this.ASC;
	this.Adresses(2);
	this.FH=this.timg[0];
	this.FB=this.timg[1];
	this.CurDep=false;
	Lui=this;
	this.ie = false;	/*@cc_on	this.ie = true;	@*/
	this.ASC.onblur =	function() { Lui.CurDep=false; };
	this.ASC.onclick =	function() { Lui.Cliquer(); }
	this.AF.onscroll =	function() { Lui.Affiche(); };
	this.FB.onmousedown =	function() { b=setInterval("Lui.Bouge(0.02)",30); };	
	this.FH.onmousedown =	function() { b=setInterval("Lui.Bouge(-0.02)",30); };
	this.FB.onmouseup =	function() { clearTimeout(b); };	
	this.FH.onmouseup =	function() { clearTimeout(b); };
	this.FB.onmouseout =	function() { clearTimeout(b); };	
	this.FH.onmouseout =	function() { clearTimeout(b); };
}
//###################################################################
SVP.prototype.Adresses=function(i)	//## adresses des "composants" ##
//###################################################################
{
	var p=this.timg[i];
	this.h[i]=0;
	do
	{	// position image + position des parents
		this.h[i]+=p.offsetTop;
		if ( p.style.position.toLowerCase()=="absolute" )
				{
					p=false;
				}
		else	{
					p=p.offsetParent;
				}
	} while (p)
}			
//###########################################################
SVP.prototype.Bouge=function(sens)	//## click sur flêches ##
//###########################################################
{
	this.CurDep=false;
	var tmp=this.AF.scrollTop+(sens*this.AF.offsetHeight);
	if (tmp<0)
			{
				tmp=0;
			}
	else	{
				if (tmp>this.AF.scrollHeight) 
				{
					tmp=this.AF.scrollHeight;
				}
			}
	this.AF.scrollTop=tmp;
	this.Affiche();
}


//##########################################################
SVP.prototype.Affiche=function()	//## déplace le texte ##
//##########################################################
{
	if ( ( this.AF.scrollTop+this.AF.offsetHeight ) >= 
					( this.AF.scrollHeight-this.AF.offsetHeight ) )
			{
				//this.CUR.style.top=this.h[0]+this.dispo;
			}
	else	{
				var rel=(this.AF.scrollTop/this.AF.scrollHeight)*this.dispo;
				//this.CUR.style.top=	rel+this.h[0]+this.FH.offsetHeight;
			}
}
//###############################################################
SVP.prototype.Cliquer=function()	//## click sur l'Ascenseur ##
//###############################################################
{
}
