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 m2bh = "#fFfFfF"; // button background - hover
var m2ba = "#e7b581"; // button background - active
var m2bi = "#d09D69"; // button background - inactive

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" );

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 )
  {
     if ( this.UsrAgt.indexOf('rv:0.9.4') > -1 )
     {
       this.VerMjr = 5;
       this.VerMnr = 5.0;
     }
     if ( this.UsrAgt.indexOf('rv:0.9.5') > -1 )
     {
       this.VerMjr = 5;
       this.VerMnr = 5.0;
     }
     if ( this.UsrAgt.indexOf('rv:0.9.6') > -1 )
     { 
       this.VerMjr = 5;
       this.VerMnr = 5.0;
     }
     if ( this.UsrAgt.indexOf('rv:1.0.0') > -1 )
     {
       this.VerMjr = 5;
       this.VerMnr = 5.0;
     }
  }

  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 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.WnInrW = window.innerWidth;
  this.ScnHgt = screen.height;
  this.WnInrH = window.innerHeight;

  this.LclDom = ( document.domain == "localhost" );

  this.QslDom = ( document.domain == "www.qsl.net" );

  this.DldPth = "/va3rco/"
  this.BasPth = "/va3rco/";
  this.IcnPth =  this.BasPth + 'images/';

  //                                     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 >= 1154 && this.ScnWid <= 1280 ? "4" : ( this.ScnWid >= 1600 ? "5" : "2" ) ) ) ) ) )
  this.IcnSiz = ( this.ScnWid <= 800 ? 16 : 24 );
  this.LgoSiz = ( this.ScnWid <= 800 ? 32 : 64 );

  return this;
}

var z0ui = new UserInfo();

function dw(c)
{
  document.writeln(c);
}


function emhl( m2fn, m2an, m2dn, m2st )
{
  return ( ( m2an.length < 1 ) || ( m2dn.length < 1 ) ) ? "&nbsp;" : ( "<a href=\"mailto:" + ( ( m2fn.length > 0 ) ? ( m2fn + " <" ) : "" ) +  m2an + "@" + m2dn + ( ( m2fn.length > 0 ) ? ">" : "" ) + ( ( m2st.length > 0 ) ? ( "?Subject=" + m2st ) : "" ) + "\">" + m2an + "<font color=\"red\">@</font>" + m2dn + "</a>" )
}


function dwem( m2fn, m2an, m2dn, m2st )
{
  dw( emhl( m2fn, m2an, m2dn, m2st ) );
}


function dwlngdte( fnPar0 )
{
  dw( longdate( fnPar0 ) );
}


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 snr(srcTxt,schTxt,repTxt)
{
  idxTgt = srcTxt.indexOf(schTxt);
  while( idxTgt > -1 )
  {
    srcTxt = srcTxt.substring(0,idxTgt) + repTxt + srcTxt.substring(idxTgt+schTxt.length,srcTxt.length);
    idxTgt = srcTxt.indexOf(schTxt);
  }
  return srcTxt;
}


function min( v0, v1 )
{
  return ( v0 < v1 ? v0 : v1 )
}


function max( v0, v1 )
{
  return ( v0 > v1 ? v0 : v1 )
}


function docstyle( m2sp )
{
  if ( ( z0ui.VerMjr > 3 ) && ( z0ui.BrIsIE || z0ui.BrIsNS || z0ui.BrIsMZ ) )
  {
    dw( "<link rel=\"stylesheet\" href=\"/va3rco/3rco-"
      + z0ui.DocSty
      + ( z0ui.BrIsIE || z0ui.BrIsMZ ? "ie" : "ns" )
      + ".css\" type=\"text/css\">" );
  }
}


function Bulletin( begBul, endBul, endNew, bulTxt )
{
  var bulNow = new Date();
  var bulBeg = new Date();
  var bulEnd = new Date();
  var newEnd = new Date();
  bulBeg.setTime(Date.parse(begBul));
  bulEnd.setTime(Date.parse(endBul));
  newEnd.setTime(Date.parse(endNew));
  if( bulNow >= bulBeg && bulNow <= bulEnd )
  {
    dw( "<table class=\"newh\" width=\"100%\" border=\"0\"><tr><td class=\"newt\" align=\"center\"><table border=\"0\" width=\"100%\"><tr>"
      + ( bulNow <= newEnd ? "<td align=\"right\" width=\"11%\"><img src=\""+z0ui.IcnPth+"new.gif\" width=78 height=30 border=\"0\" alt=\"new\">&nbsp;</td>" : "" )
      + "<td align=\"center\" width=\"76%\"><p class=\"newt\">" + bulTxt + "</p></td>"
      + ( bulNow <= newEnd ? "<td align=\"left\" width=\"11%\">&nbsp;<img src=\""+z0ui.IcnPth+"new.gif\" width=78 height=30 border=\"0\" alt=\"new\"></td>" : "" )
      + "</tr></table></td></tr></table>" );
  }
}


function CssAdj()
{
  if ( z0ui.WnInrW !== window.innerWidth || z0ui.WnInrH !== window.innerHeight ) document.location = document.location;
}

function CssIni()
{
  if ( ( z0ui.BrIsMZ || z0ui.BrIsNS ) && ( z0ui.VerMjr > 3 ) ) window.onresize = CssAdj;
}


CssIni();



