function blockquotes() {
  if (document.getElementsByTagName && document.createTextNode) {
    var quotes = document.getElementsByTagName("blockquote");
    for (var i=0; i<quotes.length; i++) {
      var source = quotes[i].getAttribute("cite");
      if (source) {
        var text = document.createTextNode("source");
        var link = document.createElement("a");
        var para = document.createElement("p");
        link.setAttribute("href",source);
        link.appendChild(text);
        para.appendChild(link);
        para.className = "attribution";
        quotes[i].appendChild(para);
      }
    }
  }
}

window.onload = blockquotes;
