/***************************************************************************/
/*                                                                         */
/* X2 Editor common JavaScript header code                                 */
/*                                                                         */
/* Written by B. Thompson, July 18, 1999                                   */
/* Updated for local execution (backslashes), 02/10/31                     */
/* Switch from GIFs to tabbed pane for header, May 27, 2004                */
/* Support Mozilla and Opera browsers, May 6, 2005                         */
/*                                                                         */
/***************************************************************************/

<!-- Hide the script from old browsers --
var browser = 0;                       /* browser type                     */

/***************************************************************************/
/*                                                                         */
/* Highlight the current image by replacing it with a similar version.  No */
/* longer used.                                                            */
/*                                                                         */
/***************************************************************************/

function glow (imagename, cacheimage)
{
  document.images[imagename].src = eval(cacheimage + ".src");
}


/***************************************************************************/
/*                                                                         */
/* Display the normal image for the link.  No longer used.                 */
/*                                                                         */
/***************************************************************************/

function noglow (imagename, cacheimage)
{
  document.images[imagename].src = eval(cacheimage + ".src");
}


/***************************************************************************/
/*                                                                         */
/* Set up a table to display links as pictures.  Only used for Netscape    */
/* browser                                                                 */
/*                                                                         */
/***************************************************************************/

function loadPageGif (pageName, baseGif, altTitle, altText)
{
  var currPage = document.URL
  var lastSlash = currPage.lastIndexOf("/")
  var lastBSlash = currPage.lastIndexOf("\\")
  if (lastBSlash > lastSlash)
    {
      lastSlash = lastBSlash
    }
  currPage = currPage.substring(lastSlash + 1, lastSlash + 50)
  document.write('<TD VALIGN="TOP">')
  if (currPage == pageName)
    {
      document.write('<A href="' + pageName)
      document.write('" onmouseover="drc(' + "'" + altText + "', '" + altTitle + "')" + '"')
      document.write('onmouseout="nd()">');
      document.write(' <img border=0 align=top src="' + baseGif + 'b.gif"')
    }
  else
    {
      document.write('<A href="' + pageName)
      document.write('" target="_top"')
      document.write(' onmouseover="drc(' + "'" + altText + "', '" + altTitle + "')" + '"')
      document.write('onmouseout="nd()">');
      document.write(' <img border=0 align=top src="' + baseGif + '.gif"')
    }
  document.write(' name="' + baseGif + '"></a></TD>')
}


/***************************************************************************/
/*                                                                         */
/* Create the HTML necessary for a tabbed display effect.  The current     */
/* page will be highlighted differently than other tabs.                   */
/*                                                                         */
/* Written by B. Thompson, May 27, 2004                                    */
/*                                                                         */
/***************************************************************************/

function loadPageTab (pageName, baseGif, tabText, altTitle, altText)
{
  if (browser == 1)
    {                   /* Netscape doesn't support background images in TD*/
      loadPageGif(pageName, baseGif, altTitle, altText)
      return;
    }

  var thisPage = 0
  var currPage = document.URL
  var lastSlash = currPage.lastIndexOf("/")
  var lastBSlash = currPage.lastIndexOf("\\")

  if (lastBSlash > lastSlash)
    {
      lastSlash = lastBSlash
    }
  currPage = currPage.substring(lastSlash + 1, lastSlash + 50)

  if ((pageName == "x2docContents.htm")
   && ((currPage == "x2ContentsHdr.htm") || (currPage == "x2IndexHdr.htm")))
    {
      thisPage = 1
    }
  else if (currPage == pageName)
    {
      thisPage = 1
    }

  if (thisPage == 1)
    {
      document.write('<td><img src="tableftsel.jpg"></td>')
      document.write('<td background="tabfacesel.jpg" nowrap>')
      document.write('&nbsp;&nbsp;&nbsp;<a href="' + pageName + '"')
      document.write('onmouseover="drc(' + "'" + altText + "', '" + altTitle + "')" + '"')
      document.write('onmouseout="nd()">' + tabText + '</a>&nbsp;&nbsp;&nbsp; </td>')
      document.write('<td><img src="tabrightsel.jpg"></td>')
    }
  else
    {
      document.write('<td><img src="tableft.gif"></td>')
      document.write('<td background="tabface.gif" nowrap>')
      document.write('&nbsp;&nbsp;&nbsp;<a href="' + pageName + '"')
      document.write('target="_top"')
      document.write('onmouseover="drc(' + "'" + altText + "', '" + altTitle + "')" + '"')
      document.write('onmouseout="nd()">' + tabText + '</a>&nbsp;&nbsp;&nbsp; </td>')
      document.write('<td><img src="tabright.gif"></td>')
    }
}                                            /* End of loadPageTab function*/



