<!-- 
/* ======================================================================================
 *	                                     B I S T R O 
 * ====================================================================================== 
 * AUTHOR       : X. van Aubel / J.H. van Rossum / M. van Vuren / S. Evers / P. Mars
 * DATE         : $Date: 5-04-05 17:13 $
 * MODIFIED	BY  : $Author: Jrossum $
 * DOCUMENT     : $Workfile: backtotop.js $
 * COPYRIGHT    : © 2004 Bistro. All rights reserved
 * ======================================================================================
 */


/*
 * --------------------------------------------------------------------------------------
 * FUNCTION			: startPolling()
 * --------------------------------------------------------------------------------------
 * DESCRIPTION		: Starts the function poll() with an interval
 * PARAMETERS		: 
 * OUTPUT			: 
 * --------------------------------------------------------------------------------------
*/
function startPolling()
{
 poll_on = setInterval("Polling()", 2000);
}

/*
 * --------------------------------------------------------------------------------------
 * FUNCTION			: Polling()
 * --------------------------------------------------------------------------------------
 * DESCRIPTION		: Polls to check if an vertical scroll-bar is present
 *					: If present and the position is greater than 80 then a
 *					: layer with 'back-to-top' is made visible
 * PARAMETERS		: 
 * OUTPUT			: 
 * --------------------------------------------------------------------------------------
*/ 
function Polling()
{ 
	var position = 0;

	//scrollbar position detection
	position = document.body.scrollTop;
	
	//determining range
	if (position > 80 )
	{
		// Show arrow
		document.getElementById('divStayTopLeft').style.display = '';
	}
	else
	{
		// Hide arrow
		document.getElementById('divStayTopLeft').style.display = 'none';
	}
	return true;
}

/*
 * --------------------------------------------------------------------------------------
 * FUNCTION			: Polling()
 * --------------------------------------------------------------------------------------
 * DESCRIPTION		: Polls to check if an vertical scroll-bar is present
 *					: If present and the position is greater than 80 then a
 *					: layer with 'back-to-top' is made visible
 * PARAMETERS		: 
 * OUTPUT			: 
 * --------------------------------------------------------------------------------------
*/ 
function floatTopDiv()
{
	var startX = screen.availWidth - 44;
	var startY = 20;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x;this.style.top=y;};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function()
	{
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : document.body.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("divStayTopLeft");
	stayTopLeft();
}
//-->