var colorRight;
var colorLeft;
var cyklus = 0;
var level = 5;
var step = 15;

function zmenokraj(id)
{
var submenu = window.document.getElementById(id);
if (submenu != null)
  {
  if (colorLeft == null) 
    {
      colorLeft = 170;
      colorRight = 102; 
    }
  else
  {     
    //submenu.style.borderWidth = width + "px";
    submenu.style.borderLeftColor = "rgb("+colorLeft+","+colorLeft+","+colorLeft+")";
    submenu.style.borderTopColor  = submenu.style.borderLeftColor;
    
    submenu.style.borderRightColor  = "rgb("+colorRight+","+colorRight+","+colorRight+")";
    submenu.style.borderBottomColor = submenu.style.borderRightColor;
     
    if ((cyklus <= level) || (cyklus > (level * 2)))
      { 
      colorLeft = colorLeft - step;
      colorRight = colorRight - step;
      }
    if ((cyklus > level) && (cyklus <= (level * 2)))
      {
      colorLeft = colorLeft + step * 2;
      colorRight = colorRight + step * 2;      
      }
              
    cyklus = cyklus+1;
    if (cyklus > (level * 3)) {return;};        
  }    
  setTimeout('zmenokraj("menuintable")',50);
  }
};

setTimeout('zmenokraj("menuintable")',100);
