var NeedOpenAuth=false; var ie6 = !window.getComputedStyle && navigator.appVersion.indexOf("MSIE 7") == -1; var _html; window.onload = function () { _html = $T("HTML")[0]; if(ie6){ window.onresize = function(){ window.scrollTo(0, _html.scrollTop); } } init_auth( ); if(window.init_alert){ init_alert(); } if (NeedOpenAuth) { open_auth(); } var SearchText = 'Поиск по каталогу'; var SearchForm = document.getElementById('SearchForm'); if (SearchForm) { SearchForm.onsubmit = function ( ) { if ( this.searchtext.value == '' || this.searchtext.value == SearchText ) { return false; } } var str = document.location.href; str= str.replace("http:\/\/", ""); var arr = str.split("\/"); if ( arr.length > 3 ) { if (!SearchForm.searchtext.value){ SearchForm.searchtext.value = SearchText; } SearchForm.searchtext.onfocus = function ( ) { if ( this.value == SearchText ) { this.value=''; } } SearchForm.searchtext.onblur = function ( ) { if ( this.value == '' ) { this.value=SearchText; } } } } AuthHoverBlur( ); } var LoginText = 'Логин'; var PassText = 'Пароль'; function AuthHoverBlur( ) { var AuthForm = document.getElementById('AuthForm'); if ( AuthForm ) { AuthForm.onsubmit = function ( ) { if ( this.AuthLogin.value == '' || this.AuthLogin.value == LoginText || this.AuthPass.value == '' || this.AuthPass.value == PassText ) { return false; } } AuthForm.AuthLogin.value = LoginText; AuthForm.AuthLogin.onfocus = function ( ) { if ( this.value == LoginText ) { this.value=''; } } AuthForm.AuthLogin.onblur = function ( ) { if ( this.value == '' ) { this.value=LoginText; } } AuthForm.AuthPass.value = PassText; AuthForm.AuthPass.onfocus = function ( ) { if ( this.value == PassText ) { this.value=''; } } AuthForm.AuthPass.onblur = function ( ) { if ( this.value == '' ) { this.value=PassText; } } } } function init_auth(){ var root = $('auth'); if(!root){ return; } var btn = $T('H2', root)[0]; if (btn) { btn.clicked = false; btn.openBottom = 0; btn.closeBottom = -(root.offsetHeight - 30); btn.onclick = function(){ if(this.clicked){ root.style.bottom = this.closeBottom + "px"; }else{ root.style.bottom = this.openBottom + "px"; } this.clicked = !this.clicked; } } } function open_auth(){ var root = $('auth'); if(!root){ return; } var btn = $T('H2', root)[0]; if (btn) { btn.clicked = true; root.style.bottom = "0px"; } } function check_min_width(){ var m_root = $("min-width"); var root = $("text-content"); var items = ($T("IMG", root) || []).concat($T("table", root) || []); _html = $T("HTML")[0]; items.each(function(item){ if(item.offsetWidth > c_min_width){ var delta = item.offsetWidth - c_min_width; if(ie6){ min_width = 1000 + delta; print(min_width); m_root.style.width = min_width + "px"; }else{ m_root.style.minWidth = 1000 + delta + "px" } } item.style.position = "static"; item.style.visibility = "visible"; }); if(min_width && ie6){ window.onresize = function(){ m_root.style.width = document.body.clientWidth <= min_width ? min_width : "auto"; window.scrollTo(0, _html.scrollTop); } } } function wo(link,ww,hh,title) { w=window.open(link,'',(ww ? 'width='+ww+',' : '')+(hh ? 'height='+hh+',' : '')+'toolbar=0,scrollbars=0,resizable'); if (link.indexOf('.html')==-1) { if (document.layers) title=''; w.document.open(); w.document.write(''+title+''); w.document.write('
'); w.document.close(); } w.focus(); } function ww(link,ww,hh) { w=window.open(link,'',(ww ? 'width='+ww+',' : '')+(hh ? 'height='+hh+',' : '')+'toolbar=0,scrollbars=0,resizable'); w.focus(); } function init_menu(){ var root = $("main-menu"); var parent = $T("UL", root)[0]; var items = $T("LI", root); items.each(function(item){ if(ie6){ item.onmouseover = function(){ if(this.className.indexOf("here") != -1){ return } this.className = "over"; } item.onmouseout = function(){ this.className = this.className.replace("over", ""); } } if(item.parentNode == parent){ var dd = $C("dropdown", item, "DIV"); if(dd){ item.className += " initializing"; item.link = $T("A", item)[0]; item.dropdown = dd[0]; item.dropdown.ul = $T("UL", item.dropdown)[0]; item.dropdown.style.left = item.link.offsetWidth + 15 + "px"; var max_width = 0; var links = $T("A", item.dropdown); links.each(function(link){ if(link.offsetWidth > max_width){ max_width = link.offsetWidth; } }) item.dropdown.style.width = max_width + 45 + "px"; if(ie6){ item.dropdown.top = $C("dd-top", item.dropdown, "DIV")[0]; item.dropdown.top.corner = $C("corner", item.dropdown.top, "DIV")[0]; item.dropdown.bottom = $C("dd-bottom", item.dropdown, "DIV")[0]; item.dropdown.top.corner.style.left = max_width + 45 - 14 + "px"; } item.className = item.className.replace("initializing", ""); } } }) }