function addExpandAllLink() {
  var expandAllDiv, expandAllLink, faq;

  expandAllDiv = document.createElement("div");
  expandAllDiv.setAttribute("id", "expandAll");

  expandAllLink = document.createElement("a");
  expandAllLink.setAttribute("href", "#");
  expandAllLink.setAttribute("id", "expandAllLink");
  expandAllLink.appendChild(document.createTextNode("Wyświetl wszystkie"));

  expandAllDiv.appendChild(expandAllLink);

  expandAllLink.onclick = function() {
    var faqList, answers;    
    faqList = document.getElementById("faq");
    answers = faqList.getElementsByTagName("dd");

    if (this.innerHTML == "Wyświetl wszystkie") {
    for (i = 0; i < answers.length; i++) {
      answers[i].style.display = 'block';
    }
    this.innerHTML = "Ukryj wszystkie";
    }
    else {
      for (i = 0; i < answers.length; i++) {
        answers[i].style.display = 'none';
      }
      this.innerHTML = "Wyświetl wszystkie";
    }
    return false;
  };

  faq = document.getElementById("faq");
  faq.insertBefore(expandAllDiv, faq.firstChild);
}
