px =  "px";

timer1	= null;

var decrease	= 0.1; 

var offset = 0;

var selected_id = null;



function getPosition(id) 

{ 

	endPos = document.getElementById(id).offsetTop;

}	



function actionMenu(obj,steps) 

{

	if (document.getElementById) 

	{

		el = document.getElementById(obj) ;

	}

		el.xpos = el.offsetTop;

	if (el.xpos < endPos) 

	{

		clearTimeout(timer1);

	}

	else if (el.xpos >= endPos) 

	{

		clearTimeout(timer1);

	}

		distance = endPos - el.xpos + offset;

		steps = distance*decrease; 

		el.xpos += steps;

		el.style.top = el.xpos+px ;

		timer1= setTimeout("actionMenu('" + obj + "')",25);

}



function initMenu() 

{

	var args = initMenu.arguments;

	switch(args[0]) 

	{

	

	case "menu_highlight" :

		if(selected_id	!= args[1]) 

		{

			el = document.getElementById(args[1]);

			el.className	=  args[2];

		 }

	break;

	

	case "menu_click" :

		if(selected_id	!= null) 

		{

			document.getElementById(selected_id).className =  args[2];

		}

		document.getElementById(args[1]).className = args[3];

		selected_id = args[1];

	break;

	}

}