var p = 0;
var mpos = 0;
var mtar = 0;
var h = 20;
var o = -3;

function easeOutQuint(t, b, c, d){
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
};

function menuinit(i){
	p=i;
	document.getElementById("mp").style.top = document.getElementById("nul").offsetTop + h*p + o + 'px';
	mpos = document.getElementById("mp").offsetTop;
}

function menuover(m){
	menumove(mpos, document.getElementById("nul").offsetTop + h*m, 0);
}

function menuout(){
	menumove(mpos, document.getElementById("nul").offsetTop + h*p, 0);
}

function menumove(A,B,t){
	if(t==0) mtar = B;
	if(mpos!=B&&mtar==B){
		mpos = Math.round(easeOutQuint(t, A, B-A, 50));
		document.getElementById("mp").style.top = mpos + o + 'px';
		setTimeout("menumove("+A+","+B+","+(t+1)+")", 10);
	}
}

