
base_menu_name='';
moutcolor='#c8d5e5';  // Цвет пункта меню
movercolor='#D0E0FF'; // Цвет пункта меню при наведении курсора
widthOfMenu='170px';  // Ширина меню

var menu=new Array();

var index=0;
menu[index] = new Array(
	['ЭДС–Инжиниринг',''],
    ['index.php?sub&id=1','<b>Профиль</b>'],

	['index.php?sub&id=17','<b>Контакты</b>']


);

index++;
menu[index] = new Array(
	['ЭДС Gazpetro Poland',''],
	['index.php?sub&id=29','<b>Профиль</b>'],
	['index.php?sub&id=30','<b>Контакты</b>']
);

index++;
menu[index] = new Array(
	['Торговый дом &quot;ЭДС-ЭлТех&quot;',''],
	['index.php?sub&id=25','<b>Профиль</b>'],
	['index.php?sub&id=24','<b>Контакты</b>']
);

index++;
menu[index] = new Array(
	['Армавирский электротехнический завод',''],
	['index.php?sub&id=2','<b>Профиль</b>'],
	['index.php?sub&id=7','<b>История</b>'],
	['index.php?sub&id=12','<b>Контакты</b>'],
	['index.php?sub&id=19','<b>Раскрытие информации</b>']
);

index++;
menu[index] = new Array(
	['ЗАО &quot;Динамо-Плюс&quot;',''],
	['index.php?sub&id=32','<b>Профиль</b>'],
	['index.php?sub&id=33','<b>История</b>'],
	['index.php?sub&id=34','<b>Контакты</b>']
);




index++;
menu[index] = new Array(
	['Кузбассэлектромотор',''],
	['index.php?sub&id=27','<b>Профиль</b>'],
	['index.php?sub&id=28','<b>История</b>'],
	['index.php?sub&id=31','<b>Контакты</b>']
);


index++;
menu[index] = new Array(
	['ОАО Электропривод',''],
	['index.php?sub&id=36','<b>Профиль</b>'],
	['index.php?sub&id=38','<b>История</b>'],
	['index.php?sub&id=37','<b>Контакты</b>']
);




index++;
menu[index] = new Array(
	['Ярославский электромашиностроительный завод',''],
	['index.php?sub&id=5','<b>Профиль</b>'],
	['index.php?sub&id=10','<b>История</b>'],
	['index.php?sub&id=15','<b>Контакты</b>']

);



var s_name,mn,d_name,hmenu,x,y;
var timerID = null;
function getScroll()
         {
         scrollXY=document.getElementsByTagName((document.compatMode && document.compatMode == 'CSS1Compat') ? "HTML" : "BODY")[0];
	 return scrollXY.scrollTop;
         }
var oldmenu, oldcell,timerID;
function showmenu(Nmenu,event)
         {
         menu='menu'+Nmenu;
         cell='d'+Nmenu;
var menum=document.getElementById(menu);
var oldmenum=document.getElementById(oldmenu);
var cellm=document.getElementById(cell);
var td1=document.getElementById("td1");
var oldcellm=document.getElementById(oldcell);
var element = td1;
var reY=element.offsetTop;
         if (oldmenu!=null){oldmenum.style.visibility='hidden';}
         if (oldcell!=null){oldcellm.style.background='none';}
         cellm.style.background=movercolor;
         x=td1.offsetParent.offsetLeft+180;
         y=getScroll()+event.clientY-reY;
         menum.style.left=x;
         menum.style.top=y;
         menum.style.visibility='visible';
         oldmenu=menu;
         oldcell=cell;
         clearTimeout(timerID);
         }
function hidemenu(Nmenu)
         {
         menu='menu'+Nmenu;
         cell='d'+Nmenu;
         var menum=document.getElementById(menu);
         var oldcellm=document.getElementById(oldcell);
         if (oldcell!=null){oldcellm.style.background='none';}
         menum.style.visibility='hidden';
         }
function hideOldMenu()
         {
         hidemenu(oldmenu.slice(4));
         }


function make_base_menu()
         {
         str  = '<table name=\"basemenu\"';
         str += ' id=\"basemenu\"';
         str += ' class=\"menuleft\"';
         str += ' width=\"'+widthOfMenu+'\"';
         str += ' border=\"0\"';
         str += ' cellpadding=\"2px\">';
         str += ' <tr><td name=\"headlink\"';
         str += ' id=\"headlink\"';
         str += ' class=\"headmenu\"';
         str += ' align=\"center\">';
         str += base_menu_name;
         str += ' </td></tr>';

         for (i=1; i<=menu.length; i++)
             {
             str_item  = ' <tr>';
             str_item += ' <td onmouseover=\"showmenu(' + i + ',event)\"';
             str_item += ' onmouseout=\"timerID=setTimeout(\'hidemenu(' + i + ',event)\',1000)\"';
             str_item += ' name=\"d' + i + '\" id=\"d' + i + '\"> &nbsp';
             str_item += menu[i-1][0][0];
             str_item += ' </td></tr>';
             str += str_item;
             }
         str +='</table>';
         return str;
         }

function make_sl_menu(Nmenu)
         {
         itemObj=menu[Nmenu];
         str ='<div name=\"menu'+Nmenu+'\"';
         str+=' id=\"menu'+(Nmenu+1)+'\"';
         str+=' class=\"secondmenu\"';
         str+=' onmouseover=\"clearTimeout(timerID)\"';
         str+=' onmouseout=\"timerID=setTimeout(\'hidemenu('+(Nmenu+1)+')\',1000)\">';
         for (i=1; i<itemObj.length; i++)
             {
             str_item  = ' <a class=\"m\" href=\"';
             str_item += itemObj[i][0];
             str_item += ' \" target=_top>';
             str_item += itemObj[i][1];
             str_item += ' </a><br>';
             str += str_item;
             }
         str +='</div>';
         return str;
         }

function make_sl_menus()
         {
         result='';
         for (j=0; j<menu.length; j++)
             {
             result+=make_sl_menu(j);
             }
         return result;
         }



