// Определение браузера
IE_check = (document.all); // Internet Explorer?
NC_check = (document.layers); // Netscape?
Opera_check = (document.getElementById); // Opera?


function getWidth() { // Получаем ширину рабочей области браузера
if (IE_check || Opera_check) send = document.body.clientWidth;
if (NC_check) send = window.innerWidth;
return send;
}

var Loaded;

var TimeOuts = {};
document.menu_left = new Array(190, 245, 360, 420, 523, 580);


function menuCoor(LayerName, num){
//	if (!Loaded) return;
	var offset=(getWidth()-770)/2;
		if (offset<0) offset=0;
		if (document.layers != null)
			document.layers[LayerName].left = document.menu_left[num]+offset;
		else
			document.getElementById(LayerName).style.left = document.menu_left[num]+offset;
}

function menuReCoor()
	{
		var LayerNames = ['about','our_activity','objects','show-room','news','information'];
		for (var i=0; i<LayerNames.length; i++)
			{
				menuCoor(LayerNames[i], i);
			}
	}

function showMenu (LayerName)
	{
	if (!Loaded) return;
		clearTimeout(TimeOuts[LayerName]);
		if (document.layers != null)
			document.layers[LayerName].visibility = 'show';
		else
			document.getElementById(LayerName).style.visibility = 'visible';
	}

function _hideMenu (LayerName)
	{
		if (document.layers != null)
			document.layers[LayerName].visibility = 'hide';
		else
			document.getElementById(LayerName).style.visibility = 'hidden';
	}

function hideMenu (LayerName)
	{
	if (!Loaded) return;
		TimeOuts[LayerName] = setTimeout ('_hideMenu(\''+LayerName+'\')',300);
	}

function createMenu(LayerName)
	{
		var l;
		if (document.layers != null)
			l = document.layers[LayerName];
		else
			l = document.getElementById(LayerName);
		l.onmouseover = function ()
			{
			clearTimeout(TimeOuts[LayerName]);
			}
		l.onmouseout = function ()
			{hideMenu(LayerName);}
	}

function init()
	{
		var LayerNames = ['about','our_activity','objects','show-room','news','information'];
		for (var i=0; i<LayerNames.length; i++)
			{
				createMenu(LayerNames[i]);
			}
		Loaded = true;
	}

