function bookmark(title, url) {
	// если название страницы не было чётко указано, возьмём заголовок текущей страницы
	if (title == undefined)
		title = document.title;

	// то же самое и с URL-ом
	if (url == undefined)
		url = top.location.href;

	if (window.sidebar) {
		// Firefox
		window.sidebar.addPanel(title, url, '');
	} else if (window.opera && window.print) {
		// Opera
		var t = document.createElement('a');
		t.setAttribute('rel', 'sidebar');
		t.setAttribute('href', url);
		t.setAttribute('title', title);
		t.click();
	} else {
		// IE
		window.external.AddFavorite(url, title);
	}
	return false;
}

function clicker ()
{	this.blur();
	if (!this.defStyle) this.defStyle = this.className;
	this.state = (this.state=="none")?"block":"none";
	var UL = this.parentNode.getElementsByTagName("UL")[0];
	if (UL) UL.style.display = this.state;
	if (this.state=="none")
	{	this.parentNode.className = this.defStyle+" closedMenuBranch";
	}
	else
	{	this.parentNode.className = this.defStyle+" n";
	}
	return false;
}

function recurse (elem)
{	var lis=elem.childNodes;
	for (var i=0; i<lis.length; i++)
	if (lis[i].tagName=="LI")
	{	var UL = lis[i].getElementsByTagName("UL")[0];
		var A = lis[i].getElementsByTagName("A")[0];
		if (A) A.className += " closedMenuBranch";
		if (UL)
		{	A.onclick = clicker;
			A.onclick();
			recurse (UL);
		}
	}
}

function menuMaker(elem)
{	if (!elem) return;
	var menu=document.getElementById(elem);
	if (!menu) return;

	nmMenuObj = menu;

	menu.style.display = "none";

	recurse(menu);

	menu.style.display = "block";

	var href=window.location.toString();

	if ((x=(href.indexOf("?")))<=0) return;
	href = trim(href.substring(x,href.length));

	//if (x=(href.indexOf("&"))) href = href.substring(0,x);

	if (href=="") return;
	//if ((x=(href.indexOf("&")))>0) href=href.substring(0,x);
	var As = menu.getElementsByTagName('A');
	for (var i=0; i<As.length; i++)
	{	href2=trim(As[i].href);
		if (x=href2.indexOf("?"))
		{	href2 = href2.substring(x,href2.length);
			if (href==href2)
			{	var parent=As[i].parentNode;
				while (parent!==menu)
				{	parent=parent.parentNode;
					if ((parent.tagName=="LI")&&(A=parent.getElementsByTagName("A")[0]))
					{	if (A.onclick) A.onclick();
					}
				}
			}
		}
	}


}

function trim(s)
{
  return rtrim(ltrim(s));
}

function ltrim(s)
{
  return s.replace(/^\s+/, '');
}

function rtrim(s)
{
  return s.replace(/\s+$/, '');
}
//---------------------------------------------

function ekr()
   {
    //alert('ekr');
	x=window.document.body.offsetWidth;	
	var wd = x-230;
	var browserType = navigator.appName;
    if(browserType == 'Microsoft Internet Explorer')
	  {
	   // alert(wd);				   
	   if (x > 980){document.getElementById('divlis').style.pixelWidth= wd; }
	  }		
   }
