function strtrim(n){return n.replace(/^\s+/,"").replace(/\s+$/,"")}function expand(n,t){var i=!1;return ul=document.getElementById("ul"+n),img=document.getElementById("img"+n),(i=ul!=null&&img!=null&&ul.className!=null&&ul.innerHTML!=null)&&(str=img.src,ul.className=="Shown"||ul.className==""?(ul.className="Hidden",img.src=str.substr(0,str.length-5)+"c.gif",t!=null&&(t.href="javascript:;")):ul.className=="Hidden"&&(img.src=str.substr(0,str.length-5)+"o.gif",ul.className="Shown"),strtrim(ul.innerHTML)==""&&(ul.innerHTML="<DIV onclick='cancelLoad("+n+");' class='loadMsg'>&nbsp;Загрузка,&nbsp;пожалуйста&nbsp;подождите...&nbsp;<\/DIV>",ul.className=""),t!=null&&"object"==typeof t&&window.length>0&&(t.target="fra"+n)),!0}function clearSelection(n){n!=null&&n.className!=null&&(n.className="")}function setSelection(n){n!=null&&n.className!=null&&(n.className="Current")}function setSel(n){var i,t;if(selection!=null)if(selection.length!=null)for(t=0;t<selection.length;t++)clearSelection(selection[t]);else clearSelection(selection);if(selection=n,n){if(i=n,typeof n[0]!="undefined"){for(t=0;t<n.length;t++)setSelection(n[t]);i=n[0]}else setSelection(n);i!=null&&"object"==typeof parent&&window.parent.document.title!=null&&(window.parent.document.title=i.innerHTML+" - RSDN")}return}function cancelLoad(n){fra=document.getElementById("fra"+n);fra!=null&&(fra.src="about:blank");expand(n)}function loadNode(n,t,i){ul=document.getElementById("ul"+n);ul!=null&&"object"==typeof ul&&t&&"object"==typeof t&&(ul.className="Hidden",ul.innerHTML=t.innerHTML,expand(n));i?(a=document.getElementById("a"+i),setSel(a)):(a=document.getElementById("a"+n),selection==null?setSel(a):(selection.innerHTML==null||selection.innerHTML=="")&&setSel(a));return}function initSel(n){var t,r=null,i;if(typeof n[0]!="undefined")for(t=new Array(n.length),i=n.length-1;i>=0;i--)t[i]=document.getElementById("a"+n[i]),"object"==typeof t[i]&&(r=t[i]);else t=document.getElementById("a"+n),"object"==typeof t&&(r=t);setSel(t);r!=null&&r.offsetTop!=null&&document.body.clientHeight!=null&&window.scrollTo(0,r.offsetTop-document.body.clientHeight/2);return}function hideMenu(){return $("#tree-toolbar").hide(),$("#nav-tree").hide(),$("#hide-marker").show(),frameSet.cols="10,*",treeFrame!=null&&(treeFrame.noResize=!0),menuHid=!0,typeof Storage!="undefined"&&localStorage.setItem(navTreeHidKey,!0),!1}function showMenu(){return menuHid&&($("#tree-toolbar").show(),$("#nav-tree").show(),$("#hide-marker").hide(),frameSet.cols="*,75%",treeFrame!=null&&(treeFrame.noResize=!1),menuHid=!1,typeof Storage!="undefined"&&localStorage.setItem(navTreeHidKey,!1)),!1}function toggleTop(n){return $("#hide-top-btn").hasClass("hidden")?showTop(n):hideTop(n)}function hideTop(n){return $("#hide-top-btn").addClass("hidden").attr("title","Показать заголовок"),$(n.target).is("#hide-top-btn")&&window.parent.frames.frmTop.hideTop(),typeof Storage!="undefined"&&localStorage.setItem(topHidKey,!0),!1}function showTop(n){return $("#hide-top-btn").removeClass("hidden").attr("title","Скрыть заголовок"),$(n.target).is("#hide-top-btn")&&window.parent.frames.frmTop.showTop(),typeof Storage!="undefined"&&localStorage.setItem(topHidKey,!1),!1}function locate(){showMenu();var n=window.parent.frames.frmMain.location;return window.parent.frames.frmTree.location="/toc/?url="+n.pathname+n.search,!1}function getUrl(){var t=window.parent.frames.frmMain.location,n=t.pathname;return n=n.substr(1,n.length),window.top.location.replace("/?"+n+t.search),!1}var selection=null,frameSet,treeFrame,menuHid=!1,navTreeHidKey="navTreeHid",topHidKey="topHid";$(document).ready(function(){frameSet=window.parent.document.getElementById("lowerFrameset");treeFrame=frameSet.firstElementChild;$("#hide-menu-btn").click(hideMenu);$("#hide-top-btn").click(toggleTop);$("#hide-marker").click(showMenu);$("#locate-btn").click(locate);$("#get-url-btn").click(getUrl);typeof Storage!="undefined"&&(localStorage.getItem(navTreeHidKey)=="true"&&hideMenu(),localStorage.getItem(topHidKey)=="true"&&window.parent.frames.frmTop.hideTop())})