<!--
mShow = 10;  mHide = 10;
tShow = 100; tHide = 500;

ms = '-';    mh = '-';      mi = '-';
ts = '-';    th = '-';      ti = '-';
ttms = null; ttmh = null;
mtms = null; mtmh = null;

function getarr(name, n0, ln)
{
  tq = name;
  aq=new Array();  
  if (n0==1) {aq[0]= tq; mq = 1}  else mq = 0;
  while(tq.length > ln)
  { tq = tq.substr(0,tq.length-2);
    aq[mq]= tq;
    mq += 1;
  }
  return aq;
}


// общее меню сайта

function mshow(element, name)
{
  var s = { x: 0, y: 0 };
  while (element.offsetParent) 
  { s.x += element.offsetLeft;
    s.y += element.offsetTop;
    element = element.offsetParent;
  }
  msl = (-20) + s.x; mst = mtop + s.y;
  clearTimeout(ttmh);
  ttmh = setTimeout("if(ti != '-'){document.all(ti).style.display = 'none'}", mShow);

  ms = name;  mh = mi;
  if (mh!='-' && mh!=ms)
  { clearTimeout(mtmh);
    mtmh = setTimeout("if(ms != mh){document.all(mh).style.display = 'none'}", mShow)
  }
  mtms = setTimeout("if(ms != '-'){mi = ms; document.all(ms).style.display = ''; document.all(ms).style.top = mst; document.all(ms).style.left = msl;}", mShow);
}

function mhide(name)
{
  ms = '-';   mh = name;
  clearTimeout(mtms);
  clearTimeout(mtmh);
  mtmh = setTimeout("if(ms != mh && mi.length <= mh.length){document.all(mh).style.display = 'none'}; if(mh!=mi && mi!='-'){document.all(mi).style.display = 'none';}", mHide)
}

// товарное меню 

function tshow(name, ftpos)
{
  clearTimeout(mtmh);
  mtmh = setTimeout("if(mi != '-'){document.all(mi).style.display = 'none'}", tShow)

  fp = ftpos;
  ts = name;  th = ti;  tq = ti;

  if (th!='-' && th!=ts && th.length >= ts.length)
  { 
    aq = getarr(ti,1,3);
    for (i = 0; i < aq.length; i++) {chStyleOff(aq[i]);}
    clearTimeout(ttmh); 
    ttmh = setTimeout("for (i = 0; i < aq.length; i++){document.all(aq[i]).style.display = 'none'}", tShow)
    
  }
  clearTimeout(ttms);
  ttms = setTimeout("if(ts != '-'){ti = ts; document.all(ts).style.display = ''; document.all(ts).style.top = fp; chStyleOn(ts)}", tShow);
}

function thide(name)
{
  ts = '-';  th = name;

  clearTimeout(ttms);
  clearTimeout(ttmh);
  ttmh = setTimeout("if(ts != th && ti.length <= th.length){document.all(th).style.display = 'none'; chStyleOff(th);}; if(th!=ti && ti!='-' && ti.length <= th.length){document.all(ti).style.display = 'none'; chStyleOff(ti);}", tHide)
}

function hdTBL(name)
{
  ts = '-';   th = name;  
  aq = getarr(name,1,3);
  clearTimeout(ttms);
  clearTimeout(ttmh);
  ttmh = setTimeout("if(ts != th){ for (i = 0; i < aq.length; i++){document.all(aq[i]).style.display = 'none'; chStyleOff(aq[i]);}; if(th!=ti && ti!='-' && ti.length <= th.length){document.all(ti).style.display = 'none'; chStyleOff(ti);} };", tHide)
}

function chStyleOn(name)
{
  td1 = "i"+name;
  td2 = "t"+name;
  td1bgOn = '#FFFFFF url(/files/ptl/css/itvb.gif) no-repeat center center'; 
  td1bdOn = '0px'; 
  td2bgOn = '#FFFFFF url(/files/ptl/css/bgtvmson.png) repeat-y'
  document.all(td1).style.background = td1bgOn; 
  document.all(td1).style.borderRight = td1bdOn; 
  document.all(td2).style.background = td2bgOn; 

}


function chStyleOff(name)
{
  td1 = "i"+name;
  td2 = "t"+name;
  td1bgOff = '#F1F1F1 url(/files/ptl/css/itv.gif) no-repeat center center';
  td1bdOff = '#D4D4D4 solid 1px'; 
  td2bgOff = '#FFFFFF';
  td2clOff = '#ACB4B6';
  document.all(td1).style.background = td1bgOff; 
  document.all(td1).style.borderRight = td1bdOff; 
  document.all(td2).style.background = td2bgOff; 
  document.all(td2).style.color = td2clOff; 
}

function chBgOn(name)
{
  md1 = "j"+name;
  md2 = "r"+name;
  md1bgOn = '#FFFFFF url(/files/ptl/css/itvb.gif) no-repeat center center'; 
  md2bgOn = '#FFFFFF';
  document.all(md1).style.background = md1bgOn; 
  document.all(md2).style.background = md2bgOn; 

}

function chBgOff(name)
{
  md1 = "j"+name;
  md2 = "r"+name;
  mdbgOff = '#F0F0F0';
  document.all(md1).style.background = mdbgOff; 
  document.all(md2).style.background = mdbgOff; 
}

//-->

