var LayerNames = ['about','news','service','docs','issuer','partners','law'];
var LayerX = [-1,90,153,210,299,374,452];
var stopHide;



function getWidth() { // Получаем ширину рабочей области браузера
if (document.layers == null) send = document.body.clientWidth;
if (document.layers != null) send = window.innerWidth;
if (navigator.appName == "Netscape" && document.getElementById) send = window.innerWidth-18;
return send;
}

function posing(){

		os=getWidth()/2-384


		for (var i=0; i<LayerNames.length; i++){

			if (document.layers != null){
				document.getElementById(LayerNames[i]).left = LayerX[i]+os;
			}
			else{
				document.getElementById(LayerNames[i]).style.left = LayerX[i]+os;
			}
		}
}

function showMenu1 (LayerName)
	{
		if (document.layers != null)
			document.layers[LayerName].visibility = 'show';
		else
			document.getElementById(LayerName).style.visibility = 'visible';
		
	}
function hideAllX (LayerName){
	for (var i=0; i<LayerNames.length; i++){
		if (LayerNames[i]!=LayerName) hideMenu(LayerNames[i]);
	}
}


function hideAll (){
	if (stopHide) return;
	for (var i=0; i<LayerNames.length; i++){
		 hideMenu(LayerNames[i]);
	}
}




function hideMenu (LayerName)
	{
		if (document.layers != null)
			document.layers[LayerName].visibility = 'hide';
		else
			document.getElementById(LayerName).style.visibility = 'hidden';
	}

function setStopHide(){
       	stopHide=true;
}
function resetStopHide(){
       	stopHide=false;
}

function createMenu(LayerName)
	{
		var l;
		if (document.layers != null)
			l = document.layers[LayerName];
		else
			l = document.getElementById(LayerName);
		l.onmouseover = function ()
			{
			setStopHide();
			}
		l.onmouseout = function ()
			{
			resetStopHide();
			}
	}

function init()
	{
		for (var i=0; i<LayerNames.length; i++)
			{
				createMenu(LayerNames[i]);
			}
	}

function OverMnu1(mnu){
 mnu.style.backgroundColor='#8F5444';
 mnu.style.color='#FFFFFF';
 mnu.style.cursor='pointer';
}
function OutMnu(mnu){
 mnu.style.backgroundColor='';
 mnu.style.color='';
 mnu.style.cursor='';
}
function DownMnu(url){ 
window.open(url,'_self')
}

function photo_popup(url){
	var w;
	w=window.open(url, "popuphoto","width=400, height=400");
	w.focus();
}
function licence_popup(url){
	var w;
	w=window.open(url, "licencehoto","width=700,scrollbars=1");
	w.focus();
}
