/* This function shows the page footer for the PeLuAk web pages.
*/
function showPageFooter()
{
  var     m_dtCurrentDate = new Date();
  var     m_dtLastUpdated = new Date(document.lastModified);
  var     m_iLastUpdatedMonth = (m_dtLastUpdated.getMonth() + 1);
  var     m_iLastUpdatedDate = m_dtLastUpdated.getDate();
  var     m_sLastUpdatedMonth = "";
  var     m_sLastUpdatedDate = "";
  var     m_SCurrentLang = "SE";
  var     m_sFileName;
  var     m_sPageWithoutLang;
  var     m_sPageWithLangSE;
  var     m_sPageWithLangEN;
  var     m_sSearch;
  var     m_sHash;

  // The file name is retrieved
  m_sFileName = retrieveFileName();
  
  // The language is retrieved from the page ------------------------------------  
  m_SCurrentLang = retrieveLanguage(m_sFileName);
  
  // The page without the language code is retrieved ---------------------
  m_sPageWithoutLang = retrievePageName(m_sFileName);
  
  if (m_sPageWithoutLang == "index")
  {
    m_sPageWithLangSE = m_sPageWithoutLang + ".html";
  }
  else
  {
    m_sPageWithLangSE = m_sPageWithoutLang + "_SE" + ".html";
  }
  m_sPageWithLangEN = m_sPageWithoutLang + "_EN" + ".html";

  m_sSearch = location.search;
  m_sHash = location.hash;
  
  m_sPageWithLangSE = m_sPageWithLangSE + m_sSearch + m_sHash;
  m_sPageWithLangEN = m_sPageWithLangEN + m_sSearch + m_sHash;

  // The dates are formatted ----------------------------------------------------
  if (m_iLastUpdatedMonth < 10)
  {
    m_sLastUpdatedMonth = "0" + m_iLastUpdatedMonth;
  }
  else
  {
    m_sLastUpdatedMonth = m_iLastUpdatedMonth;
  }
  
  if (m_iLastUpdatedDate < 10)
  {
    m_sLastUpdatedDate = "0" + m_iLastUpdatedDate;
  }
  else
  {
    m_sLastUpdatedDate =  m_iLastUpdatedDate;
  }
  
  // The page footer is written
  document.write('<hr size="4" />');
  document.write('<table class="table_100">');
  document.write('<tr>');
  document.write('<td>');

  // The updated date is shown
  document.write('<div class="page_footer">');

  //if (m_SCurrentLang == "SE")
  //{
  //  document.write('Senast uppdaterad: ');
  //}
  //else
  //{
  //  document.write('Last updated: ');
  //}
  //document.write(retrieveDateFormatted(m_dtLastUpdated.getFullYear().toString() + m_sLastUpdatedMonth + m_sLastUpdatedDate, m_SCurrentLang));
  
  // The copyright and mail address are shown
  //document.write('<br/>');
  document.write('Copyright &copy; 2008 - '
                 + m_dtCurrentDate.getFullYear()
                 + ', PeLuAk AB');
  if (m_SCurrentLang == "SE")
  {
    document.write(' - Ansvarig utgivare: Peter Lundin, PeLuAk AB');
  }
  document.write(', e-mail: ');
  mailTo('peter.lundin', 'peluak.se', 'Peter Lundin');
  
  document.write('<br/>');

  // The toggle between english and swedish is shown
  if (m_SCurrentLang == "SE")
  {
    document.write('<a href=');
    document.write(m_sPageWithLangEN);
    document.write('>Click here or on the British flag to view the site in English.</a>');

  }
  else
  {
    document.write('<a href=');
    document.write(m_sPageWithLangSE);
    document.write('>Klicka h&auml;r eller p&aring; den svenska flaggan f&ouml;r att se sidorna p&aring; svenska.</a>');

  }
  
  document.write('</div>');
  document.write('</td>');
  document.write('<td>');
  // The W3C validation images are shown
  document.write('<div class="ta_right">');
  document.write('<img src="images/valid-xhtml10-blue.png" alt="These pages are successfully checked as XHTML 1.0 Transitional" /></a>');
  document.write('<img src="images/vcss-blue.gif" alt="These pages validates as CSS level 2.1" /></a>');
  document.write('</div>');
  document.write('</td>');
  document.write('</tr>');
  document.write('</table>');

}
