var isDOM = (document.getElementById ? true : false);  
var isIE4 = ((document.all && !isDOM) ? true : false); 
var isNS4 = (document.layers ? true : false); 

function getRef(id) { 
	if (isDOM) return document.getElementById(id); 
	if (isIE4) return document.all[id]; 
	if (isNS4) return document.layers[id]; 
}  

var isNS = navigator.appName == "Netscape";  

function moveRightEdge() { 
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck, topMargin;  
	
	topMargin	= 228;
	pageHeight	= document.body.scrollHeight - Menu1.scrollHeight - 1;

	if (isNS4) { 
		yMenuFrom   = Menu1.top; 
		yMenuTo     = windows.pageYOffset + 20; 
	} else if (isDOM) { 
		yMenuFrom   = parseInt (Menu1.style.top, 10); 
		yMenuTo     = (isNS ? window.pageYOffset : Math.min(pageHeight, Math.max(topMargin, document.body.scrollTop))) + 1; 
	} 
	timeoutNextCheck = 0;  

	if (yMenuFrom != yMenuTo) { 
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20); 
		if (yMenuTo < yMenuFrom) 
			yOffset = -yOffset; 
		if (isNS4) 
			Menu1.top += yOffset; 
		else if (isDOM) 
			Menu1.style.top = parseInt (Menu1.style.top, 10) + yOffset; 
			timeoutNextCheck = 1; 
	} 
	setTimeout ("moveRightEdge()", timeoutNextCheck); 
} 