// Функции для выпадающего меню
SHOW_MENU = true;
var timer;
var ind_nav = navigator.appName.toLowerCase().indexOf("microsoft internet explorer");
coloron='#FF0000';
coloroff='#1D4D8B';


/*------------подсветка меню-----------------*/
ie = (document.all)? true : false;
nn4 = (document.layers)? true : false;
nn5 = (parseInt(navigator.appVersion)>=5)? true : false;
opera = ((navigator.userAgent.indexOf("Opera")>-1) && parseInt(navigator.appVersion)>=4)? true : false;
if (opera) {nn5=false;}
cells = new Array("first","second","third","forth","fifth","sixth");

function light(which,what) {
	what=eval('color'+what);
	for (leer in cells) {
		if (ie) { if (cells[leer] == which) document.all[cells[leer]+'cell'].bgColor = what;
			else document.all[cells[leer]+'cell'].bgColor =coloroff; }
		if (nn4) { if (cells[leer] == which) document.layers[cells[leer]+'div'].bgColor = what;
			else document.layers[cells[leer]+'div'].bgColor = coloroff; }
		if (nn5) if (cells[leer] == which) {document.getElementById(cells[leer]+'cell').bgColor = what;}
			else document.getElementById(cells[leer]+'cell').bgColor = coloroff;
		if (opera) if (cells[leer] == which) {document.getElementById(cells[leer]+'cell').style.background = what;}
			else document.getElementById(cells[leer]+'cell').style.background = coloroff;
	}
}
/*-------------------------------------------*/


function OnOverMenu(tr, div, mode) {
	if(!SHOW_MENU) return;
	if(mode) {
		if(div != null) {
			ShowHideLayer(div, mode);
		}
	} else {
		if(div != null) {
			ShowHideLayer(div, mode);
		}
	}
}

function ShowHideLayer(div, mode) {
	if(mode) {
		div.style.position = "absolute";
		div.style.visibility = "visible";
		//if(ind_nav != -1) div.style.display = "";
		div.style.display = "";
	} else {
		div.style.visibility = "hidden";
		//if(ind_nav != -1) div.style.display = "none";
		div.style.display = "none";
	}
}

function ShowHideHTMLElements(elemName, show) {
	var coll = document.all.tags(elemName);
	if(show) {
		for(var i = 0; i < coll.length; i++) coll[i].style.visibility = "visible";
	} else {
		for(var i = 0; i < coll.length; i++) coll[i].style.visibility = "hidden";
	}
}