// ---------- Initialisations
	// Dimensions calque
	var theLayerName="ReturnTop";
	var theWidth=32;
	var theHeight=32;
	var thePictName="theButtonSrc";
	var thePict="top.jpg";
	// Position
	var alignX="left"; // "left" (defaut), "center" ou "right"
	var alignY="bottom"; // "top" (defaut), "middle" ou "bottom"
	var deltaX=190;
	var deltaY=15;
	var MoveOnScroll=true; // Scroll bouton avec page ?
	var MoveAnim=false;
// ---------- Fin initialisations

scrolled=isMinNS4||NS6?"window.pageYOffset":"document.body.scrollTop"

function getPosX() {
	if (self.innerWidth) { frameWidth = self.innerWidth; }
	else if (document.body) { frameWidth = document.body.clientWidth; }
	else return;
	
	if (alignX=="center") { x=(frameWidth-theWidth-deltaX)/2; }
	else {
		if (alignX=="right") { x=frameWidth-theWidth-deltaX; }
		else { x=deltaX; }
	}
	return x-36;
}

function getPosY() {
	if (self.innerWidth) { frameHeight = self.innerHeight; }
	else if (document.body) { frameHeight = document.body.clientHeight; }
	else return;
	
	if (alignY=="middle") { y=(frameHeight-theHeight-deltaY)/2; }
	else {
		if (alignY=="bottom") { y=frameHeight-theHeight-deltaY; } 
		else { y=deltaY; }
	}
	return y;
}

function checkScrolled(){
	theLayer=getLayer(theLayerName);
	
	x=getPosX();
	y=getPosY();

	dy=eval(scrolled);
	y=y+dy;

	if (MoveAnim) {
		scrollLayerTo(theLayer, x, y, 1) 
	} else {
		moveLayerTo(theLayer,x,y);
	}
	if(isMinNS4||NS6) setTimeout('checkScrolled()',40)
}


function initScroll(){
	theLayer=getLayer(theLayerName);

	x=getPosX();
	y=getPosY();
	
	if (MoveAnim) {
		scrollLayerTo(theLayer, x, y, 1) 
	} else {
		moveLayerTo(theLayer,x,y);
	}
	if(MoveOnScroll) isMinNS4||NS6?checkScrolled():window.onscroll=checkScrolled;
}