/* generated javascript */ var skin = 'monobook'; var stylepath = '/skins-1.5'; /* MediaWiki:Common.js */ //fix for sortable tables: comma as decimal dot function ts_parseFloat(num){ if (!num) return 0 num = parseFloat(num.replace(/\./g, '').replace(/,/, '.')) return (isNaN(num) ? 0 : num) } //Mainpage: tab «статья» -> «заглавная» function mainPageTab(){ if (wgArticleId == 3){ var nstab = document.getElementById('ca-nstab-main') if (!nstab || wgUserLanguage != 'ru') return //other skins/lang var a = nstab.firstChild if (a.textContent) a.textContent = 'Заглавная' else a.innerText = 'Заглавная' } } //Collapsible Divs, [[ВП:СБ]] var autoCollapse = 2 var collapseCaption = 'скрыть' var expandCaption = 'показать' var NavigationBarHide = '[' + collapseCaption + ']' var NavigationBarShow = '[' + expandCaption + ']' var NavigationBarShowDefault = autoCollapse function collapsibleDivs(){ var navIdx = 0, colNavs = [], i, NavFrame var divs = document.getElementById('content').getElementsByTagName('div') for (i=0; NavFrame = divs[i]; i++) { if (!hasClass(NavFrame, 'NavFrame')) continue NavFrame.id = 'NavFrame' + navIdx var a = document.createElement('a') a.className = 'NavToggle' a.id = 'NavToggle' + navIdx a.href = 'javascript:collapseDiv(' + navIdx + ');' a.appendChild(document.createTextNode(NavigationBarHide)) // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked) for (var j=0; j < NavFrame.childNodes.length; j++) if (hasClass(NavFrame.childNodes[j], 'NavHead')) NavFrame.childNodes[j].appendChild(a) colNavs[navIdx++] = NavFrame } for (i=0; i < navIdx; i++) if ((navIdx > NavigationBarShowDefault && !hasClass(colNavs[i], 'expanded')) || hasClass(colNavs[i], 'collapsed')) collapseDiv(i) } function collapseDiv(idx) { var div = document.getElementById('NavFrame' + idx) var btn = document.getElementById('NavToggle' + idx) if (!div || !btn) return false var isShown = (btn.firstChild.data == NavigationBarHide) btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide var disp = isShown ? 'none' : 'block' for (var child = div.firstChild; child != null; child = child.nextSibling) if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent')) child.style.display = disp } //hasClass, from en.wp var hasClass = (function (){ var reCache = {} return function (element, className){ return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className) } })() //Load functions if (wgCanonicalNamespace != 'Special'){ if (wgAction != 'history'){ addOnloadHook(collapsibleDivs) addOnloadHook(mainPageTab) } if (wgAction == 'edit' || wgAction == 'submit') document.write('