var timeout = 250;
var timeoutID;
var lastID = 0;
function showMenu(id)
{		if ( timeoutID ) window.clearTimeout(timeoutID);
		if ( lastID != 0 && lastID != id ) setStyle(lastID);
		if ( id != 6 ) document.getElementById('js'+ id).style.display = "block";
		document.getElementById('jsa'+ id).className = "active";
		lastID = id; }

function hideMenu(id)
{		timeoutID = window.setTimeout( "setStyle(" + id + ")", timeout ); }

function setStyle(id)
{		if ( id != 6 ) document.getElementById('js'+ id).style.display = "none";
		document.getElementById('jsa'+ id).className = ""; }

var last2ID1 = 0;
var last2ID2 = 0;
function showOrHide(id, id2) {
		if ( document.getElementById(id).style.display == "none" || !document.getElementById(id).style.display ) {
				document.getElementById(id).style.display = "block";
				document.getElementById(id2).className = "link active";
				document.getElementById(id2).innerHTML = "Скрыть ответ"; }
		else {
				document.getElementById(id).style.display = "none";
				document.getElementById(id2).className = "link";
				document.getElementById(id2).innerHTML = "Показать ответ";}

		last2ID1 = id;
		last2ID2 = id2; }

var timeout2 = 500;
var timeout2ID;
var a = 1;
function catmenushow()
{
	if ( timeout2ID ) window.clearTimeout(timeout2ID);
	if (a)
	{	document.getElementById("catmenu").className = 'catmenu full';
		document.getElementById("all").style.display = 'block';

		var arrChild = document.getElementById("catlist").childNodes;
		for (k in arrChild)
		{	if (arrChild[k].nodeType == 1)
			{	if (arrChild[k].className == 'hide') arrChild[k].className = 'h';}
		}
		a = 0;
	}
}

function catmenuh()
{	timeout2ID = window.setTimeout( "catmenuhide()", timeout2 ); }

function catmenuhide()
{
	a = 1;
	document.getElementById("catmenu").className = 'catmenu';
	document.getElementById("all").style.display = 'none';

	var arrChild = document.getElementById("catlist").childNodes;
	for (k in arrChild)
	{	if (arrChild[k].nodeType == 1)
		{	if (arrChild[k].className == 'h') arrChild[k].className = 'hide' }}}
