
var d = document, w = window;

function Init() {}

function get(Id)
{
  if (d.getElementById(Id)) return d.getElementById(Id); else return false;
}

function showSearchRulesBlock()
{
	var modalWin = showModalDialog('/search_rules.php', '', 'dialogHeight:350px; dialogWidth:500px; resizable:no; status:no');
    return false;
}

function changeVisibility(id)
{
    obj = get(id);
    if (obj.style.display=="none") obj.style.display="block"; else obj.style.display="none";
    return false;
}


function clickLayer(lay, type)
{
  if (get(lay).className=="layA" && type!="active")
  {
    get("searchParam").className = "lay";
    get("searchRule").className = "lay";
    get("searchRest").className = "lay";
    get("divParam").style.display = "none";
  } else {
    if (lay=="searchParam")
    {
      get("searchParam").className = "layA";
      get("searchRule").className = "layUA";
      get("searchRest").className = "layUA";
      get("divParam").style.display = "block";
    } else {
      get("searchParam").className = "layUA";
      get("searchRule").className = "layA";
      get("searchRest").className = "layUA";
      get("divParam").style.display = "none"
    }
  }
  return false;
}

function clickAbbrev()
{
  if (get("titleAbbrev").className=="layAW")
  {
    get("titleAbbrev").className="layW"
    get("restAbbrev").className="layW"
    //get("restAbbrev2").className="layW"
    get("divAbbrev").style.display = "none";
  } else {
    get("titleAbbrev").className="layAW"
    get("restAbbrev").className="layUAW"
    //get("restAbbrev2").className="layUAW"
    get("divAbbrev").style.display = "block";
  }
  return false;
}

function showSearchRules(id) 
{
  obj = get(id);
  if (obj.style.display=="none") obj.style.display="block"; else obj.style.display="none";
 return false;
}
