var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var fromtop = 1;
var barHeight = 16;

function DD_TopBar()
{
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(!el.style)el.style=el;
		el.pY = -1;
		el.sP=function(){this.style.top=this.y;};
		el.hide=function(){this.style.visibility = d.layers ? "hide" : "hidden";this.visible=false;};
		el.show=function(){this.style.visibility = d.layers ? "show" : "visible";this.visible=true;};
		el.hide();
		el.initP=function(){
			this.x = 0;
			this.y = (ns ? pageYOffset : document.body.scrollTop) - barHeight;
			this.sP();
		}
		el.initP();
		el.y = 0; el.sP();el.pY = 0;  //override
		return el;
	}
	window.topBar=function()
	{
		var pY = ns ? pageYOffset : document.body.scrollTop;
		if (pY != barObj.pY){
			barObj.pY = pY;
			if (barObj.visible) barObj.hide();
			setTimeout("topBar()", 300);
		}
		else {
			if (!barObj.visible){
				barObj.initP();
				barObj.show();
				//setTimeout("topBar()", 10);
			}
			else {
				//alert(pY + ',' + barObj.y);
				barObj.y += (pY - barObj.y)/20;
				barObj.sP();
				//alert('yes');
			}
			setTimeout("topBar()", 10);
		}
	}
	barObj = ml("divTopBar");
	topBar();
}
window.onload = DD_TopBar;
