function changecolor(id, color) 
{
	element = document.getElementById(id);
	element.style.background = color;
} 

function childToggle(divName)
{
	Element.toggle(divName);			
}

function tOver(obj, isRestricted)
{
	obj.style.backgroundColor = '#ECECEC';
	obj.style.cursor = 'pointer';
	
	if (isRestricted != '')
	{
		Element.show(isRestricted);
	}	
}

function tOut(obj, isRestricted)
{
	obj.style.backgroundColor = '';
	obj.style.cursor = 'default';
	
	if (isRestricted != '')
	{
		Element.hide(isRestricted);
	}		
}

function tmOver(obj)
{
	obj.style.backgroundColor = '#ECECEC';
	obj.style.cursor = 'pointer';	
}

function tmOut(obj)
{
	obj.style.backgroundColor = '';
	obj.style.cursor = 'default';				
}

function hideAll()
{
	Element.hide('sub_home');
	Element.hide('sub_product');
	Element.hide('sub_resource');
	Element.hide('sub_downloads');
	Element.hide('sub_news');
	Element.hide('sub_company');
	Element.hide('sub_contacts');	
	Element.hide('sub_member');
}

function showSub()
{
	var subContainer = document.getElementById('hoversubMenu');	
	Element.show(subContainer);	
}

function menuHoverO(submenu)
{
	hideAll();
	
	var subContainer = document.getElementById('hoversubMenu');		
	
	if (subContainer.style.display == "none")
	{
		Effect.toggle(subContainer, 'slide', {duration:0.2});
	}
	
	var subUL = document.getElementById('sub_' + submenu);
	Element.show(subUL);	
}

function menuHoverOver(submenu)
{
	setTimeout(function(){menuHoverO(submenu)},10);
}

function menuCloseO()
{
	var subContainer = document.getElementById('hoversubMenu');	
	
	if (subContainer.style.display != "none")
	{
		Effect.toggle(subContainer, 'slide', {duration:0.2});	
	}
}

function menuClose()
{
	setTimeout(function(){menuCloseO()},10);	
}

function menuHoverOut(submenu)
{
	hideAll();
	var subUL = document.getElementById('sub_' + submenu);
	Element.show(subUL);
}