var occupied_header = new Array();
var occupied_menu = new Array();
//
for (i = 1; i <= 10; i++)
{
	occupied_header[i] = 0;
	occupied_menu[i] = 0; 
}


function CreateLayer(text, id, t, l)
{
	if (document.layers)
 	{
  		var str = "<LAYER ID=menu" + id + 
				  " TOP=" + t + " LEFT=" + l + " onmouseover=\"occupied_menu[" + id + 
				  "]=1;\" onmouseout=\"Turn('" + id + "',0);occupied_menu[" + id + 
				  "]=0;\" z-index=22 VISIBILITY=HIDE>" + text + "</LAYER>";
  		
		document.write(str);
 	}
 	else if (document.all)
 	{
  		var strng = "<div id=menu" + id + 
					" style=\"position:absolute;top:" + 
					t + ";left:" + l + 
					";display:none;width:100;filter:alpha(opacity=97);" + 
					"\" onmouseover=\"occupied_menu[" + id + "]=1;" + 
					"\" onmouseout=\"Turn('" + id + "',0);" + 
					"occupied_menu[" + id + "]=0;\">" + text + "</div>";
  		
		document.write(strng);
 	}
}
 
function Turn(id, mode)
{
	if (document.layers || document.all)
	{
  		if (mode)
   			eval("setTimeout(\"On(" + id + ", " + mode + ");\",100)");
  		else
   			eval("setTimeout(\"Off(" + id + ", " + mode + ");\",100)");
 	}
}

function On(id, mode)
{
	if (occupied_header[id])
	{
   		if (document.all)
    		eval("menu" + id).style.display = '';
   		else if(document.layers)
    		eval("document.layers['menu" + id + "']").visibility = "show";
	}
}
 
function Off(id, mode)
{
	if ((! occupied_menu[id]) && (! occupied_header[id]))
	{
   		if (document.all)
    		eval("menu" + id).style.display = 'none';
   		else if (document.layers)
    		eval("document.layers['menu" + id + "']").visibility = "hide";
	}
}
 
function bgOn(tt)
{
	tt.style.backgroundColor="#007DC2";
}	

function bgOff(tt)
{
	tt.style.backgroundColor="#62B4E8";
}

/********** My functions **********/
/*var NewWindow
//Open window
function OpenWindow (name){
	NewWindow = window.open("name", " ")
}*/




/*
	Функция определения типа браузера.	
*/
function cm_bwcheck()
{
	//Получение версии браузера:
	this.ver = navigator.appVersion;
	
	this.agent = navigator.userAgent.toLowerCase();
	this.dom = document.getElementById ? 1 : 0;
	
	this.op5 = (this.agent.indexOf("opera 5") > -1 || 
				this.agent.indexOf("opera/5") > -1) && 
				window.opera;
				 
  	this.op6 = (this.agent.indexOf("opera 6") > -1 || 
				this.agent.indexOf("opera/6") > -1) && 
				window.opera;  
  	
	this.ie5 = ( this.agent.indexOf("msie 5") > -1 && 
				 (! this.op5) && (! this.op6) );
	
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5") > -1);
	
  	this.ie6 = ( this.agent.indexOf("msie 6") > -1 && 
				 (! this.op5) && (! this.op6) );
	
	this.ie4 = ( this.agent.indexOf("msie") > -1 && 
				 document.all && 
				 (! this.op5) && (! this.op6) && (! this.ie5) && (! this.ie6) );
  	
	this.ie = (this.ie4 || this.ie5 || this.ie6);
	
	this.mac = (this.agent.indexOf("mac") > -1);
	
	this.ns6 = (this.agent.indexOf("gecko") > -1 || window.sidebar);
	
	this.ns4 = ((! this.dom) && document.layers) ? 1 : 0;
	
	this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || 
			   this.ns6 || this.op5 || this.op6);
  	
	this.usedom = this.ns6; //Use dom creation
  	this.reuse = this.ie || this.usedom; //Reuse layers
  	this.px = this.dom && (! this.op5) ? "px" : "";
	
	return this;
}

//Тип браузера:
var bw = new cm_bwcheck();

//Служебные переменные:
var x0 = 0;
var x_pr = screen.availWidth / 100;	//1 процент от ширины 
var x1 = 7 * x_pr;


//Создание массива, реализующего меню сайта:
txt = new Array();

//Начало секции инициализации элементов меню сайта:

txt[1] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"150\" bgcolor=\"#E9E5E5\">" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"150\">" + 
					"&nbsp;" + 
					"<a href=\"index.html\" class=\"active\">" + //Ссылка на раздел
						"Главная" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
		 "</table>";

