var T = ( 1 == 1 );
var t = T;
var F = ( 1 == 0 );
var f = F;
var PgNm = "";
var PgCl = "";
var PnPc = F;
var PnBn = F;
var PcBn = F;

var m2pf = "";

var dowSht = new Array( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" );
var dowLng = new Array( "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" );

var mthSht = new Array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
var mthLng = new Array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" );

var kMSperD = ( 1000 * 60 * 60 * 24 ) - 1;        // K milliseconds per Day (less one)

var tLclk = "Left click to view/print";
var tRclk = "Right click to download";

var hLclk = snr(tLclk," ","&nbsp;");
var hRclk = snr(tRclk," ","&nbsp;");

var newImg = 0;

function UserInfo()
{
  this.AppNam = navigator.appName.toLowerCase();
  this.AppVer = navigator.appVersion.toLowerCase();

  this.UsrAgt = navigator.userAgent.toLowerCase();

  this.VerMjr = parseInt(this.AppVer);
  this.VerMnr = parseFloat(this.AppVer);

  this.BrIsMZ = ( this.UsrAgt.indexOf('mozilla') > -1 && this.UsrAgt.indexOf('gecko') > -1 );
  if ( this.BrIsMZ )
  {
    this.VerMjr = 5;
    if ( this.UsrAgt.indexOf('rv:1.8.1.18') > -1 ) this.VerMnr = 5.122;
    if ( this.UsrAgt.indexOf('rv:1.8.1.17') > -1 ) this.VerMnr = 5.121;
    if ( this.UsrAgt.indexOf('rv:1.8.1.16') > -1 ) this.VerMnr = 5.120;
    if ( this.UsrAgt.indexOf('rv:1.8.1.9') > -1 )  this.VerMnr = 5.119;
    if ( this.UsrAgt.indexOf('rv:1.1.8') > -1 ) this.VerMnr = 5.118;
    if ( this.UsrAgt.indexOf('rv:1.1.7') > -1 ) this.VerMnr = 5.117;
    if ( this.UsrAgt.indexOf('rv:1.1.6') > -1 ) this.VerMnr = 5.116;
    if ( this.UsrAgt.indexOf('rv:1.1.5') > -1 ) this.VerMnr = 5.115;
    if ( this.UsrAgt.indexOf('rv:1.1.4') > -1 ) this.VerMnr = 5.114;
    if ( this.UsrAgt.indexOf('rv:1.1.3') > -1 ) this.VerMnr = 5.113;
    if ( this.UsrAgt.indexOf('rv:1.0.0') > -1 ) this.VerMnr = 5.100;
    if ( this.UsrAgt.indexOf('rv:0.9.9') > -1 ) this.VerMnr = 5.099;
    if ( this.UsrAgt.indexOf('rv:0.9.8') > -1 ) this.VerMnr = 5.098;
    if ( this.UsrAgt.indexOf('rv:0.9.7') > -1 ) this.VerMnr = 5.097;
    if ( this.UsrAgt.indexOf('rv:0.9.6') > -1 ) this.VerMnr = 5.096;
    if ( this.UsrAgt.indexOf('rv:0.9.5') > -1 ) this.VerMnr = 5.095;
    if ( this.UsrAgt.indexOf('rv:0.9.4') > -1 ) this.VerMnr = 5.094;
  }
  this.BrIsNS = ( this.BrIsMZ ? F : this.UsrAgt.indexOf('mozilla') > -1 && this.UsrAgt.indexOf('spoofer') == -1 && this.UsrAgt.indexOf('compatible') == -1 );
  this.BrIsIE = ( this.BrIsMZ || this.BrIsNS ? F : this.UsrAgt.indexOf('msie') > -1 )
  if ( this.BrIsIE )
  {
         if ( this.UsrAgt.indexOf( 'msie 8.0;'  ) > -1 ) { this.VerMjr = 8; this.VerMnr = '8.0';  }
    else if ( this.UsrAgt.indexOf( 'msie 7.0;'  ) > -1 ) { this.VerMjr = 7; this.VerMnr = '7.0';  }
    else if ( this.UsrAgt.indexOf( 'msie 6.0;'  ) > -1 ) { this.VerMjr = 6; this.VerMnr = '6.0';  }
    else if ( this.UsrAgt.indexOf( 'msie 5.5;'  ) > -1 ) { this.VerMjr = 5; this.VerMnr = '5.5';  }
    else if ( this.UsrAgt.indexOf( 'msie 5.01;' ) > -1 ) { this.VerMjr = 5; this.VerMnr = '5.01'; }
    else if ( this.UsrAgt.indexOf( 'msie 5.0;'  ) > -1 ) { this.VerMjr = 5; this.VerMnr = '5.0';  }
    else if ( this.UsrAgt.indexOf( 'msie 4.01;' ) > -1 ) { this.VerMjr = 4; this.VerMnr = '4.01'; }
    else if ( this.UsrAgt.indexOf( 'msie 4.0;'  ) > -1 ) { this.VerMjr = 4; this.VerMnr = '4.0';  }
    else if ( this.UsrAgt.indexOf( '3.02;' ) > -1 )      { this.VerMjr = 3; this.VerMnr = '3.02'; }
    else if ( this.UsrAgt.indexOf( '3.01;' ) > -1 )      { this.VerMjr = 3; this.VerMnr = '3.01'; }
    else if ( this.UsrAgt.indexOf( '3.0;'  ) > -1 )      { this.VerMjr = 3; this.VerMnr = '3.0';  }
  }

  this.OisWin = ( this.UsrAgt.indexOf("win") > -1 );
  this.OisMac = ( this.UsrAgt.indexOf("mac") > -1 );
  this.OisUnx = ( this.UsrAgt.indexOf("x11") > -1 );

  this.ScnWid = screen.width;
  this.ScnHgt = screen.height;

  this.AvlWid = undefined;
  this.AvlHgt = undefined;

  if (document.documentElement && document.documentElement.offsetHeight) // DOM1
  {
    this.AvlWid = ( window.innerWidth )  ? window.innerWidth  : document.documentElement.offsetWidth - 20 ;
    this.AvlHgt = ( window.innerHeight ) ? window.innerHeight : document.documentElement.offsetHeight - 4 ;
  }
  else if (document.body)  // IE in old mode
  {
    this.AvlWid = document.body.offsetWidth - 20;
    this.AvlHgt = document.body.offsetHeight - 4;
  }
  else if (window.innerWidth)
  {
    this.AvlWid = window.innerWidth ;
    this.AvlHgt = window.innerHeight;
  }

  this.LclDom = ( document.domain.indexOf("localhost")>=0 );

  this.DldPth = "http://" + document.domain + "/aresniagara/";
  this.BasPth = "http://" + document.domain + "/aresniagara/";

  this.IcnPth =  this.BasPth + '_img/';

  //                                    0, Tny;                       1, Sml;                       2, Med;                       3, Lrg;                                              4, Xlg;                      5, Gar
  this.DocSty = ( this.ScnWid <  640 ? "0" : ( this.ScnWid ==  640 ? "1" : ( this.ScnWid ==  800 ? "2" : ( this.ScnWid == 1024 ? "3" : ( this.ScnWid >= 1152 && this.ScnWid <= 1280 ? "4" : ( this.ScnWid > 1280 ? "5" : "2" ) ) ) ) ) )
  this.IcnSiz = ( this.ScnWid <= 800 ? 16 : ( this.ScnWid <= 1024 ? 18 : 24 ) );
  this.LgoSiz = ( this.ScnWid <= 800 ? 32 : ( this.ScnWid <= 1024 ? 48 : 64 ) );

  this.DbgAlt = true;

  return this;
}


var z0ui = new UserInfo();


function da( fnPar0 )
{
  if ( z0ui.DbgAlt )
  {
    alert( unescape( fnPar0 ) );
  }
}


function dw(c)
{
  document.writeln(c);
}


function min( v0, v1 )
{
  return ( v0 < v1 ? v0 : v1 )
}


function max( v0, v1 )
{
  return ( v0 > v1 ? v0 : v1 )
}


function snr( sW, sF, rW ) { var rT = sW; hP = rT.indexOf( sF ); while( hP > -1 && hP < rT.length ) { rT = rT.substring( 0, hP ) + rW + rT.substring( hP + sF.length, rT.length ); hP = rT.indexOf( sF ); } return rT; }


function ReplaceThisUrl(rUrl)
{
  if ( rUrl != "" )
  {
    location.replace(rUrl);
  }
}


function SelectThisUrl(sUrl)
{
  if ( sUrl != "" )
  {
    location.href = sUrl;
  }
}


function clem( m2fn, m2an, m2dn, m2st )
{
  location.href = snr("mailto:" + ( m2fn.length == 0 ? "" : m2fn + " <" ) + m2an + "@" + m2dn + ( m2fn.length == 0 ? "" : ">" ) + ( m2st.length == 0 ? "" : "?Subject=" + m2st )," ","%20" );
}


function emdw( m2st, m2dn, m2fn, m2an )
{
  dw ( ( m2an.length < 1 || m2dn.length < 1
      ? "&nbsp;"
      : "<a"
      + ( m2fn.length < 1
        ? ""
        : " title='Send email to " + m2fn + "'" )
      + ( m2fn.length < 1
        ? ""
        : " onMouseOver=\"javascript:self.status='Send email to " + m2fn + "'\""
          + " onMouseOut=\"javascript:self.status=''\"" )
          + " href=\"javascript:clem('" + m2fn + "','" + m2an + "','" + m2dn + "','" + m2st + "')\">"
          + m2fn
          + "</a>"
      )
    );
}


function emhl( m2fn, m2an, m2dn, m2st )
{
  return  m2an.length < 1 || m2dn.length < 1 ? "&nbsp;" : "<a" + ( m2fn.length < 1 ? "" : " title='Send email to " + m2fn + "'" ) + ( m2fn.length < 1 ? "" : " onMouseOver=\"javascript:self.status='Send email to " + m2fn + "'\" onMouseOut=\"javascript:self.status=''\"" ) + " href=\"javascript:clem('"+m2fn+"','"+m2an+"','"+m2dn+"','"+m2st+"')\">" + m2an + "<span class=emat>"+emat+"</span>" + m2dn + "</a>";
}


function FullName( fnPar0 )
{
  var m2fn = fnPar0;
  if ( fnPar0.length > 1 )
  {
    m2cp = m2fn.indexOf(", ");
    if( m2cp >= 0 )
    {
      m2na = m2fn.split(", ");
      m2fn = m2na[1]+" "+m2na[0];
    }
  }
  return m2fn
}

function dwem( m2fn, m2an, m2dn, m2st )
{
  dw( emhl( m2fn, m2an, m2dn, m2st ) );
}


function dwlngdte( fnPar0 )
{
  dw( LongDate( fnPar0 ) );
}

function WhatsNew( fnPar0 )
{
  dw( '<a name="' + fnPar0 + '"></a>'
    + '<table width="100%" cellspacing=0 cellpadding=0 border=0><tr class=wnut>'
    + '<td width="1%">&nbsp;' + LongDate( fnPar0 ) + '&nbsp;</td>'
    + '<td class=wnug>&nbsp;</td>'
    + '<td width="5px" align=RIGHT>&nbsp;<a href="#verytop">'
    + '<font color=WHITE><small><small>Goto&nbsp;Top</small></small></font></a>&nbsp;</td>'
    + '</tr></table>' );
}

function dwshtdte( fnPar0 )
{
  dw( ShrtDate( fnPar0 ) );
}


function LongDate( fnPar0 )
{
  var lngDte = new Date()
  lngDte.setFullYear(fnPar0.substr(0,4)-0,fnPar0.substr(5,2)-1,fnPar0.substr(8,2)-0);
  return dowLng[lngDte.getDay()] + ",&nbsp;" + mthLng[lngDte.getMonth()] + "&nbsp;" + lngDte.getDate() + ",&nbsp;" + lngDte.getFullYear()
}


function ShrtDate( fnPar0 )
{
  var shtDte = new Date()
  shtDte.setFullYear(fnPar0.substr(0,4)-0,fnPar0.substr(5,2)-1,fnPar0.substr(8,2)-0);
  return dowSht[shtDte.getDay()] + ",&nbsp;" + mthSht[shtDte.getMonth()] + "&nbsp;" + shtDte.getDate() + ",&nbsp;" + shtDte.getFullYear()
}


function LastModi()
{
  var m2lm = document.lastModified;
  if ( m2lm.length > 10 )
  {
    if ( z0ui.BrIsMZ || z0ui.BrIsNS )
    {
      var m2zl = new Date();
      m2zl.setTime( Date.parse( document.lastModified ) );
      var m2zm = 1 + m2zl.getMonth();
      var m2zd = m2zl.getDate();
      var m2zy = m2zl.getFullYear();
      var m2pm = ( m2zm < 10 );
      var m2pd = ( m2zd < 10 );
      m2zm.toString();
      m2zd.toString();
      m2zy.toString();
      m2lm = ( m2pm ? "0" : "" ) + m2zm + "/" + ( m2pd ? "0" : "" ) + m2zd + "/" + m2zy;
    }
    else
    {
      m2lm = m2lm.substring(0,10);
    }
  }
  return m2lm;
}


function d8dw( txtD8, begD8, endD8 )
{
  var d8Now = new Date();
  var d8Beg = new Date();
  var d8End = new Date();
  d8Beg.setTime( Date.parse( begD8 ) )
  d8End.setTime( Date.parse( endD8 ) )
  if( d8Now >= d8Beg && d8Now <= d8End ) dw( txtD8 );
}


function NewUntil( endNew )
{

  var dteNow = new Date();
  var dteEnd = new Date();
  dteEnd.setTime( Date.parse( endNew ) )
  if( dteNow <= dteEnd )
  {
    return NuContent();
  }
  else
    return "";
}

function NuContent()
{
  return "<img src='" + z0ui.IcnPth + "new_ani_"+newImg+".gif' "+ ( z0ui.LgoSiz == 64 ? "width=78 height=30" : "width=52 height=20" ) + " border=0 alt='new' align=absmiddle>";
}

function MenuBttn( m2pd, m2bf, m2bl, m2nw, m2bt )
{
  if( m2sb )
  {
   dw( "<tr height=4px><td></td></tr>" );
  }
  else
  {
    m2sb = T;
  }
  dw( "<tr><td class=mbtn>&nbsp;" + ( m2bf == m2pf ? "<span class=mlnk>" : "<a class=mlnk href='" + ( m2pd.length == 0 ? "" : m2pd ) + m2bf + "'" + (m2nw ? " target=_new":"") +" title='" + m2bt + "'>" ) + "&nbsp;" + m2bl + "&nbsp;" + ( m2pf == m2bf ? "</span>" : "</a>" ) + "</td></tr>" );
}


function SmllBttn( m2pd, m2bf, m2bl, m2nw, m2bt )
{
  dw( "<tr><td class=sbtn align=RIGHT valign=MIDDLE>" + ( m2pf == m2bf ? "<span class=slnk>" : "<a class=slnk href='" + ( m2pd.length == 0 ? "" : m2pd ) + m2bf + "'" + (m2nw ? " target=_new":"") +" title='" + m2bt + "'>" ) + "&nbsp;" + m2bl + "&nbsp;" + ( m2pf == m2bf ? "</span>" : "</a>" ) + "</td></tr>" );
}

function DocHeadr( par1 )
{
  m2pf = par1;

  mtUsr = "A.R.E.S. Niagara User Browser Info";
  mtErr = "Goto Error page";
  mtHom = "Goto home page";
  mtRac = "Goto R.A.C.'s A.R.E.S. sub site";

  pnUsr = "misc/userinfo.html";
  pnErr = "misc/errormsg.html";
  pnHom = "index.html";
  pnRac = "http://www.rac.ca/fieldorg/racares.htm";

  lpUsr = ( m2pf == pnUsr );
  lpErr = ( m2pf == pnErr );
  lpHom = ( m2pf == pnHom );

  acLft = 'nvg8';
  asLft = 'left';
  pnLft = z0ui.BasPth + ( lpUsr ? pnErr : pnUsr );
  mtLft = ( lpUsr ? mtErr: mtUsr );
  gnLft = z0ui.IcnPth + '!logoARES.gif';
                                                    
  pnMdl = z0ui.BasPth + pnHom;
  mtMdl = mtHom; 

  acRht = 'nvg8'; 
  asRht = 'right'; 
  pnRht = pnRac;               
  mtRht = mtRac; 
  gnRht = z0ui.IcnPth + '!logoRAC.gif';
                                                               
  var CurDte = new Date();
  var CurYer = CurDte.getFullYear();

  q2ea = "va3"+"nag";
  q2ed = "aresniagara.org";

  dw( "<table width='100%' height='100%' cellpadding=0 cellspacing=0 border=0>"
    +  "<tr>"
    +   "<td class=nvg8 align=LEFT>"
    +    ( lpErr ? "" : "<a class=" + acLft + " style='text-align:" + asLft + ";' href='" + pnLft + "' title='" + mtLft + "'>"  )
    +     "<img style='float:" +asLft + ";' src='" + gnLft + "' width='" + z0ui.LgoSiz + "' alt='" + mtLft + "' align=LEFT hspace=8 border=0>"
    +    ( lpErr ? "" : "</a>" )
    +   "</td>"
    +   "<td class=logo align=CENTER>"
    +    ( lpHom ? "" : "<a class=logo href='" + pnMdl + "' title='" + mtMdl + "'>" )
    +     "<font face='Times New Roman,Times Roman,Times,Roman'><b><i><span class=logo>A. R. E. S. Niagara</span></i></b></font>"
    +    ( lpHom ? "" : "</a>" )
    +   "</td>"
    +   "<td class=nvg8 align=right>"
    +                   "<a class=" + acRht + " style='text-align:" + asRht + ";' href='" + pnRht + "' title='" + mtRht + "'>"
    +     "<img style='float:" + asRht + ";' src='" + gnRht + "' width='" + z0ui.LgoSiz + "' alt='" + mtRht + "' align=RIGHT hspace=8 border=0>"
    +    "</a>"
    +   "</td>"
    +  "</tr>"
    +  "<tr valign=TOP>"
    +   "<td valign=TOP class=nvg8 width=1px align=CENTER>"
    +    "<table height='100%' align=CENTER cellpadding=2 cellspacing=0 border=0>"
    +     "<tr valign=TOP>"
    +      "<td class=nvg8>"
    +       "<table align=CENTER width='100%' cellpadding=1 cellspacing=1 border=0>" );

m2sb = F;

//            basedir     basepage                       label                                NuWin title
//            m2bd        m2bp                           m2bl                                 m2n2, m2bt
   MenuBttn( z0ui.BasPth, "index.html",                  "Home",                              F,    "Home page" );

   MenuBttn( z0ui.BasPth, "main/orgchart.html",          "Contact",                           T,    "Contact info" );

   MenuBttn( z0ui.BasPth, "gwen/index.html",             "G.W.E.N.",                          F,    "Ground Wave Emergency Network information" );
   SmllBttn( z0ui.BasPth, "gwen/exercises.html",         "...&nbsp;Exercises",                F,    "Notes about upcoming and past GWEN exercises" );

   MenuBttn( z0ui.BasPth, "canwarn/index.html",          "Canwarn&nbsp;Links",                F,    "CANWARN &amp; weather Links" );
   SmllBttn( z0ui.BasPth, "weather/index.php",           "...Wthr&nbsp;Pix",                  T,    "Some Useful Radar &amp; Satellite Loops" );
   SmllBttn( z0ui.BasPth, "weather/cam_index.php",       "...Hwy&nbsp;Cams",                  T,    "Highway Cameras in the Niagara Region" );

   MenuBttn( z0ui.BasPth, "weekly/index.html",           "Weekly&nbsp;Net",                   F,    "Weekly Net documents" );
   SmllBttn( z0ui.BasPth, "weekly/checkins.html",        "...&nbsp;Check-Ins",                F,    "Check-Ins List" );
   SmllBttn( z0ui.BasPth, "weekly/ctrlstns.html",        "...&nbsp;Schedule",                 F,    "Control Station Schedule" );
   SmllBttn( z0ui.BasPth, "weekly/preamble.html",        "...&nbsp;Preamble",                 F,    "On-Air Preamble &amp; Script" );

   MenuBttn( z0ui.BasPth, "main/index.html",             "Main&nbsp;Docs",                    F,    "Main documents" );
   SmllBttn( z0ui.BasPth, "main/phntree.html",           "...&nbsp;Phone&nbsp;Tree",          F,    "Registered Volunteer Roster &amp; Telephone Tree" );
   SmllBttn( z0ui.BasPth, "main/edroguide.html",         "...&nbsp;Radio&nbsp;Op.&nbsp;Gde",  F,    "Emergency &amp; Disaster Radio Operators Procedures Guide" );
   SmllBttn( z0ui.BasPth, "main/regionmaps.html",        "...&nbsp;Maps",                     F,    "Simple maps of the Niagara Region" );
   SmllBttn( z0ui.BasPth, "main/regnform.html",          "...&nbsp;Reg'n&nbsp;Form",          F,    "Printable Registration Form" );

   MenuBttn( z0ui.BasPth, "hrn/index.html",              "Hosp's&nbsp;Net",                   F,    "Hospitals Radio Network documents" );
   SmllBttn( z0ui.BasPth, "hrn/chnllist.html",           "...&nbsp;Channels",                 F,    "Channels List" );
   SmllBttn( z0ui.BasPth, "hrn/tacsigns.html",           "...&nbsp;Tactical&nbsp;Calls",      F,    "Tactical Callsign List" );

   MenuBttn( z0ui.BasPth, "galleries/index.html",        "Galleries",                         F,    "Image Galleries" );
   SmllBttn( z0ui.BasPth, "galleries/badges/index.html", "...&nbsp;Badges",                   F,    "Badge pictures of most current volunteers" );

   MenuBttn( z0ui.BasPth, "tech/index.html",             "Tech&nbsp;Notes",                   F,    "Technical Notes" );
   SmllBttn( z0ui.BasPth, "tech/build/index.html",       "...&nbsp;Build",                    F,    "&quot;Build&quot; tech. notes" );
   SmllBttn( z0ui.BasPth, "tech/howto/index.html",       "...&nbsp;How To",                   F,    "&quot;How To&quot; tech. notes" );
   SmllBttn( z0ui.BasPth, "tech/reference/index.html",   "...&nbsp;Reference",                F,    "&quot;Reference&quot; tech. notes" );
   SmllBttn( z0ui.BasPth, "tech/theory/index.html",      "...&nbsp;Theory",                   F,    "&quot;Theory&quot; tech. notes" );
   SmllBttn( z0ui.BasPth, "tech/misc/index.html",        "...&nbsp;Misc",                     F,    "&quot;Misc&quot; tech. notes" );

   MenuBttn( z0ui.BasPth, "ares/index.html",             "ARES&nbsp;Links",                   F,    "ARES &amp; EMO Links" );

   MenuBttn( z0ui.BasPth, "links/index.html",            "Other&nbsp;Links",                  F,    "Other Notable Links" );
   SmllBttn( z0ui.BasPth, "links/software.html",         "...&nbsp;Software",                 F,    "Useful Software File links" );

   MenuBttn( z0ui.BasPth, "sitemap.html",                "Site&nbsp;Map",                     F,    "Complete map of all pages on this site" );
 dw(        "</table>"
   +       "</td>"
   +      "</tr>"
   +      "<tr valign=BOTTOM>"
   +       "<td class=nvg8 valign=BOTTOM align=CENTER nowrap>"
   +        "Design &copy; <i>1999-"+CurYer+"<br>by A.R.E.S. Niagara</i>,<br><br>"
   +        "Content &copy; <i>1997-"+CurYer+"<br>by VE3HM, VE3DVE<br>&amp VA3PKV<br><br>"
   +        "Since: 06/27/2000<br>Updated: " + LastModi() + "<br><br>"
   +        emhl("A.R.E.S. Niagara Webmaster",q2ea,q2ed,"Website comment") + "<br><br>"
   +        "<a class=nvg8 href='mailto:?subject=Interesting page, " + document.title + "&body=I found the page, " + document.title + ", at:%0D%0A%0D%0A%09" + window.location +"%0D%0A%0D%0Ainteresting!%0D%0A%0D%0AI thought you might too.%0D%0A%0D%0A'>"
   +        "Tell your friend(s)<br>about this page.</a><br><br>"
   +       "</td>"
   +      "</tr>"
   +     "</table>"
   +    "</td>" );
 dw(    "<td class=docb width='99%' align=LEFT valign=TOP bgcolor='#ffffff' colspan=2>" );
  mtUsr = "";
  mtRac = "";
}


function DocFootr( PrnHlp )
{
  dw( "</td></tr>" );
  if( PrnHlp )
  {
    dw( "<tr valign=bottom><td colspan=3>"
      + "<p class=docf style='padding: 4px;'>"
      + "<b>PRINTING</b> these and other ARES Niagara document(s) is best accomplished by using the linked PDF files, "
      + "indicated by this icon "
      + "<img class=dnld src='" + z0ui.IcnPth + "ico_pdf.gif' height=16 width=16 align=bottom vspace=0 hspace=0 border=0 alt='Example Adobe Acrobat Reader icon'> "
      + "in the title banner near the top of the document, rather than printing the web "
      + "page(s) themselve(s). The PDF versions are formatted for printing (page breaks, better graphics and such), "
      + "the web pages very rarely have convenient page breaks. "
      + "You may either: <u>left-click</u> the PDF link, then when your already installed Acrobat Reader plugin finishes "
      + "displaying the document, you may use Reader's features <small><i>(hint: printer icon)</i></small> to print "
      + "the document, <b>OR</b> <u>right-click</u> the PDF link and then save the file to a folder on your system "
      + "for later printing and/or viewing."
      + "<br>&nbsp;</p>" 
      + "</td></tr>" );
  }  
  dw( "</table>" );
}

function QryTitle( m2pu, m2pc, m2pe, m2qb, m2qe, m2dt )
{
/*
m2pu : page url
m2pc :
m2pe
m2qb
m2qe
m2dt
*/
  dw( "<table width='100%' class=doch cellspacing=0 cellpadding=0 border=0>"
    +  "<tr valign=MIDDLE>"
    +   "<td align=LEFT class=doct>" + "&nbsp;" + m2dt + "</td>"
    +   "<td valign=MIDDLE align=RIGHT class=doct>" );
  if ( 0 < m2pe )
  {
    dw(  "Page:" );
    for ( var m2pi = 1; m2pi <= m2pe; m2pi ++ )
    {
      dw( "&nbsp;" );
      if( m2pi !== m2pc )
      {
        if( m2pi >= m2qb && m2pi <= m2qe )
        {
          dw( "<a class=docn href='" + m2pu.substring(0,m2pu.length-1) + "Q.html?" + m2pi + "' title='Goto page " + m2pi + " of " + m2dt + "'> " + m2pi + " </a>" );
        }
        else
        {
          dw( "<a class=docn href='" + ( m2pi > 1 ? m2pu.substring(0,m2pu.length-1) : m2pu ) + ( m2pi > 1 ? m2pi : "" ) + ".html' title='Goto page " + m2pi + " of " + m2dt + "'> " + m2pi + " </a>" );
        }
      }
      else
      {
        dw( "<span class=docn>" + m2pi + "</span>" );
      }
    }
    dw( "&nbsp;&nbsp;" );
  }
  dw( "</td></tr></table>" );
}


function DocTitle( m2pu, m2dt )
{
  dw( "<table width='100%' class=doch border=0 cellspacing=0 cellpadding=0>"
    +  "<tr valign=MIDDLE>"
    +   "<td width='100%' class=doct align=LEFT>&nbsp;" + m2dt + "</td>"
    +   "<td align=RIGHT>" );
  if( m2pu.length > 0 ) 
  {
    dw(  "<table class=ppdf border=0>"
      +   "<tr valign=MIDDLE>"
      +    "<td>" + "<a class=ipdf href='"  + m2pu  + ".pdf' title='" + tLclk + " ["  + m2pu  + ".pdf], " + tRclk + "'>" + hLclk + "<br>" + hRclk + "</a>" +"</td>"
      +    "<td>" + "<a href='" + m2pu + ".pdf' title='"+tLclk+" [" + m2pu + ".pdf], "+tRclk+".'>" + "<img class=dnld src='"  + z0ui.IcnPth  + "ico_pdf.gif' height="  + z0ui.IcnSiz  + " width="  + z0ui.IcnSiz  + " align=absmiddle vspace=2 hspace=2 border=0 alt='" + tLclk + " ["  + m2pu  + ".pdf],\n" + tRclk + "'>" + "</a>" + "</td>"
      +   "</tr>"
      +  "</table>" );
  }
  dw(   "</td>"
    +  "</tr>"
    + "</table>" );
}

function DocuLink( m2ih, m2ip, m2it, m2ib )
{
  dw( "<table width='100%' class=doch border=0 cellspacing=0 cellpadding=0>"
    +  "<tr valign=MIDDLE>"
    +   "<td width='100%' class=doct align=LEFT>&nbsp;"
    +    "<a class=doct name='" + m2ih + "' href='" + m2ih + ".html' title='Display [" + m2ih + ".html]'>" + m2it + "</a>"
    +   "</td>"
    +   "<td align=RIGHT>" );
  if ( m2ip.length > 0 )
  {
    dw(  "<table class=ppdf border=0>"
      +   "<tr valign=middle>"
      +    "<td>"
      +     "<a href='" + m2ip + ".pdf' title='"+tLclk+" ["+m2ip+".pdf], "+tRclk+"'>"
      +      hLclk+"<br>"+hRclk
      +     "</a>"
      +    "</td>"
      +    "<td>"
      +     "<a href='" + m2ip + ".pdf' title='"+tLclk+" ["+m2ip+".pdf], "+tRclk+"'>"
      +      "<img class=dnld src='" + z0ui.IcnPth + "ico_pdf.gif' height='" + z0ui.IcnSiz + "' width='" + z0ui.IcnSiz + "' align=absmiddle vspace=2 hspace=2 alt='Display ["  + m2ip + ".pdf]' border=0>"
      +     "</a>"
      +    "</td>"
      +  "</table>" );
  }
  dw(   "</td>"
    +  "</tr>"
    + "</table>"
    + ( m2ib.length > 0 ? "<p class=''>" + m2ib + "</p>" : "" ) );
}


function TblHeadr()
{
  dw( "<table width='100%' border=0>"
    +  "<tr valign=BOTTOM>"
    +   "<td width='100%' valign=TOP align=LEFT><b>Document<br>Title</b></td>"
    +   "<td align=RIGHT>"
    +    "<td align=RIGHT width="+z0ui.IcnSiz+4+"><b>Printable<br>Pdf</b></td>"
    +   "</td>"
    +  "</tr>"
    + "</table>" )
}


function IdxHeadr( m2ih, m2it )
{
  dw( "<table class=doch border=0 cellspacing=0 cellpadding=0 width='100%'><tr valign=MIDDLE><td class=doct>&nbsp;" + ( m2ih.length == 0 ? "" : "<a class=doct href='" + m2ih + ".html' "
    + "title='Display [" + m2it + "]'>" ) + m2it + ( m2ih.length == 0 ? "" : "</a>" ) + "</td></tr></table>" );
}

function NoteBlck( m2nw, m2na, m2nt, m2nb )
{
  dw( "<table class=noth align=CENTER width='"+m2nw+"%' cellpadding=2 cellspacing=0 border=0><tr valign=TOP><td class=notb align="+m2na+" valign=TOP>" + ( m2na.toLowerCase() == "left" ? "&nbsp;" : "" ) + "<b>" + m2nt + "</b>&nbsp;" + m2nb + "</td></tr></table>" );
}

function nbpdfdoc()
{
  NoteBlck( "100", "left", "NOTE:", "<small>Right/shift click a PDF icon, <img src='" + z0ui.IcnPth + "ico_pdf.gif' height=" + z0ui.IcnSiz + " width=" + z0ui.IcnSiz + " alt='PDF file icon' border=0> &amp; pick 'Save (link) Target as' to download that file.</small>" );
}

function nbpgmfyl()
{
  NoteBlck( "100", "left", "NOTE:", "<small>Click the icon, <img class=dnld src='" + z0ui.IcnPth + "ico_pgm.gif' height=" + z0ui.IcnSiz + " width=" + z0ui.IcnSiz + " alt='PGM file icon' border=0>, to download the file; or, right/shift click the icon, &amp; pick 'Save (link) Target as' to choose where to download the file to</small>." )
}

function dwsclimg( iSrc, iWid, iHgt, dWid, bFac, iAln, iAlt )
{
  if ( bFac.length == 0 )
  {
    sFac = 1;
  }
  else
  {
    if ( bFac.indexOf('%') !== -1 )
    {
      sFac = parseInt(bFac) / 100;
    }
    else
    {
      sFac = parseInt(bFac);
    }
  }

  if ( dWid.length == 0 )
  {
    sFac = sFac * 1;
  }
  else
  {
     sFac = sFac * parseInt(z0ui.ScnWid) / parseInt(dWid);
  }

  if ( iWid.length == 0 )
  {
    sWid = 1;
  }
  else
  {
    sWid = parseInt( sFac * parseInt( iWid ) );
  }

  if ( iHgt.length == 0 )
  {
    sHgt = 1;
  }
  else
  {
    sHgt = parseInt( sFac * parseInt( iHgt ) );
  }
  dw( "<img "
    +  "src='" + iSrc + "'"
    +  (        sWid > 0 ? " width='"  + sWid + "'" : "" )
    +         ( sHgt > 0 ? " height='" + sHgt + "'" : "" )
    +  ( iAlt.length > 0 ? " alt='"    + iAlt + "'" : "" )
    +  ( iAln.length > 0 ? " align='"  + iAln + "'" : "" )
    + " border=0>" );


}


function DldPdf( pdfPth, pdfLbl, dldTxt )
{
  dw( "<p class=docb>" );
  if ( pdfLbl.length == 0 ) 
  {
    dw( "" ); 
  } 
  else 
  {
    dw( "&nbsp;" ); 
    LnkPdf( ( pdfPth.length == 0 ? "" : z0ui.DldPth + pdfPth + "/" ) + pdfLbl );
  }
  if ( dldTxt.length == 0 ) 
  {
    dw( "" );
  } 
  else 
  {
    dw( "&nbsp;" 
      + "<a href='" 
      + ( pdfPth.length == 0 ? "" : z0ui.DldPth + pdfPth + "/" ) + pdfLbl
      + ".pdf' title='" 
      + tLclk 
      + " [" 
      + pdfLbl
      + ".pdf], " 
      + tRclk 
      + "'>" 
      + dldTxt 
      + "</a>" );
  }
  dw( "</p>" );
}


function LnkPdf( pdfFyl )
{
  if( pdfFyl.length > 0 )
  {
    dw( '<a href="' 
      + pdfFyl 
      + '.pdf" name="dl' 
      + pdfFyl 
      + '" title="' 
      + tLclk
      + ' [' 
      + pdfFyl  
      + '.pdf], ' 
      + tRclk + '">'
      + '<img class=dnld src="'
      + z0ui.IcnPth 
      + 'ico_pdf.gif" height="' 
      + z0ui.IcnSiz 
      + '" width="' 
      + z0ui.IcnSiz 
      + '" align=absmiddle vspace=2 hspace=2 border=0 alt="Download [' 
      + pdfFyl 
      + '.pdf]">'
      + '</a>' );
  }
  else
  {
    dw( '<img class=dnld src="' 
      + z0ui.IcnPth 
      + 'ico_emt.gif" height="'
      + z0ui.IcnSiz 
      + '" width="' 
      + z0ui.IcnSiz 
      + '" align=absmiddle vspace=2 hspace=2 border=0>' );
  }
}

function sdpn( sPhn ) 
{
  return ( sPhn.length > 0 ? "("+sPhn.substr(0,3)+") "+sPhn.substr(3,3)+"-"+sPhn.substr(6,4) : "" );
}

function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1)
      return element;
    elements.push(element);
  }
  return elements;
}


function DocStyle( m2sp )
{
  if ( z0ui.VerMjr > 4 )
  {
    dw( '<link rel="stylesheet" href="' + m2sp + "aresniagara" + z0ui.DocSty + '.css" type="text/css">');
  }
}


function CssAdj()
{
  if ( ( z0ui.AvlWid !== window.innerWidth || z0ui.AvlHgt !== window.innerHeight ) && z0ui.VerMnr !== 5.170 ) document.location = document.location;
}

function CssIni()
{
  if ( ( z0ui.BrIsMZ || z0ui.BrIsNS ) && z0ui.VerMjr > 4 ) window.onresize = CssAdj;
}

var emat = "(a)";

CssIni();

