/**
 * Передача урла кнопке
 */
function GoButton($s)
{
  location.href=$s;
}

/**
 * Получение значения элемента по ID
 */

function GetVal($id) {
  if (typeof $id == 'string') {
    return document.getElementById($id).value;
  }
  return null;
}

/**
 * Передача урла кнопке
 */
function GoButtonParam($s,$p1,$p2,$p3,$p4)
{
  var $a;
    $a = $s;
if ($p1 != null && GetVal($p1) != null) {
      $a = $a+'&'+$p1+'='+GetVal($p1);
   }
if ($p2 != null && GetVal($p2) != null) {
      $a = $a+'&'+$p2+'='+GetVal($p2);
   }
if ($p3 != null && GetVal($p3) != null) {
      $a = $a+'&'+$p3+'='+GetVal($p3);
   }
if ($p4 != null && GetVal($p4) != null) {
      $a = $a+'&'+$p4+'='+GetVal($p4);
   }
  location.href=$a;
}

/**
 * Обработчик открывающегося меню
 */
function clickHandler(evt) { 
  var targetId, srcElement, targetElement; 

  srcElement = evt ? evt.target : window.event.srcElement;

  if (srcElement.className == "blockmenu") { targetId = srcElement.id + "details"; 
    targetElement = document.getElementById(targetId);
    if (targetElement.style.display == "none") { targetElement.style.display = ""; 
    } else { 
      targetElement.style.display = "none"; 
    } 
  }
} 