/***************************************************************************/
/*                                                                         */
/* No longer used                                                          */
/*                                                                         */
/***************************************************************************/

function oldGifTable ()
{
  document.write('<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">')
  document.write('<TR>')

  loadPageGif("x2main.shtml", "home",    "Home Page", "updated 09/04/11")
  loadPageGif("x2chg281.htm", "chglast", "Changes in Latest Version", "updated 08/05/19")
  loadPageGif("x2downld.htm", "dl",      "Download Page", "updated 09/04/11")
  loadPageGif("x2docContents.htm", "doc","Online Documentation", "updated 08/05/19")
  loadPageGif("x2sub.htm",    "notify",  "Change Notification Page", "Register/UnRegister")
  loadPageGif("x2links.htm",  "links",   "Links and Acknowledgements", "updated 05/04/23")
  document.write('</TR>')
  document.write('</TABLE>')
}


/***************************************************************************/
/*                                                                         */
/* Create a table that allows re-direction to one of our pages.  Each      */
/* table column is drawn graphically and does special things when the      */
/* cursor hovers over it.  This table is intended to be displayed at the   */
/* top of a page.                                                          */
/*                                                                         */
/***************************************************************************/

function gifTable ()
{
  if (navigator.userAgent.indexOf("Firefox") != -1)
    browser = 3;                                                 /* Mozilla*/
  else if (navigator.userAgent.indexOf("Opera") != -1)
    browser = 4;                                                   /* Opera*/
  else if (navigator.appName == "Netscape")
    browser = 1;

  document.write('<table border=0 cellpadding=0 cellspacing=0 width=100%>')
  document.write('<TR>')

  loadPageTab("x2main.shtml",      "home",    "Home",          "Home Page", "updated 09/04/11")
  loadPageTab("x2chg281.htm",      "chglast", "Changes",       "Changes in Latest Version", "updated 08/05/19")
  loadPageTab("x2downld.htm",      "dl",      "Download",      "Download Page", "updated 09/04/11")
  loadPageTab("x2docContents.htm", "doc",     "Documentation", "Online Documentation", "updated 08/05/19")
  loadPageTab("x2sub.htm",         "notify",  "Notify",        "Change Notification Page", "Register/UnRegister")
  loadPageTab("x2links.htm",       "links",   "Links",         "Links and Acknowledgements", "updated 05/04/23")

  document.write('<td background="tabuline.jpg" width=100%>&nbsp;</td>')
  document.write('</tr>')
  document.write('</table>')
}


/***************************************************************************/
/*                                                                         */
/* Build a simpler table for display at the bottom of a page.  No          */
/* graphics, but the included links are the same as in the more            */
/* complicated table above.                                                */
/*                                                                         */
/***************************************************************************/

function linktable ()
{
  document.write('<CENTER>')
  document.write('<TABLE BORDER=5 CELLSPACING=5 CELLPADDING=5>')
  document.write('<TR>')
  document.write('<TD><A HREF="x2main.shtml">Home Page</A>&nbsp;</TD>')
  document.write('<TD><A HREF="x2chg281.htm">Version 2.08.1 Changes</A>&nbsp;</TD>')
  document.write('<TD><A HREF="x2downld.htm">Download</A>&nbsp;</TD>')
  document.write('<TD><A HREF="x2doc.htm">Documentation</A>&nbsp;</TD>')
  document.write('<TD><A HREF="x2links.htm">Links</A>&nbsp;</TD>')
  document.write('</TR>')
  document.write('</TABLE>')
  document.write('</CENTER>')
}


gifTable();

//-->
