function email(user, site, label)
{
  document.write( '<a href=\"mailto:' + user + '@' + site + '\">' );
  document.write( label + '</a>' );
}

function email(user, site, subject, label)
{
  document.write( '<a href=\"mailto:' + user + '@' + site + '?subject=' + subject + '\">' );
  document.write( label + '</a>' );
}

function emailAutoLabel(user, site, subject)
{
  document.write( '<a href=\"mailto:' + user + '@' + site + '?subject=' + subject + '\">' );
  document.write( user + '@' + site + '</a>' );
}

function showdate()
{
  revdate = new Date(document.lastModified);
  year = revdate.getYear();
  if ( year < 1900 )
  {
    year = year + 1900;
  }
  month = revdate.getMonth() + 1;
  day = revdate.getDate();
  hour = revdate.getHours();
  min = revdate.getMinutes();
  sec = revdate.getSeconds();

  hourPad = new String("");
  minutePad = new String("");
  secondPad = new String("");
  if (hour < 10)
  {
    hourPad = new String("0");
  }
  if (min < 10)
  {
    minutePad = new String("0");
  }
  if (sec < 10)
  {
    secondPad = new String("0");
  }
  document.write("Last modified " + day + "/" + month + 
  "/" + year + " " + hourPad + hour + ":" + minutePad + min + ":" + secondPad + sec + "</span>");
}

function bannerImage()
{
  bannerImagePath( './images' );
}

function bannerImagePath( dir )
{
  document.write( '<img src="' + dir + '/banner.gif" alt="Ashley Arnold (http://ashleyarnold.com.au)" border="0">' );
}

function showMenu()
{
  showMenuPath( "." );
}

function showMenuPath( dir )
{
  document.write('<a href="' + dir + '/index.html">Home</a>');
  document.write('<a href="' + dir + '/news.html">News</a>');
  document.write('<a href="' + dir + '/publications.html">Publications</a>');
  document.write('<a href="' + dir + '/stories.html">Stories</a>');
  document.write('<a href="' + dir + '/articles.html">Articles</a>');
  document.write('<a href="' + dir + '/reviews.html">Reviews</a>');
  document.write('<a href="' + dir + '/feedback.html">Feedback</a>');
  document.write('<a href="' + dir + '/links.html">Links</a>');
  document.write('<a href="' + dir + '/about.html">About</a>');
  document.write('<p class="footer"><a href="http://aarnold.livejournal.com">Go to LiveJournal</a></p>');
}

function showRightColumnSummary( 
  title, written, inspiration, dedication,
  style, audience, notes, comments )
{
  showRightColumnSummaryPath2( ".", title, written, inspiration, dedication, "Style", style, audience, notes, comments );
}

function showRightColumnSummaryPath(
  path, title, written, inspiration, dedication,
  style, audience, notes, comments )
{
  showRightColumnSummaryPath2( path, title, written, inspiration, dedication, "Style", style, audience, notes, comments );
}

function showRightColumnSummary2(
  title, written, inspiration, dedication,
  styleLabel, style, audience, notes, comments )
{
  showRightColumnSummaryPath2( ".", title, written, inspiration, dedication, styleLabel, style, audience, notes, comments );
}

function showRightColumnSummaryPath2(
  path, title, written, inspiration, dedication,
  styleLabel, style, audience, notes, comments )
{
  if ( title != "" ) 
  {
    document.write('<p class="summary-title">Title');
    document.write('<br>');
    document.write('<span class="summary-field">' + title + '</span></p>');
  }
  if ( written != "" ) 
  {
    document.write('<p class="summary-title">Written');
    document.write('<br>');
    document.write('<span class="summary-field">' + written + '</span></p>');
  }
  if ( inspiration != "" ) 
  {
    document.write('<p class="summary-title">Inspiration');
    document.write('<br>');
    document.write('<span class="summary-field">' + inspiration + '</span></p>');
  }
  if ( dedication != "" ) 
  {
    document.write('<p class="summary-title">Dedication');
    document.write('<br>');
    document.write('<span class="summary-field">' + dedication + '</span></p>');
  }
  if ( style != "" ) 
  {
    document.write('<p class="summary-title">' + styleLabel);
    document.write('<br>');
    document.write('<span class="summary-field">' + style + '</span></p>');
  }
  if ( audience != "" ) 
  {
    document.write('<p class="summary-title">Target Audience');
    document.write('<br>');
    document.write('<span class="summary-field">' + audience + '</span></p>');
  }
  if ( notes != "" ) 
  {
    document.write('<p class="summary-title">Editorial Notes');
    document.write('<br>');
    document.write('<span class="summary-field">' + notes + '</span></p>');
  }
  if ( comments != "" ) 
  {
    document.write('<p class="summary-title">Comments');
    document.write('<br>');
    document.write('<span class="summary-field">' + comments + '</span></p>');
  }
}

function showFooter( year, user, site, subject, label )
{
  showFooterPath( ".", year, user, site, subject, label );
}

function showFooterPath( path, year, user, site, subject, label )
{
  document.write('<div id="footer-wrapper">');
  document.write('<div id="footer">');
  document.write('<p class="footer">');
  document.write('Copyright &#169; ' + year + ' Ashley Arnold.&nbsp;&nbsp;');
  showdate();
  document.write('<br/>');
  document.write('<p class="footer"><a href="' + path + '/index.html">Home</a>');
  if ( user != "" )
  {
    document.write(' | ');
    email( user, site, subject, label );
  }
  document.write('</p>');
  document.write('</p>');
  document.write('</div>');
  document.write('</div>');
}

