var TimeMainMen=false;

function HideMainPop()
{var oper=0;
 var type=0;
 if (TimeMainMen) {clearTimeout(TimeMainMen);}
 if (document.pmImType) {type=document.pmImType;}
 if ((document.pmCurrentMenu) && (document.pmIsWait)) // скрыть пред. меню
 {document.pmIsWait=0; 
  RightsetView("main"+document.pmCurrentMenu,0);
  document.images[jgMenuNam+document.pmCurrentMenu].src = jgImPath + jgMenuNam+document.pmCurrentMenu + (oper ? jgImActSuf : (type ? jgImCurSuf : "")) + jgMenuExt;
  document.pmCurrentMenu=false;
 }
 document.pmIsWait=0;
}


function ButtonRolled(nImMenu, oper, type)
{ if (document.images)
   { document.pmIsWait=1;
     HideMainPop(); // скрыть вспл. меню, если видимо
     document.images[jgMenuNam+nImMenu.toString()].src = jgImPath + jgMenuNam+nImMenu.toString() + (oper ? jgImActSuf : (type ? jgImCurSuf : "")) + jgMenuExt;}
}

function ButtonMenuRolled(nImMenu, oper, type)
{if (TimeMainMen) {clearTimeout(TimeMainMen);}
 if (document.images)
   {if (oper) // отобразить меню
    {document.pmIsWait=1;
     HideMainPop(); // скрыть пред. меню, если видимо
     document.pmCurrentMenu=nImMenu.toString(); // новое текущее
     document.images[jgMenuNam+nImMenu.toString()].src = jgImPath + jgMenuNam+nImMenu.toString() + (oper ? jgImActSuf : (type ? jgImCurSuf : "")) + jgMenuExt;
     var imCoord= new getPosObj(document.images[jgMenuNam+nImMenu.toString()]);
     var PopMen=RightgetObj("main"+nImMenu.toString());
     if (!PopMen) return;
     var PopMenStyle=RightgetStyle("main"+nImMenu.toString());
     var Yshift=0;
     var Xshift=0;
     if ((isIE) || (isOpera && document.readyState) || (parent.frames[1].document.body.scrollTop) || (parent.frames[1].document.body.scrollLeft))
      {Xshift=parent.frames[1].document.body.scrollLeft;
       Yshift=parent.frames[1].document.body.scrollTop;
       }
     else
      { if (parent.frames[1].document.body.pageYOffset)
          {Yshift=parent.frames[1].document.body.pageYOffset;}
        if (parent.frames[1].document.body.pageXOffset)
          {Xshift=parent.frames[1].document.body.pageXOffset;}
      }
     PopMenStyle.left=Xshift;
     PopMenStyle.top=imCoord.y+Yshift;
     RightsetView("main"+nImMenu.toString(),1);
    } // if oper
   else // съехать с картинки
    {document.pmImType=type;
     document.pmIsWait=1;
     TimeMainMen=setTimeout('HideMainPop()', 150);   
    }
   } //document.images
}

function MoveFind()
{return; // отключен
 var styleFind=getStyle("blockfind");
 var nYheightNew=0;
 if (isIE)
  {nYheightNew=document.body.clientHeight;}
 else
  {nYheightNew=innerHeight-20;}
  if (nYheightNew>550)
  {styleFind.paddingBottom=Math.floor(nYheightNew/6);
     }
 else
  {if (isOpera) {styleFind.paddingBottom=1;}
   styleFind.paddingBottom=0;
  }

}

function ChooseSite(url)
{if (url==-1) {return;}
 window.open(url,'_blank','');
}

