var english = false;

var lastMNU = 1;

var lastSubMNU = 1;

var lastSubMNU2 = 1;

var entered = 0;

var currentTheme = "";



function menuOver(id)  {

 if(!english) document.getElementById("menu" + id).className = "menu-item1";

	else document.getElementById("menu" + id).className = "menu-item1-en";

}

function menuOut(id)  {

 if(!english) document.getElementById("menu" + id).className = "menu-item";

	else document.getElementById("menu" + id).className = "menu-item-en";

}



function certMenuOver(id)  {

 if(!english) document.getElementById("cert" + id).className = "cert-menu-item1";

	else document.getElementById("cert" + id).className = "cert-menu-item1-en";

}

function certMenuOut(id)  {

 if(!english) document.getElementById("cert" + id).className = "cert-menu-item";

	else document.getElementById("cert" + id).className = "cert-menu-item-en";

}



function showSub(id,left)  {

 document.getElementById("submenu" + id).style.left = left;

 document.getElementById("submenu" + id).style.visibility = "visible";

}



function subShowSub(id,top,left)  {

 document.getElementById("subsubmenu" + id).style.top = top;

 document.getElementById("subsubmenu" + id).style.left = left;

 document.getElementById("subsubmenu" + id).style.visibility = "visible";

}



function certShowSub(id,subid,top)  {

 setTimeout('cShowSub(\'' + id + "\'," + subid + "," + top + ')',1);

}



function cShowSub(id,subid,top)  {

 lastSubMNU2 = subid;

 currentTheme = id;

 document.getElementById("subsubmenu-cert").style.top = top;

 if(!english) document.getElementById("subsubmenu-cert").style.left = 509;

	else document.getElementById("subsubmenu-cert").style.left = 506;

 document.getElementById("subsubmenu-cert").style.visibility = "visible";

}



function leaveLayer (id) {

 document.getElementById("submenu" + id).style.visibility = "hidden";

 document.getElementById("submenu" + id).style.left = -100;

 menuOut(lastMNU);

}



function leave(id,subid) {

 entered = 0;

 menuOut(id);

 lastMNU = id;

 lastSubMNU = subid;

 LayerTimer = setTimeout ("leaveLayer(" + subid + ")", 1);

}



function subLeaveLayer (id,subid) {

 document.getElementById("subsubmenu" + subid).style.visibility = "hidden";

 document.getElementById("subsubmenu" + subid).style.left = -100;

 // if (entered == 1) leave(id,subid);

}



function certLeaveLayer () {

 document.getElementById("subsubmenu-cert").style.visibility = "hidden";

 document.getElementById("subsubmenu-cert").style.top = -100;

 // if (entered == 1) leave(id,subid);

}



function subLeave(id,subid1,subid2) { 

 lastSubMNU = subid1;

 subOut(lastMNU,lastSubMNU);

 LayerTimer1 = setTimeout ("subLeaveLayer(" + subid1 + "," + subid2 + ")", 1);

}



function certLeave() { 

 subOut(2,lastSubMNU2);

 LayerTimer1 = setTimeout ("certLeaveLayer()", 1);

}



function enter(id)  {

 menuOver(lastMNU);

 clearTimeout (LayerTimer);

 LayerTimer = 0;

}



function subEnter(id)  {

 entered = 1;

 menuOver(lastMNU);

 clearTimeout (LayerTimer);

 LayerTimer = 0;

 clearTimeout (LayerTimer1);

 LayerTimer1 = 0;

 lastSubMNU = id;

 subOver(lastMNU,lastSubMNU);

}



function certEnter()  {

 entered = 1;

 menuOver(3);

 clearTimeout (LayerTimer);

 LayerTimer = 0;

 clearTimeout (LayerTimer1);

 LayerTimer1 = 0;

 //lastSubMNU = subid;

 subOver(2,lastSubMNU2);

}



function subOver(subid,id)  {

 lastSubMNU = subid;

 document.getElementById("sub" + subid + id).className = "submenu-item1";

}

function subOut(subid,id)  {

 document.getElementById("sub" + subid + id).className = "submenu-item";

}



function certSubOver(id)  {

 document.getElementById("subcert" + id).className = "submenu-item1";

}

function certSubOut(id)  {

 document.getElementById("subcert" + id).className = "submenu-item";

}



function subSubOver(subid1,subid2,id)  {

 document.getElementById("sub" + subid1 +subid2 + id).className = "submenu-item1";

}

function subSubOut(subid1,subid2,id)  {

 document.getElementById("sub" + subid1 +subid2 + id).className = "submenu-item";

}



function focusImage(path)  {

 if(screen.width == 800) window.open(path,"focus","toolbar=no; height=600; width=450; scrollbars=yes");

  else window.open(path,"focus","toolbar=no, height=630, width=450, scrollbars=yes");

}



function certOpen(point)  {

 if(point == 1) document.location = currentTheme + "-osvedceni.php";

 else if(point == 2) document.location = currentTheme + "-postup.php";

 else if(point == 3) document.location = currentTheme + "-zadost.php";

 else if(point == 4) document.location = currentTheme + "-certifikat.php";

 else if(point == 5) document.location = currentTheme + "-licence.php";

}
