self.onError=null;

currentX = currentY = 0;  
lastScrollX = lastScrollY = 0;
YOffset = 200;
staticYOffset = 150;

MENUTOP = 200;
MENUWIDTH = 35;
MENUHEIGHT = 120;

NS6 = (document.getElementById&&!document.all) ? 1: 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

function getWinWidth() 
{
  if (NS||NS6)
    return(window.innerWidth);
  else if (IE)
    return(document.body.clientWidth);
  else
    return(null);
}
	
function getWinHeight() 
{
  if (NS||NS6)
    return(window.innerHeight);
  else if (IE)
    return(document.body.clientHeight);
  else
    return(null);
}

function floatmenu() {
	if(!(IE||NS||NS6)) return
	
	if (NS||NS6) { diffY = window.pageYOffset;}
	if (IE) {diffY = document.body.scrollTop;}
	
	if(diffY!=lastScrollY&&diffY>YOffset-staticYOffset) {
   		percent= .1 * (diffY-lastScrollY-YOffset+staticYOffset);
   	} else if (YOffset-staticYOffset+lastScrollY>YOffset-staticYOffset) {
   		percent= .1 * (diffY-lastScrollY-(YOffset-(YOffset-diffY)));
   	}
   	else {percent=0}
     		if(percent > 0) percent = Math.ceil(percent);
	else percent = Math.floor(percent);
	if(IE) document.all.floater.style.pixelTop+=percent;
	else if(NS) document.floater.top+=percent;
	else if(NS6) document.getElementById('floater').style.top=parseInt(document.getElementById('floater').style.top)+percent;
     		lastScrollY += percent;
}


function setPos()
{
	if(!(IE||NS||NS6)) return
	
	curentX = (595 + (getWinWidth() - 595) /2)  - MENUWIDTH + 40

	currentY = (getWinHeight()/2) - (MENUHEIGHT/2);
	if(NS) { 
		curentX -= 10 
	}
		
	if(IE) 
	{
		document.all.floater.style.pixelLeft = curentX
		document.all.floater.style.pixelTop = currentY
		document.all.floater.style.visibility = "visible"
	} 
	else if(NS)
	{
		document.floater.left = curentX
		document.floater.visibility = "show"
	}
	else if(NS6)
	{
		document.getElementById('floater').style.left = curentX
		document.getElementById('floater').style.top = currentY
		document.getElementById('floater').style.visibility = "visible"
	}
	if(NS||IE||NS6) action = window.setInterval("floatmenu()",1);
}


