var rpHideTimeOut, rpLastShowNode;

 

function rpDownOneMenu(id) {

  var item = rpGetElementById(id);

  if (!item) return false;

  //var stateDisplay = item.style.display=='' || item.style.display=='block'
  // ? false : true;

  //rpShowOrHide(id, stateDisplay);

  rpShowOrHide(id, 'true');

  item.style.zIndex = 111;

  return false;

}

function rpShowOrHide(id, to) {

  var item = rpGetElementById(id);

  if(rpLastShowNode && item != rpLastShowNode){

    rpLastShowNode.style.display = 'none';

  }

  rpLastShowNode = item;

  if (item && item.style){

    if(item.style.display == 'block'){

      item.style.display = 'none';

      document.getElementById('hide_me').style.display = '';

    }else{

      item.style.display = to ? 'block' : 'none';

      if (document.getElementById('hide_me'))

      document.getElementById('hide_me').style.display = to ? 'none' : '';

    }

  }

}

 

function rpGetElementById(id) {

  return document.all ? document.all[id] : document.getElementById(id);

}

 

function rpSetTimeOutDelay(id) {

  rpHideTimeOut = window.setTimeout("rpShowOrHide('"+id+"', false);", 500);

}

function rpClearTimeOutDelay() {

  window.clearTimeout(rpHideTimeOut);

}

 

function rpInitPanel() {

  var rSource = '';

  rSource += "<div onmouseover='rpClearTimeOutDelay()' onmouseout='rpSetTimeOutDelay(\"rpPublish\")'  class=\"rPanelMenu\" id='rpPublish' style=\"z-index:11;display:none;\">";

  rSource += "<a href='http://planet.park.rambler.ru/'>111</a>";

  rSource += "<a href='http://foto.park.rambler.ru/'>222</a>";

  rSource += "<a href='http://vision.park.rambler.ru/'>3333</a>";

  rSource += "<a href='http://groups.park.rambler.ru/'>4444</a>";

  rSource += "<a href='http://mail.rambler.ru/'>5555</a>";

  rSource += "</div>";

  rSource += "<a href=\"#\" onClick=\"return rpDownOneMenu('rpPublish');\">123 &darr;</a></li>";

  document.write(rSource);

}

