
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 showSearchRules(id) 
{
  obj = get(id);
  if (obj.style.display=="none") obj.style.display="block"; else obj.style.display="none";
 return false;
}


/** Show bookmarks */
function showBookmarks()
{
    d.write('<a rel="nofollow" target="_blank" title="Yahoo.Закладки" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(d.title)+'"><img src="/images/bkm_yahoomyweb.png" alt="Yahoo.Закладки" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="Яндекс.Закладки" href="http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&lurl='+encodeURIComponent(location.href)+'&lname='+encodeURIComponent(d.title)+'"><img src="/images/bkm_yandex.gif" alt="Яндекс.Закладки" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="закладки Google" href="http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(d.title)+'"><img src="/images/bkm_google.png" alt="закладки Google" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="Technorati" href="http://technorati.com/faves?add='+encodeURIComponent(location.href)+'"><img src="/images/bkm_technorati.png" alt="Technorati" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="добавить в закладки на memori" href="http://memori.ru/link/?sm=1&u_data[url]='+encodeURIComponent(location.href)+'&u_data[name]='+encodeURIComponent(d.title)+'"><img src="/images/bkm_memori.gif" alt="добавить в закладки на memori" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="добавить в закладки на БобрДобр" href="http://bobrdobr.ru/addext.html?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(d.title)+'"><img src="/images/bkm_bobr.gif" alt="добавить в закладки на БобрДобр" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="добавить страницу к Мистеру Вонгу" href="http://www.mister-wong.ru/index.php?action=addurl&bm_url='+encodeURIComponent(location.href)+'&bm_description='+encodeURIComponent(d.title)+'"><img src="/images/bkm_wong.gif" alt="добавить страницу к Мистеру Вонгу" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="добавить в закладки на digg" href="http://digg.com/submit?url='+encodeURIComponent(location.href)+'"><img src="/images/bkm_digg.gif" alt="добавить в закладки на digg" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="добавить в закладки на del.isio.us" href="http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(d.title)+'"><img src="/images/bkm_delicious.gif" alt="добавить в закладки на memori" border="0"></a>&nbsp;')
    d.write('<a rel="nofollow" target="_blank" title="закладки МоёМесто" href="http://moemesto.ru/post.php?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(d.title)+'"><img src="/images/bkm_moemesto.gif" alt="закладки МоёМесто" border="0"></a>&nbsp;')
}