txt[2] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"200\" bgcolor=\"#E9E5E5\">" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamr.htm\" class=\"active\">" + //Ссылка на раздел
					"  Реограф" + //Текст для элемента меню
				"</a>" +
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" +
				"&nbsp;" + 
				"<a href=\"pr_diamm.htm\" class=\"active\">" + //Ссылка на раздел
					"  Реомонитор" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamast.htm\" class=\"active\">" + //Ссылка на раздел
					"  Анализатор состава тела" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamast_irgt.htm\" class=\"active\">" + //Ссылка на раздел
					"  Анализатор состава тела Диамант-АИСТ-ИРГТ" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamast_mini.htm\" class=\"active\">" + //Ссылка на раздел
					"  Анализатор состава тела Диамант-АИСТ-мини" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamk.htm\" class=\"active\">" + //Ссылка на раздел
					"  Кардиограф" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamk_ppc.htm\" class=\"active\">" + //Ссылка на раздел
					"  Кардиограф-КПК" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diam_k_stress.htm\" class=\"active\">" + //Ссылка на раздел
					"  Диамант-К/стресс проба" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diams.htm\" class=\"active\">" + //Ссылка на раздел
					"  Спирограф" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diam_eeg.htm\" class=\"active\">" + //Ссылка на раздел
					"  Энцефалограф" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
                        //
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diam_eeg_reo.htm\" class=\"active\">" + //Ссылка на раздел
					"  Энцефалограф с блоком РЭГ" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamrks.htm\" class=\"active\">" + //Ссылка на раздел
					"  Комплекс Диамант-РКС" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diamrmks.htm\" class=\"active\">" + //Ссылка на раздел
					"  Комплекс Диамант-РМКС" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diam_holter.htm\" class=\"active\">" + //Ссылка на раздел
					"  Диамант-Холтер" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_bplab.htm\" class=\"active\">" + //Ссылка на раздел
					"  Монитор давления АД МнСДП-2 " + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_diam_ievi.htm\" class=\"active\">" + //Ссылка на раздел
					"  Измеритель Энергии Высоковольтного Импульса ИЭВИ-2 Диамант " + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_rascan.htm\" class=\"active\">" + //Ссылка на раздел
					"  Аппарат УЗИ Раскан" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_esma.htm\" class=\"active\">" + //Ссылка на раздел
					"  Комплекс ЭСМА-1224-Элит" + //Текст для элемента меню
				"</a>" + 
			"</td></tr>" +
			//
			"<tr><td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
				"&nbsp;" + 
				"<a href=\"pr_bl_obrabotki.htm\" class=\"active\">" + //Ссылка на раздел
					"  Блок обработки" + //Текст для элемента меню 
				"</a>" + 
			"</td></tr>" +
			//
		 "</table>";

txt[3] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"150\" bgcolor=\"#E9E5E5\">" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"150\">" + 
					"&nbsp;" + 
					"<a href=\"price.htm\" class=\"active\">" + //Ссылка на раздел
						"Прайс-лист" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
		 "</table>";
		 
txt[4] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"150\" bgcolor=\"#E9E5E5\">" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"150\">" + 
					"&nbsp;" + 
					"<a href=\"advertisement.htm\" class=\"active\">" + //Ссылка на раздел
						"Реклама" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
		 "</table>";
		 
txt[5] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"200\" bgcolor=\"#E9E5E5\">" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
					"&nbsp;" + 
					"<a href=\"programs.htm\" class=\"active\">" + //Ссылка на раздел
						"Обновление ПО" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
					"&nbsp;" + 
					"<a href=\"literature.htm\" class=\"active\">" + //Ссылка на раздел
						"Методические материалы" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"200\">" + 
					"&nbsp;" + 
					"<a href=\"articles.htm\" class=\"active\">" + //Ссылка на раздел
						"Статьи" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
		 "</table>";
		
txt[6] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"150\" bgcolor=\"#E9E5E5\">" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"150\">" + 
					"&nbsp;" + 
					"<a href=\"certificate.htm\" class=\"active\">" + //Ссылка на раздел
						"Сертификаты" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
		 "</table>";

txt[7] = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"130\" bgcolor=\"#E9E5E5\">" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"130\">" + 
					"&nbsp;" + 
					"<a href=\"contacts.htm\" class=\"active\">" + //Ссылка на раздел
						"Связь с нами" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
			"<tr>" + 
				"<td bgcolor=\"#62B4E8\" onmouseover=\"bgOn(this);\" onmouseout=\"bgOff(this);\" width=\"130\">" + 
					"&nbsp;" + 
					"<a href=\"partners.htm\" class=\"active\">" + //Ссылка на раздел
						"Наши партнеры" + //Текст для элемента меню
					"</a>" + 
				"</td>" + 
			"</tr>" + 
		 "</table>";

//Окончание секции инициализации элементов меню сайта


//Показ элементов меню (создание слоев под элементы):
for (var i = 1; i <= 7; i++)
{
	CreateLayer(txt[i], i, 121, x1 + (i - 1) * 13 * x_pr - i * 2);
}						
