//$("#menu").onmouseover = MRmenuHover;

function MRmenuOver() {
	var a=arguments[0];
	var e=a.currentTarget;
	setMarkerTo(e);
	e=e.getElementsByTagName('UL')[0];
	if (!e) return;
	if (e.wav) clearTimeout(e.wav);
	if (!e.hgt) e.hgt=0;
	e.style.height = 'auto';
	e.newHGT = e.offsetHeight+56;
	e.style.height=e.hgt+"px";

	var p=e.parentNode;
	p.hgt=Math.max(24,e.hgt);
	p.newHGT = Math.max(24, e.newHGT);
	p.style.height=p.hgt+"px";
	
	clearInterval(e.apv);
	clearInterval(p.apv);
	e.apv=setInterval(function(){animateProperty(e, "height", "px", "hgt", "newHGT", true, "apv", .1)}, 20);
	p.apv=setInterval(function(){animateProperty(p, "height", "px", "hgt", "newHGT", true, "apv", .1)}, 20);
	startFade(e, 100);
}

function MRmenuOut(e) {
	e=e.getElementsByTagName('UL')[0];
	if (!e) return;
	e.hgt=e.offsetHeight;
	e.style.height = 'auto';
	e.newHGT = 0; 
	e.style.height=e.hgt+"px";
	
	var p=e.parentNode;
	p.hgt=Math.max(24,e.hgt);
	p.newHGT = Math.max(24, e.newHGT);
	p.style.height=p.hgt+"px";
	
	clearInterval(e.apv);
	clearInterval(p.apv);
	e.apv=setInterval(function(){animateProperty(e, "height", "px", "hgt", "newHGT", true, "apv", .1)}, 20);
	p.apv=setInterval(function(){animateProperty(p, "height", "px", "hgt", "newHGT", true, "apv", .1)}, 20);
	startFade(e, 0);
}

function MRmenuOutWait() {
	var a=arguments[0];
	var e=a.currentTarget;
	e=e.getElementsByTagName('UL')[0];
	markerOut();
	if (!e) return;
	if (e.wav) clearTimeout(e.wav);
	e.wav=setTimeout(function(){MRmenuOut(a.currentTarget), 10});
}
