//----------------------------x = nazev prvku
function objGet(x) {
	if (Boolean(document.all)) return eval('document.all.'+x);
	else if (Boolean(document.getElementById)) return document.getElementById(x);
	else if (Boolean(document.ids)) return eval('document.ids.'+x);
	else return null;
}



var IdTime;
function allHiddenMenu(objId){
     window.clearTimeout(IdTime);
      IdTime=null;
      for (id=1; id<=91; id++){
        if (document.getElementById("ch"+id) != null){
        if (id != objId) document.getElementById("ch"+id).style.visibility = "hidden";
        }
      }
		objGet('ListNameBasket').style.visibility = "visible";
}
function chHiddenMenu(chID,pID){
     window.clearTimeout(IdTime);
      IdTime=null;
      for (id=1; id<=91; id++){
        if (document.getElementById("ch"+id) != null){
          if(id > pID && id != chID){document.getElementById("ch"+id).style.visibility = "hidden";}
        }
      }
}
function outObj(){
     IdTime = window.setTimeout("allHiddenMenu(91)",300);
}
function onRoot(hID,ID){
      var objElem = document.getElementById(ID);

      var x = 0;
      while (typeof objElem == 'object' && objElem.tagName != 'BODY'){
          x += objElem.offsetLeft;
          objElem = objElem.offsetParent;
      }
      allHiddenMenu(hID);
		if (x > 550){objGet('ListNameBasket').style.visibility = "hidden"};
      if(document.getElementById('ch'+hID)!= null ){
           document.getElementById('ch'+hID).style.left = x-700;
           document.getElementById('ch'+hID).style.top = 20;
           document.getElementById('ch'+hID).style.visibility = "visible";
      }
}
function onChildren(chID,ID,pID,nTop){
      var objElem = document.getElementById(ID);
      var x = 0;
      var y = 0;
      x += parseFloat(objElem.offsetWidth);
      while (typeof objElem == 'object' && objElem.tagName != 'BODY'){
          x += objElem.offsetLeft;
          y += objElem.offsetTop;
          objElem = objElem.offsetParent;
      };
      chHiddenMenu(chID,pID);
      if(document.getElementById('ch'+chID)!= null ){
           document.getElementById('ch'+chID).style.left = x-1000;
           document.getElementById('ch'+chID).style.top = y + nTop-150;
           document.getElementById('ch'+chID).style.visibility = "visible";
      }
}
function ClearTime(){
     window.clearTimeout(IdTime);
}


