var isNetscape = (navigator.appName == "Netscape");
var isMacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var layerRef = (isNetscape) ? "document" : "document.all";
var styleRef = (isNetscape) ? "" : ".style";
var DHTML_Enabled = ( (document.layers || document.all) && !isMacIE );

function MenuCall(Content, Width, BackgrColor, MenuNumber) 
  {
      MenuID=MenuNumber;
      WidthMenu=Width;
      Color=BackgrColor;

      if (DHTML_Enabled) 
         {
            if (isNetscape) 
               { 
                 document.write("<LAYER  class=menu   bgcolor="+Color+"  width="+WidthMenu+"  visibility=hidden  id="+MenuID+"   onMouseover=\"MenuActivate('"+MenuID+"')\" onMouseOut=\"MenuKill('"+MenuID+"')\">"+Content+"</LAYER>");	
               } 
            else 
               {  
	           document.write("<DIV class=menu   id="+MenuID+"  STYLE=\"  position:absolute; right:10; top: 35; visibility:hidden; background:"+Color+"\" onMouseover=\"MenuActivate('"+MenuID+"')\" onMouseOut=\"MenuKill('"+MenuID+"')\">"+Content+"</DIV>");
		     eval(layerRef + '["'+MenuID+'"]'+ styleRef + '.width ='+WidthMenu);
	          }
        }

  }

function MenuActivate(MenuNumber) 
  {
         MenuID=MenuNumber;

         if (DHTML_Enabled) 
            { 
               if (isNetscape) 
                  { 
                      MenuIDPlace=MenuID+"Place"
                      CoordX=document.anchors[MenuIDPlace].x;
                      CoordY=document.anchors[MenuIDPlace].y +document.images["Menu1Picture"].height;
                      eval(layerRef + '["'+MenuID+'"]' + styleRef + '.top = '+CoordY);
                      eval(layerRef + '["'+MenuID+'"]' + styleRef + '.left = '+CoordX);
                      eval(layerRef + '["'+MenuID+'"]' + styleRef + '.visibility = "visible"');                     
                        
                  } 
               else 
                  {
                      eval(layerRef + '["'+MenuID+'"]' + styleRef + '.visibility = "visible"');
                  }
        }
   }

function MenuKill(MenuNumber) 
   { 
      MenuID=MenuNumber;
      if (DHTML_Enabled) 
           {

//	     if (  (!isNetscape)&&(window.event.toElement.tagName== 'A') )
//	         {
//	           return;
//	         }  
//	     if (  (!isNetscape)&&(window.event.toElement.tagName== 'DIV') )
//	         {
//	           return;
//	         } 
//
           eval(layerRef + '["'+MenuID+'"]' + styleRef + '.visibility = "hidden"');

		
		}
   }

 MenuContent=    
 	"<table  cellspacing=\"0\" bordercolor=\"#010859\" border=1 bordercolordark=\"#010859\" bordercolorlight=\"#ffffcb\"><tr><td><ul type=\"square\" style=\"margin-left: 20px; margin-bottom: 0px; font-size: 10px\"><A href=\"booklet.htm\">"+
	"<li>Направления деятельности</a>"+
 	"<A href=\"page2.htm\">"+
	"<li>Отдел энергетического аудита</a>"+
 	"<A href=\"page4.htm\">"+
	"<li>Отдел электроэнергетики</a>"+
 	"<A href=\"page6.htm\">"+
	"<li>Информационно-аналитический отдел</a>"+
 	"<A href=\"page7.htm\">"+
	"<li>Подготовка кадров</a>"+
 	"<A href=\"page8.htm\">"+
	"<li>Демонстрационная зона</a>"+
 	"<A href=\"page9.htm\">"+
	"<li>Журнал \"Энергоэффективность\"</a></ul></td></tr></table>";
	
 MenuWidth="220";
 bgcolor="ffffdd";
