function lib_bwcheck()
{
this.ver=navigator.appVersion;
this.agent=navigator.userAgent;
this.dom=document.getElementById?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ie=(this.ie4||this.ie5||this.ie6);
this.mac=(this.agent.indexOf("Mac")>-1)?1:0;
this.opera=(this.agent.indexOf("Opera")>-1)?1:0;
this.ns6=(this.dom && parseInt(this.ver) >= 5)?1:0; 
//this.ns6=this.agent.indexOf("Netscape6")>-1?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera || this.dom);
return this;
}
function moveLayers()
{
 var bw = new lib_bwcheck();
 if (bw.ie || bw.ns6 || bw.opera)
 {
 screenWidth = document.body.clientWidth + 18;
 document.all['search'].style.pixelLeft = ((screenWidth-750)/2)+120;
 document.all['search'].style.pixelTop = 200;
 } 
 else
 {
 screenWidth = window.innerWidth;
 document.layers['search'].left = ((screenWidth-750)/2)+120;
 document.layers['search'].top = 180;
 }
}
function popUp(menuName,on)
{
 var bw = new lib_bwcheck();
 if (on)
 {
 moveLayers();
 if (bw.ie || bw.ns6 || bw.opera)
 { document.all[menuName].style.visibility = "visible";
  //if(bw.opera) {document.sss.subm.value="Search";}
 }
 else { open("/search/index.html"); }
 }
 else
 {
 if (bw.ie || bw.ns6 || bw.opera)
 { document.all[menuName].style.visibility = "hidden"; }
 }
}
function check()
{
 var pole = document.sss.q.value;
 if(pole == ''){ alert("Поле запроса пусто!"); return 0; }
 else
  { 
   if(pole.indexOf(" ") > -1 && pole.indexOf(" ") < 4)
    { alert("Неверный критерий поиска!"); return 0; }
   else
    {
     if(pole.length <= 3) 
      { alert("Поиск осуществляется по четырем и более символам!"); return 0; } 
     else
      { return 1; }
    }
  }
}
function Select( tdItem )
 { document.getElementById( tdItem ).background="/eng/images/lmenu.gif"; }
function Deselect( tdItem )
 { document.getElementById( tdItem ).background=''; }
function SelectSM( tdItem )
 { document.getElementById( tdItem ).style.backgroundColor='#ffff99'; }
function DeselectSM( tdItem )
 { document.getElementById( tdItem ).style.backgroundColor=''; }
function SelectMM( idI2 )
 { document.getElementById( idI2 ).style.backgroundColor='#008800'; }
function DeselectMM( idI2 )
 { document.getElementById( idI2 ).style.backgroundColor=''; }

