function showSubItem(i){
		document.getElementById('submenu_'+i).style.display='block';
		document.getElementById('menuitem_'+i).className='menuitem_over';
	}
function unshowSubItem(i){
		document.getElementById('submenu_'+i).style.display='none';
		document.getElementById('menuitem_'+i).className='menuitem';
	}
function menuitemOver(i){
		document.getElementById('menuitem_'+i).className='menuitem_over';
	}
function menuitemOut(i){
		document.getElementById('menuitem_'+i).className='menuitem';
	}
function writeMenu(){
	var menu=new Array();
	var index=0;
	menu[index] = new Array(
		['О компании',''],
    	['http://www.oknamck.ru','<b>О компании</b>']
	);


	index++;
	menu[index] = new Array(
		['Деревянные окна',''],
		['/tehnol.htm','<b>Технология производства</b>'],
		['/konstr6070.htm','<b>Оконная конструкция 60х70</b>'],
		['/konstr8070.htm','<b>Оконная конструкция 80х70</b>'],
        ['/konstr7880.htm','<b>Оконная конструкция 78х80</b>'],
        ['/maco.htm','<b>Фурнитура МАСО</b>'],
        ['/zowosan.htm','<b>Покрытие ZOWOSAN</b>']
	);


	index++;
	menu[index] = new Array(
		['Фотогалерея',''],
		['http://oknamck.ru/okna.htm','<b>Фотогалерея МСК</b>']
	);


	index++;
	menu[index] = new Array(
		['Статьи',''],
		['/st1.htm','<b>Деревянные окна для деревянных домов</b>'],
		['/st2.htm','<b>Достоинства деревянных окон</b>']
	);


	index++;
	menu[index] = new Array(
		['Контакты',''],
		['http://oknamck.ru/contact.php','<b>Контакты</b>']
	);
	var i=0;
	var item;
	var str='';
	for(i=0;i<menu.length;i++){
			item=menu[i];
			if(item.length>2){
				str+='<div id="menuitem_'+i+'" class="menuitem" onMouseOver="showSubItem(\''+i+'\');" onMouseOut="unshowSubItem(\''+i+'\');">';
				str+=item[0][0]+'</div>';
				str+='<div id="submenu_'+i+'" class="submenu" onMouseOver="showSubItem(\''+i+'\');" onMouseOut="unshowSubItem(\''+i+'\');">';
				for(ind=1;ind<item.length;ind++){
						str+='<a href="'+item[ind][0]+'"><div>'+item[ind][1]+'</div></a>';
					}
				str+='</div>';
			}else{
				str+='<div id="menuitem_'+i+'" class="menuitem" onMouseOver="menuitemOver(\''+i+'\');" onMouseOut="menuitemOut(\''+i+'\');">';
				str+='<a href="'+item[1][0]+'">'+item[1][1]+'</a>';
				str+='</div>';
			}
		}
			document.getElementById('vertical_mainmenu').innerHTML=str;
	}
