//common.js - functions which can be included in the head of any page

var browser = 0, vers = parseInt(navigator.appVersion)

function sniff(above) {
  //link to browser-specific style sheet if reqd
  //'above' indicates that these sheets are in the dirctory above the current one
  if (navigator.appName.indexOf("WebTV") != -1) browser = "webtv"
  //WebTV must be eliminated before testing for any other browser
  else if (navigator.appName.indexOf("Explorer") != -1 
    || navigator.appName.indexOf("AOL") != -1) { if (vers>=4) browser = "good" }
  else if (navigator.appName.indexOf("Netscape") != -1) browser = vers<5?"n4":"good"
  else if (navigator.appName.indexOf("Mozilla") != -1) browser = "good"

  if (browser) {
    document.write('<link rel="StyleSheet" type="text/css" href="')
    if (above) document.write('../')
    document.writeln(browser, '.css" />')
  }
}


function navLinks() {
  //generate links after [Home page] on main navigation bar
  document.write(
    '[<a href="diary.htm" title="Diary">Diary</a>]\n',
    '[<a href="trib.htm" title="The Tribulations of Liu">The&nbsp;Tribulations&nbsp;of&nbsp;Liu</a>]\n',
    '[<a href="spell.htm" title="The Opening Spell">The&nbsp;Opening&nbsp;Spell</a>]\n',
    '[<a href="kai_lung.htm" title="The Kai Lung Stories of Ernest Bramah">Kai&nbsp;Lung</a>]\n',
    '[<a href="sing_tsung.htm" title="The Story of Sing Tsung and the Exponent of Dark Magic">The&nbsp;Story&nbsp;of&nbsp;Sing&nbsp;Tsung</a>]\n',
    '[<a href="tellafriend.htm" title="Tell a Friend About This Site">Tell&nbsp;a&nbsp;Friend</a>]\n',
    '[<a href= "http://pub5.bravenet.com/guestbook/show.php?usernum=396380355&amp;cpv=1" title="Guestbook">Guestbook</a>]\n',
    '[<a href="links.htm" title="Links to other sites">Links</a>]\n',
    '[<a href="rings.htm" title="Webrings">Webrings</a>]\n')
}