// JavaScript Document

//variables' declaration
var timer        = 0;
var item      = 0;

//function for opening of submenu elements
function openelement(num, mMenu, img, iLink)
{    

//checks whether there is an open submenu and makes it invisible
if(item) item.style.visibility = 'hidden';

	window.clearTimeout(timer);
    //shows the chosen submenu element
    item = document.getElementById(num);
    item.style.visibility = 'visible';
		
	MM_swapImage(img,'',iLink,1)
}

// function for closing of submenu elements
function closeelementmain()
{
//closes the open submenu elements and loads the timer with 500ms
timer = window.setTimeout("if(item) item.style.visibility = 'hidden';",100);
}

// function for closing of submenu elements
function closeelement(curMenu)
{
//closes the open submenu elements and loads the timer with 500ms
timer = window.setTimeout("if(item) item.style.visibility = 'hidden';",100);

MM_swapImgRestore();
}

//function for keeping the submenu loaded after the end of the 500 ms timer
function keepsubmenu(curMenu)
{
        window.clearTimeout(timer);
}
//hides the visualized menu after clicking outside of its area and expiring of the loaded timer
document.onclick = closeelement; 
