



var moveDivObj = new Object();
var targetDivObj = new Object();
var movePos = new Object();

function navigation(idname,offsetPos,offsetBottomPos)
	{
		moveDivObj = document.getElementById(idname);
		moveDivObj.style.position="relative";
		movePos.offset = offsetPos;
		movePos.offsetBottom = offsetBottomPos;
		setInterval('navigationMove()', 20);
	}




function navigationMoveTest()
	{
		var scrolldata=(document.documentElement.scrollTop || document.body.scrollTop);
		targetDivObj.lookHeight=(window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight);
		document.body.style.position="relative";
		targetDivObj.bodyHeight=(document.height || document.body.clientHeight);
		moveDivObj.boxHeight=moveDivObj.offsetHeight;
		moveDivObj.boxTop=moveDivObj.offsetTop;
		limitMoveBottom=targetDivObj.bodyHeight-moveDivObj.boxHeight-2-movePos.offsetBottom;
		document.getElementById("menutext").innerHTML=targetDivObj.lookHeight;
	}




var pos=0;
var limitMoveBottom=0;

function navigationMove()
	{
		var scrolldata=(document.documentElement.scrollTop || document.body.scrollTop);
		targetDivObj.lookHeight=(window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight);
		document.body.style.position="relative";
		targetDivObj.bodyHeight=(document.height || document.body.clientHeight);
		moveDivObj.boxHeight=moveDivObj.offsetHeight;
		moveDivObj.boxTop=moveDivObj.offsetTop;
		limitMoveBottom=targetDivObj.bodyHeight-moveDivObj.boxHeight-2-movePos.offsetBottom;
if(pos<=scrolldata)
	{
	if(scrolldata<movePos.offset)
			{
				//pos=0;
				pos+=((movePos.offset-movePos.offset)-pos)/10;
			}
		else
			{
				if(scrolldata>limitMoveBottom)
				{
					pos+=((limitMoveBottom-movePos.offset)-pos)/10;
				}
				else
				{
				pos+=((scrolldata-movePos.offset)-pos)/10;
					if(pos>limitMoveBottom)
						{
							pos=limitMoveBottom;
						}
				}
			}
		moveDivObj.style.top=pos+'px';
	}
else
	{
		pos+=Math.floor((0-moveDivObj.boxTop)/10);
		moveDivObj.style.top=pos+'px';
	}
}















