function showframe()
{
  if (self != top)
    top.location = self.location;
  else
  {
    var pagecode=window.location.href;
    var sep = "?";
    var i = pagecode.lastIndexOf(sep);

    if (i <= 0)
      i = pagecode.lastIndexOf(sep = "#");

    if (i>0)
      pagecode = pagecode.substr(i+1);
    else
       pagecode = "home.htm";
    if (pagecode)
       window.frames['content'].location.replace(pagecode);
  }
}

function fixlinks()
{
  /* Improve site navigation for Javascript browsers by making refresh() work nicely even though
     site is framed */
  var el,i;
  var sep='?';
  /* Test below is intended to pick out IE4, which does not like ? in our URL for some reason.
     # works nicely in IE but not Mozilla, which does not fire onload event if top url changes but
     document is same. ? should work in any browser as it looks like a query and should force a server trip
  */
      
  if (document.all && !document.getElementById) 
    sep = '#';
  for (i = 0; i < document.links.length;i++)
  {
    el = document.links[i];
    if (el.target && el.target=="content")
    {
      el.href = "index.html" + sep + el.href;
      el.target = "_top";
    }
   }
  showframe();
}
