//******************************************************************************
//**                 FCE PRO ZJISTENI VLASTNOSTI OBJEKTU                      **
//******************************************************************************

function getRefTo(objID) {
  var objRef=null;
  bbdc=document;
  if(bbdc.getElementById && bbdc.getElementById(objID) != null)
  objRef = bbdc.getElementById(objID);
  else if(bbdc.layers && bbdc.layers[objID] != null)
  objRef= bbdc.layers[objID];
  else if(bbdc.all)
  objRef=bbdc.all[objID];
  return objRef;
}
function getElementPosition(obj) {
	for(var lx=0,ly=0; obj!=null; 
      lx += obj.offsetLeft, ly += obj.offsetTop, obj = obj.offsetParent);
	return {x:lx, y:ly}
}

function getElementSize(obj) {
  var width, height;
  
  if(obj.clip) {
    width  = obj.clip.width;
    height = obj.clip.height;
  } else if(obj.offsetWidth) {
    width  = obj.offsetWidth;
    height = obj.offsetHeight;
  } else {
    width  = obj.style.pixelWidth;
    height = obj.style.pixelHeight;
  }
  
  return { width:parseInt(width), height:parseInt(height) };
}

//******************************************************************************
//**                             FCE PRO MENU                                 **
//******************************************************************************
var sobj = null; 
var tid = null;
var probj = null;

function showSubmenu(predek, submenu_id) {
  hideSubmenu();
  var pos = getElementPosition(predek);
  var size = getElementSize(predek);

  sobj = getRefTo(submenu_id);
  
  sobj.style.left = pos.x-1;
  sobj.style.top = pos.y + size.height;
  sobj.style.visibility = "visible";
  
  probj = predek;
  predek.className="menuover1a";
}

function hideSubmenu() {
  if(sobj != null) sobj.style.visibility = "hidden";
  if(tid != null) clearTimeout(tid);
  if(probj != null) probj.className = "menu1";
  tid = null;
}

function hideSubmenuDelay() {
  tid = setTimeout("hideSubmenu()", 100);  
}

function clearSubmenuDelay() {
  if(tid != null) clearTimeout(tid);
}

function showText(id) {
  var obj = getRefTo(id); 
  if(obj!=null) {
    if(obj.style.display == "none") obj.style.display = "";    
      else obj.style.display = "none";
  }
}
