var menu1_opacity = 0;
var submenu1_opacity = 0;
var sm1_state = 0;
var sm1_timer_in = null;
var sm1_timer_out = null;
var submenu2_opacity = 0;
var sm2_state = 0;
var sm2_timer_in = null;
var sm2_timer_out = null;
var submenu3_opacity = 0;
var sm3_state = 0;
var sm3_timer_in = null;
var sm3_timer_out = null;
var menu1_showed = false;
var mouseOverMenuBar1 = false;
var mouseOverMenu1 = false;
var mouseOverMI = new Array(false, false, false, false, false, false, false);
var mouseOverSMI = new Array(new Array(false, false), new Array(false, false, false), new Array(false, false));
var numOfItem = -1;
function setMenu1Opacity(k)
{
var el = document.getElementById("menu_1");
koef = k/100;
el.style.opacity = koef;
el.style.mozOpacity = koef;
el.style.khtmlOpacity = koef;
el.style.filter = "alpha(opacity=" + k + ")";
}
function showMenu1()
{
var el = document.getElementById("menu_1");
mouseOverMenuBar1 = true;
if(menu1_showed == false)
{
menu1_opacity = 0;
setMenu1Opacity(menu1_opacity);
menu1_showed = true;
el.style.display = "block";
setTimeout("fadeIn_Menu1()", 100);
}
}
function fadeIn_Menu1()
{
if(menu1_opacity < 80)
{
menu1_opacity += 5;
setMenu1Opacity(menu1_opacity);
setTimeout("fadeIn_Menu1()", 30);
}
}
function fadeOut_Menu1()
{
if(menu1_opacity > 0)
{
menu1_opacity -= 10;
setMenu1Opacity(menu1_opacity);
setTimeout("fadeOut_Menu1()", 20);
}
else
{
menu1_opacity = 0;
setMenu1Opacity(menu1_opacity);
var menu = document.getElementById("menu_1");
menu.style.display = "none";
menu1_showed = false;
}
}
function outMenuBar1(el)
{
mouseOverMenuBar1 = false;
setTimeout("tryHideMenu1()", 200);
}
function mouseOutMenu1(el)
{
mouseOverMenu1 = false;
//setTimeout("tryHideMenu1()", 100);
}
function tryHideMenu1()
{
//debug TD:
var debugTD = document.getElementById("debug");
var el = document.getElementById("menu_1");
var INFO = document.getElementById("info");
var mom = false;
var i, j;
var str = "menu: [";
for(i = 0; i < 7; i++)
{
mom = mom || mouseOverMI[i];
str = str + mouseOverMI[i] + ",";
}
str = str + "]
";
for(i = 0; i < 3; i++)
{
str = str + "submenu" + i + ": ["
for(j = 0; j < mouseOverSMI[i].length; j++)
{
mom = mom || mouseOverSMI[i][j];
str = str + mouseOverSMI[i][j] + ",";
}
str = str + "]
";
}
//debugTD.innerHTML = str;
var test = document.createElement("div");
test.innerHTML = mouseOverMI[0] + "," + mouseOverMI[1] + "," + mouseOverMI[2] + "," + mouseOverMI[3] + "," + mouseOverMI[4] + "," + mouseOverMI[5];
//INFO.appendChild(test);
//INFO.innerHTML = numOfItem + " = " + mouseOverMI[0] + "," + mouseOverMI[1] + "," + mouseOverMI[2] + "," + mouseOverMI[3] + "," + mouseOverMI[4] + "," + mouseOverMI[5];;
if((!mom) && (!mouseOverMenuBar1))
{
// el.style.display = "none";
// menu1_showed = false;
setTimeout("fadeOut_Menu1()", 20);
}
}
function mouseOverMenuItem(el, num)
{
el.style.background = "#990000";
numOfItem = num;
mouseOverMI[num] = true;
if(num < 2 || num == 3)
{
showSubMenu(num);
}
}
function mouseOverSubMenuItem(el, sub_num, num)
{
el.style.background = "#999";
mouseOverSMI[sub_num][num] = true;
}
function mouseOutSubMenuItem(el, sub_num, num)
{
el.style.background = "none";
mouseOverSMI[sub_num][num] = false;
setTimeout("hideSubMenu(" + sub_num + ")", 100);
}
function showSubMenu(num)
{
var n = (num < 2)?(num + 1):num;
var menu = document.getElementById("menu_" + n);
var item = document.getElementById("menuitem" + n);
var submenu = document.getElementById("submenu" + n);
switch(num)
{
case 0:
submenu.style.left = "205px";
submenu.style.top = "183px";
//submenu1_opacity = 0;
setSubmenu1Opacity(submenu1_opacity);
submenu.style.display = "block";
if(sm1_timer_out != null)
{
// clearTimeout(sm1_timer_out);
sm1_timer_out = null;
}
sm1_state = 1;
sm1_timer_in = setTimeout("fade_InSubmenu1()", 20);
break;
case 1:
submenu.style.left = "205px";
submenu.style.top = "205px";
//submenu1_opacity = 0;
setSubmenu2Opacity(submenu2_opacity);
submenu.style.display = "block";
if(sm2_timer_out != null)
{
// clearTimeout(sm1_timer_out);
sm2_timer_out = null;
}
sm2_state = 1;
sm2_timer_in = setTimeout("fade_InSubmenu2()", 20);
break;
case 3:
submenu.style.left = "205px";
submenu.style.top = "249px";
//submenu1_opacity = 0;
setSubmenu3Opacity(submenu3_opacity);
submenu.style.display = "block";
if(sm3_timer_out != null)
{
// clearTimeout(sm1_timer_out);
sm3_timer_out = null;
}
sm3_state = 1;
sm3_timer_in = setTimeout("fade_InSubmenu3()", 20);
break;
}
}
function fade_InSubmenu1()
{
if(sm1_state == 2) return;
if(submenu1_opacity < 90)
{
submenu1_opacity += 10;
setSubmenu1Opacity(submenu1_opacity);
sm1_timer_in = setTimeout("fade_InSubmenu1()", 20);
}
else
{
sm1_timer_in = null;
sm1_state = 0;
}
}
function fade_InSubmenu2()
{
if(sm2_state == 2) return;
if(submenu2_opacity < 90)
{
submenu2_opacity += 10;
setSubmenu2Opacity(submenu2_opacity);
sm2_timer_in = setTimeout("fade_InSubmenu2()", 20);
}
else
{
sm2_timer_in = null;
sm2_state = 0;
}
}
function fade_InSubmenu3()
{
if(sm3_state == 2) return;
if(submenu3_opacity < 90)
{
submenu3_opacity += 10;
setSubmenu3Opacity(submenu3_opacity);
sm3_timer_in = setTimeout("fade_InSubmenu3()", 20);
}
else
{
sm3_timer_in = null;
sm3_state = 0;
}
}
function fade_OutSubmenu1()
{
if(sm1_state == 1) return;
if(submenu1_opacity > 0)
{
submenu1_opacity -= 10;
setSubmenu1Opacity(submenu1_opacity);
sm1_timer_out = setTimeout("fade_OutSubmenu1()", 20);
}
else
{
sm1_timer_out = null;
var submenu = document.getElementById("submenu1");
submenu.style.display = "none";
sm1_state = 0;
}
}
function fade_OutSubmenu2()
{
if(sm2_state == 1) return;
if(submenu2_opacity > 0)
{
submenu2_opacity -= 10;
setSubmenu2Opacity(submenu2_opacity);
sm2_timer_out = setTimeout("fade_OutSubmenu2()", 20);
}
else
{
sm2_timer_out = null;
var submenu = document.getElementById("submenu2");
submenu.style.display = "none";
sm2_state = 0;
}
}
function fade_OutSubmenu3()
{
if(sm3_state == 1) return;
if(submenu3_opacity > 0)
{
submenu3_opacity -= 10;
setSubmenu3Opacity(submenu3_opacity);
sm3_timer_out = setTimeout("fade_OutSubmenu3()", 20);
}
else
{
sm3_timer_out = null;
var submenu = document.getElementById("submenu3");
submenu.style.display = "none";
sm3_state = 0;
}
}
function setSubmenu1Opacity(k)
{
var submenu = document.getElementById("submenu1");
var koef = k/100;
submenu.style.mozOpacity = koef;
submenu.style.khtmlOpacity = koef;
submenu.style.opacity = koef;
submenu.style.filter = "alpha(opacity=" + k + ")";
}
function setSubmenu2Opacity(k)
{
var submenu = document.getElementById("submenu2");
var koef = k/100;
submenu.style.mozOpacity = koef;
submenu.style.khtmlOpacity = koef;
submenu.style.opacity = koef;
submenu.style.filter = "alpha(opacity=" + k + ")";
}
function setSubmenu3Opacity(k)
{
var submenu = document.getElementById("submenu3");
var koef = k/100;
submenu.style.mozOpacity = koef;
submenu.style.khtmlOpacity = koef;
submenu.style.opacity = koef;
submenu.style.filter = "alpha(opacity=" + k + ")";
}
function isMouseOverSubMenu(num)
{
if(num == 3) num = 2;
var i;
var len = mouseOverSMI[num].length;
var result = false;
for(i = 0; i < len; i++)
result = result || mouseOverSMI[num][i];
return result;
}
function hideSubMenu(num)
{
if(isMouseOverSubMenu(num) || mouseOverMI[num]) return;
switch(num)
{
case 0:
var submenu = document.getElementById("submenu1");
if(sm1_timer_in != null)
{
//clearTimeout(sm1_timer_in);
sm1_timer_in = null;
}
sm1_state = 2;
setTimeout("fade_OutSubmenu1()", 20);
break;
case 1:
var submenu = document.getElementById("submenu2");
if(sm2_timer_in != null)
{
//clearTimeout(sm1_timer_in);
sm2_timer_in = null;
}
sm2_state = 2;
setTimeout("fade_OutSubmenu2()", 20);
break;
case 3:
case 2:
var submenu = document.getElementById("submenu3");
if(sm3_timer_in != null)
{
//clearTimeout(sm1_timer_in);
sm3_timer_in = null;
}
sm3_state = 2;
setTimeout("fade_OutSubmenu3()", 20);
break;
}
tryHideMenu1();
}
function mouseOutMenuItem(el, num)
{
el.style.background = "#ff0000";
mouseOverMI[num] = false;
setTimeout("tryHideMenu1()", 100);
if( num < 2 || num == 3 )
{
setTimeout("hideSubMenu(" + num + ")", 100);
}
}
function menuClick(num)
{
switch(num)
{
case 0:
top.location.href = "https://lava.com.ua/services/software/";
break;
case 1:
top.location.href = "https://lava.com.ua/services/design/";
break;
case 2:
top.location.href = "https://lava.com.ua/shop/";
break;
case 3:
top.location.href = "https://lava.com.ua/services/service/";
break;
case 100:
top.location.href = "https://lava.com.ua/services/software/mobile/";
break;
case 101:
top.location.href = "https://lava.com.ua/services/software/www/";
break;
case 200:
top.location.href = "https://lava.com.ua/services/design/logos/";
break;
case 201:
top.location.href = "https://lava.com.ua/services/design/firmstyle/";
break;
case 202:
top.location.href = "https://lava.com.ua/services/design/polygraphy/";
break;
case 300:
top.location.href = "https://lava.com.ua/services/service/companies/";
break;
case 301:
top.location.href = "https://lava.com.ua/services/service/persons/";
break;
}
}