function show_bf(id)
{
  if(!document.getElementById("bform"))
  {
  block = document.createElement("form");
    block.setAttribute("id", "bform");
    block.setAttribute("action", "./index.php?page=13&id=" + id);
    block.setAttribute("method", "post");

  form = document.createElement("select");
    form.setAttribute("class", "input");
    form.setAttribute("width", "15px");
    form.setAttribute("name", "bewertung");

  op1 = document.createElement("option");
    op1.setAttribute("value", "1");
    op1.appendChild(document.createTextNode("0"));
  op2 = document.createElement("option");
    op2.setAttribute("value", "2");
    op2.appendChild(document.createTextNode("1"));
  op3 = document.createElement("option");
    op3.setAttribute("value", "3");
    op3.appendChild(document.createTextNode("2"));
  op4 = document.createElement("option");
    op4.setAttribute("value", "4");
    op4.appendChild(document.createTextNode("3"));
  op5 = document.createElement("option");
    op5.setAttribute("value", "5");
    op5.appendChild(document.createTextNode("4"));
  op6 = document.createElement("option");
    op6.setAttribute("value", "6");
    op6.appendChild(document.createTextNode("5"));

  button = document.createElement("input");
    button.setAttribute("class", "input");
    button.setAttribute("type", "submit");
    button.setAttribute("value", "Ok");
    button.setAttribute("style", "margin-left:2px");

  form.appendChild(op1);
  form.appendChild(op2);
  form.appendChild(op3);
  form.appendChild(op4);
  form.appendChild(op5);
  form.appendChild(op6);

  block.appendChild(document.createElement("br"));
  block.appendChild(form);
  block.appendChild(button);

  bf = document.getElementById("bf");
    bf.appendChild(block);
  }
  else
  {
  document.getElementById("bf").removeChild(document.getElementById("bform"));
  }
}

function show_nf(id)
{
  if(!document.getElementById("nform"))
  {
  block = document.createElement("form");
    block.setAttribute("id", "nform");
    block.setAttribute("action", "./index.php?page=13&id=" + id);
    block.setAttribute("method", "post");

  form = document.createElement("input");
    form.setAttribute("class", "input");
    form.setAttribute("width", "45px");
    form.setAttribute("name", "altname");

  button = document.createElement("input");
    button.setAttribute("class", "input");
    button.setAttribute("type", "submit");
    button.setAttribute("value", "Ok");
    button.setAttribute("style", "margin-left:2px");

  block.appendChild(document.createElement("br"));
  block.appendChild(form);
  block.appendChild(button);

  bf = document.getElementById("nf");
    bf.parentNode.insertBefore(block, document.getElementById("nf"));
  }
  else
  {
  document.getElementById("nf").parentNode.removeChild(document.getElementById("nform"));
  }
}

function show_if(id)
{
  if(!document.getElementById("iform"))
  {
  block = document.createElement("form");
    block.setAttribute("enctype", "multipart/form-data");
    block.setAttribute("id", "iform");
    block.setAttribute("action", "./index.php?page=13&id=" + id);
    block.setAttribute("method", "post");

  form = document.createElement("input");
    form.setAttribute("class", "input");
    form.setAttribute("size", "10");
    form.setAttribute("name", "image");
    form.setAttribute("type", "file");
    form.setAttribute("accept", "image/jpeg");

  button = document.createElement("input");
    button.setAttribute("class", "input");
    button.setAttribute("type", "submit");
    button.setAttribute("value", "Ok");
    button.setAttribute("style", "margin-left:2px");

  block.appendChild(document.createElement("br"));
  block.appendChild(form);
  block.appendChild(button);

  bf = document.getElementById("if");
    bf.appendChild(block);
  }
  else
  {
  document.getElementById("if").removeChild(document.getElementById("iform"));
  }
}

function show_searchform()
{
  form = document.getElementById("search_form");
  if(!form.getAttribute("style"))
  {
    form.setAttribute("style", "display:none");
  }
  else
  {
    form.removeAttribute("style");
  }
}

function show_commentform(id)
{
  if(!document.getElementById("cform"))
  {
  block = document.createElement("form");
    block.setAttribute("id", "cform");
    block.setAttribute("action", "./index.php?page=13&id=" + id);
    block.setAttribute("method", "post");

  form = document.createElement("textarea");
    form.setAttribute("class", "input");
    form.setAttribute("cols", "60");
    form.setAttribute("rows", "8");
    form.setAttribute("name", "comment");

  button = document.createElement("input");
    button.setAttribute("class", "input");
    button.setAttribute("type", "submit");
    button.setAttribute("value", "Eintragen");
    button.setAttribute("style", "margin-left:2px");

  block.appendChild(document.createElement("br"));
  block.appendChild(form);
  block.appendChild(document.createElement("br"));
  block.appendChild(button);

  bf = document.getElementById("cf");
    bf.parentNode.insertBefore(block, document.getElementById("cf"));
  }
  else
  {
  document.getElementById("cf").parentNode.removeChild(document.getElementById("cform"));
  }
}

function show_printview()
{
  window.open("./inc/php/content/merkliste_printview.php", "Einkaufszettel", "width=500,height=600,scrollbars=yes,resizable=no");
  Einkaufszettel.focus();
}