// Requires: "title" html element contains title 
function show_footer( url, 
                prevUrl, prevTitle, prevDate,
                nextUrl, nextTitle, nextDate ) {

  var mostRecentTitle="Governor Walker visits Farmer Brown";
  var mostRecentUrl="http://faux-news.com/stories/2011/03/07/";

  var title = document.getElementById( "title" ).innerHTML;
  title = title.replace(/"/g,"'");

  var style="font-family: sans-serif; font-size: 10; color: rgb(255,76,76);";

  var text = "<div style=\"" + style + "\">";

  text += "<a href=\"mailto:?subject='"
          + title
          + "'&amp;body=I liked this: "
          + url
          + "\"><img src=\"/images/mail_it_80x15.gif\"></a>";

  text += " <a href=\"http://digg.com/submit?phase=2"
          + "&url=" + escape(url)
          + "&title=" + escape(title)
          + "&bodytext="
          + "&topic=\"politics\">"
          + "<img src=\"/images/recommend_digg_80x15.gif\".</a>";

  text += "<table style=\"" + style + "\">";

  text += "<tr><td span=3>";
  text += "</td></tr>";

  if ( mostRecentTitle != title ) {  // Not the most recent story?
    text += "<tr><td><strong>Current story:</strong></td><td><a href=\""
         + mostRecentUrl
         + "\">"
         + mostRecentTitle
         + "</a></td></tr>";
  }
  else if ( url != location.href ) { // Most recent story on the main page?
    text +="<tr><td><strong><a href=\"" + url + "\">Permanent link</a></strong></td></tr>";
  }

  if ( null != prevUrl ) {
    text += "<tr><td><strong>Previous story:</strong></td><td><a href=\""
         + prevUrl
         + "\">"
         + prevTitle
         + "</a> (" + prevDate + ")</td></tr>";
  }

  if ( null != nextUrl ) {
    text += "<tr><td><strong>Next story:</strong></td><td><a href=\""
         + nextUrl
         + "\">"
         + nextTitle
         + "</a> (" + nextDate + ")</td></tr>";
  }

  text += "</table>";
  text += "</div>";

  document.getElementById( "footer" ).innerHTML = text;
}


