function get_cookie(name) 
{
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) 
  {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } 
  else
  {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) end = dc.length;
  var data = unescape(dc.substring(begin + prefix.length, end));
  begin = data.indexOf(",")+1;
  end   = data.length;
  return data.substring(begin, end);
}

function reload_page(id)
{
    var dh = document.location.href;
    var hash = dh.indexOf("#");
    if (hash == -1)
    {
        document.location.href = dh;
    }
    else
    {
        var dh2 = dh.substring(0, hash);
        var dh3 = dh.substring(hash+1);
        document.location.href = dh2 + '&' + id + '=1#' + dh3;
    }
}

function set_display(id, what)
{
    if (document.getElementById) 
    {
        if (document.getElementById(id).style.display) 
        {
             document.getElementById(id).style.display = what;
        }
    } 
}
function show(id1)
{
    set_display(id1, "block");
}
function hide(id2)
{
    set_display(id2, "none"); 
}
function show_hide(id1, id2)
{
    show(id1);
    hide(id2);
}

function scroll_up()
{
     window.scrollBy(0, -20);
}
