function changeBorder(button)
{
	button.style.borderLeft = "2px solid #a4009e";
	button.style.borderBottom = "2px solid #a4009e";
	button.style.color = "#660066";
}
function restoreBorder(button)
{
	button.style.borderLeft = "2px solid #1e76ac";
	button.style.borderBottom = "2px solid #1e76ac";
	button.style.color = "#191970";
}
function displayMenu(id, display)
{
	menuItem = document.getElementById(id);	
	menuItem.style.display = display ? 'inline' : 'none';
}
function highlight(li, display)
{
	li.style.background = display ? 'white' : '#a7cff4';
}
function changeBorder(button)
{
	button.style.borderLeft = "2px solid #a4009e";
	button.style.borderBottom = "2px solid #a4009e";
	button.style.color = "#660066";
}
function restoreBorder(button)
{
	button.style.borderLeft = "2px solid #1e76ac";
	button.style.borderBottom = "2px solid #1e76ac";
	button.style.color = "#191970";
}

function setBlock(counter)
{
	if (ils[counter])
	{
		ils[counter].style.display = '';
		
	}
	
	if (ils[counter + 1])
	{
		setTimeout ("setBlock(" + (counter + 1).toString() + ")", 30); 
	}
}

var ils = new Array();

function displayMenu(obj)
{
	if (timeOut && tempObj == obj)
	{
		clearTimeout(timeOut);
		return;
	}
	
	var uls = document.getElementById('menu_production').getElementsByTagName("ul");
	
	for (var i = 0; i < uls.length; i++)
	{
		uls[0].style.display = 'none';
	}
	
    var childs = obj.getElementsByTagName('ul');
    
    ils = new Array();
    
    ils = childs[0].getElementsByTagName('li');
    
    for (var i = 0; i < ils.length; i++)
		ils[i].style.display = 'none';
    
    childs[0].style.display = 'block';
    
    if (ils[0])
    {
		setTimeout ('setBlock(0)', 80); 
    }
    
    obj.style.backgroundColor = 'white';
}

var timeOut = null;

var tempObj = null;

function hideMenu(obj)
{
	tempObj = obj;
    timeOut = setTimeout("setNone()", 50); 
}

function setNone()
{
	if (tempObj)
	{
		var childs = tempObj.getElementsByTagName("ul");
	    
		childs[0].style.display = 'none';
	    
		tempObj.style.backgroundColor = '#d7e8f6';
    }
    
    if (timeOut)
    {
		timeOut = null;
    }
}
