var elmID = new String("-1");

function fShowHide(oWageringMenuButton, eID)
{
	eID = String(eID);
	
	var oDiv = document.getElementById("submenu_" + eID);
	
	if (oWageringMenuButton.className == 'image_class_closed')					fShowDiv(eID, 'all', '');
	else if (oWageringMenuButton.className == 'image_class_closed_main')		fShowDiv(eID, 'all', '_main');
	else if (oWageringMenuButton.className == 'image_class_open')				fHideDiv(eID, 'all', '');
	else if (oWageringMenuButton.className == 'image_class_open_main')			fHideDiv(eID, 'all', '_main');
	else if (oWageringMenuButton.className == 'image_class_closed_top')			fShowDiv(eID, 'all', '_top');
	else if (oWageringMenuButton.className == 'image_class_open_top')			fHideDiv(eID, 'all', '_top');
	
	elmID = String(eID);
}

function fShowHide_catalogue(oWageringMenuButton, eID)
{
	eID = String(eID);

	var oDiv = document.getElementById("submenu_" + eID);
	
	if (oWageringMenuButton.className == 'image_class_closed')					fShowDiv(eID, 'catalogue', '');
	else if (oWageringMenuButton.className == 'image_class_closed_main')		fShowDiv(eID, 'catalogue', '_main');
	else if (oWageringMenuButton.className == 'image_class_open')				fHideDiv(eID, 'catalogue', '');
	else if (oWageringMenuButton.className == 'image_class_open_main')			fHideDiv(eID, 'catalogue', '_main');
	else if (oWageringMenuButton.className == 'image_class_closed_top')			fShowDiv(eID, 'catalogue', '_top');
	else if (oWageringMenuButton.className == 'image_class_open_top')			fHideDiv(eID, 'catalogue', '_top');
	
	elmID = String(eID);
}

function fShowDiv(eID, mode, mode2)
{
	var oBtn = document.getElementById("plusMinus_" + String(eID));
	var oDiv = document.getElementById("submenu_" + String(eID));
	var oDiv2 = document.getElementById("submenu2_" + String(eID));

	var theRow = document.getElementById(eID + '_row');
	if (theRow)
		theRow.className = 'selected_row_cat';
	
	if (oBtn)
	{
		oBtn.className = 'image_class_open' + mode2;
		oBtn.title = "Свернуть";
	}
	
	if (oDiv)
	oDiv.className = "WMSMS";
	if (oDiv2)
	oDiv2.className = "WMSMS";
	
	if (mode=='all')
	open_sections++;
}

function fHideDiv(eID, mode, mode2)
{
	var oBtn = document.getElementById("plusMinus_" + String(eID));
	var oDiv = document.getElementById("submenu_" + String(eID));
	var oDiv2 = document.getElementById("submenu2_" + String(eID));
	
	var theRow = document.getElementById(eID + '_row');
	if (theRow)
		theRow.className = 'not_selected_row_cat';
	
	if (oBtn)
	{
		oBtn.className = 'image_class_closed' + mode2;
		oBtn.title = "Развернуть";
	}
	if (oDiv)
	oDiv.className = "WMSMH";
	if (oDiv2)
	oDiv2.className = "WMSMH";
	
	if (mode=='all')
	open_sections--;

}
