//-------------------------------------------------------------------
// File:     vipcomm.js
// Purpose:  Contains commonly-used JavaScript code for vipbizcenter.com
// security: COPYRIGHT (c) Copyright 2005 C&G Web Enterprises
// owner:    Gary Richtmeyer, gary@CandGweb.com
//-------------------------------------------------------------------
// Global functions provided:
//   DateStr            - Returns a formatted date string
//   delCookie          - Delete the specified cookie
//   getCookie          - Get the value of the specified cookie
//   MakeArray          - Make an array
//   PageBottom         - Generate standard end-of-page HTML
//   PageTop            - Generate standard top-of-page HTML
//   PopWindow          - Pop-up a generic window
//   PrevNextPage       - Generate prev/next "page" navigation links
//   PrevPage           - Generate standard "return to previous page" HTML
//   setCookie          - Set the specified cookie to a certain value
//-------------------------------------------------------------------
// 2005-03-25 GLR - Initial creation
//-------------------------------------------------------------------

// ----- set variables
var author_name     = 'Gary Richtmeyer'
var author_email    = 'gary@CandGWeb.com'
var feedback_email  = 'chris@vipbizcenter.com'

// ----- Use a date of Dec 31, 2009 23:59:59 to set a "permanent" cookie -----
var permdate = new Date(2009,11,31,23,59,59)

// ----- Determine the environment -----
var browser_name    = navigator.appVersion
var browser_release = browser_name.substring(0,browser_name.indexOf(' '))
var browser_version = parseInt(navigator.appVersion)
var browser_type    = '?'
if (navigator.appName == "Netscape")            { browser_type = 'NS'    }
if (navigator.userAgent.indexOf("Opera") != -1) { browser_type = 'OPERA' }
if (navigator.appVersion.indexOf("MSIE") != -1) { browser_type = 'MSIE'  }
var screen_width    = window.screen.width
var screen_height   = window.screen.height
// ----- Simple version detection and shortcut variables -----
var isNS     = ( navigator.appName == "Netscape" && browser_version >= 4 )
var isNS4    = ( navigator.appName == "Netscape" && browser_version <= 4 )
var HIDDEN   = (isNS) ? 'hide' : 'hidden';
var VISIBLE  = (isNS) ? 'show' : 'visible';



//*******************************************************************
// Various functions
//*******************************************************************

//-------------------------------------------------------------------
// setGlobalVars: set global variables
//   Usage: setGlobalVars(x)   x = option number of how many dirs
//                                 "up" from here is the root dir.
//   Sets the following global variables (referred to as
//   "top.xxxx" within other files):
//      baseURL    - The URL of the "root" directory
//      ImagePath  - The URL where the images are stored
//-------------------------------------------------------------------
function setGlobalVars(updirs) {
  temp = document.location.pathname    // change "\" in path
  j = temp.indexOf('\\')               // (e.g. on a PC and using MSIE)
  while ( j >= 0 ) {                   // to "/"
    temp = temp.substr(0,j) + '/' + temp.substr(j+1)
    j = temp.indexOf('\\',j)
    }
  if ( arguments.length == 0 )
         { updirs = 0 }
    else { updirs = arguments[0] }
  if ( updirs == null ) updirs = 0
  while ( updirs > 0 ) {
    temp = temp.substring(0,temp.lastIndexOf('/'))
    updirs = updirs - 1
    }
  baseURL   = document.location.protocol + '//' +
              document.location.host     +
              temp.substring(0,temp.lastIndexOf('/'))
  ImagePath = baseURL + '/images/'
  }


//-------------------------------------------------------------------
// StartScreen: Setup initial screen layout, header section and navigation.
// Use: StartScreen('sectionId','nodeId',dirlevel)
//   sectionId - ID of the active major section
//   nodeId    - ID of the active minor section
//   dirlevel  - Directory level (0=root, 1=one "down", 2=two "down"...)
//-------------------------------------------------------------------
function StartScreen(sectionId,nodeId,dirlevel) {
  setGlobalVars(dirlevel)
  sectionId = sectionId.toUpperCase()
  nodeId    = nodeId.toUpperCase()

  tempstr = '<body bgcolor="#FDF5D8" ' +    // color normally overridden by CSS
                  'rightmargin=0 bottommargin=0 ' +
                  'marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>'
  document.write(tempstr)

//----- Define the navigation icons
if (document.images) {
  var button_prefix = "navf_"
  var ip = top.ImagePath + button_prefix
  homedown      = new Image(120,28); homedown.src      = ip + "home_down.gif";
  homehere      = new Image(120,28); homehere.src      = ip + "home.gif";
  homeover      = new Image(120,28); homeover.src      = ip + "home_over.gif";
  homeup        = new Image(120,28); homeup.src        = ip + "home_up.gif";
  advertisedown = new Image(120,28); advertisedown.src = ip + "advertising_down.gif";
  advertisehere = new Image(120,28); advertisehere.src = ip + "advertising.gif";
  advertiseover = new Image(120,28); advertiseover.src = ip + "advertising_over.gif";
  advertiseup   = new Image(120,28); advertiseup.src   = ip + "advertising_up.gif";
  promoproddown = new Image(120,28); promoproddown.src = ip + "promotionproducts_down.gif";
  promoprodhere = new Image(120,28); promoprodhere.src = ip + "promotionproducts.gif";
  promoprodover = new Image(120,28); promoprodover.src = ip + "promotionproducts_over.gif";
  promoprodup   = new Image(120,28); promoprodup.src   = ip + "promotionproducts_up.gif";
  homefindown   = new Image(120,28); homefindown.src   = ip + "homefinancing_down.gif";
  homefinhere   = new Image(120,28); homefinhere.src   = ip + "homefinancing.gif";
  homefinover   = new Image(120,28); homefinover.src   = ip + "homefinancing_over.gif";
  homefinup     = new Image(120,28); homefinup.src     = ip + "homefinancing_up.gif";
  membersdown   = new Image(120,28); membersdown.src   = ip + "membersarea_down.gif";
  membershere   = new Image(120,28); membershere.src   = ip + "membersarea.gif";
  membersover   = new Image(120,28); membersover.src   = ip + "membersarea_over.gif";
  membersup     = new Image(120,28); membersup.src     = ip + "membersarea_up.gif";
  }

//----- start top-of-page header
if ( isNS4 )     // Netscape 4.x ?   if so, circumvent it's problems
       { tempstr = '<table width="100%" '                                      +
                          'cellspacing="0" cellpadding="0">'                   +
                   '<tr><td width="100%" height="100%" valign=top>'            +
                   '<table width="100%" bgcolor="#E1F3F3" '                    +
                          'cellspacing="0" cellpadding="0">'
         }
  else { tempstr = '<table width="100%" bgcolor="#E1F3F3" '                    +
                          'cellspacing="0" cellpadding="0">'
         }
// generate 1st row: 1) spacer;  2) logo graphic;  3) page print icon
dsdate=new Date(); hour=dsdate.getHours()
if        ( hour <= 11 ) { ampm='Morning'   }
  else if ( hour <= 17 ) { ampm='Afternoon' }
  else                   { ampm='Evening'   }
var greet = "<span class=navgreet><nobr>Good " + ampm +
            "!</nobr></span><br><span class=navdate>It's " + DateStr() +
            "</span>"
tempstr += '<tr>'
tempstr += '<td valign=top width="25%">' + greet + '</td>'
tempstr += '<td width="50%"align=center valign=top>'                        +
               '<a href="' + baseURL + '">'                                 +
               '<img src="' + top.ImagePath + 'newviplogo.gif" '            +
                    'width=425 height=70 border=0></a><br>'                 +
               '<img src="' + top.ImagePath + 'spacer.gif" '                +
                    'width="5" height="13">'

//tempstr += "<span class=navdate>Good " + ampm +
//           "!&nbsp;&nbsp;It's " + DateStr() + "</span>"


tempstr += '<td width="25%" align=right valign=top>'                        +
               '<img src="' + top.ImagePath + 'spacer.gif" '                +
                    'width="5" height="13"><br>'
//             '<span class=navdate>' + DateStr('','SHORT') + '</span><br>' +
//             '<a href="Javascript:window.print()">'                       +
//             '<img src="' + top.ImagePath + 'printer.gif" '               +
//                  'width=32 height=42 border=0 '                          +
//                  'alt="Print this page"></a></td>'

// generate 2nd row: 1) spacer; 2) folder tabs
tempstr += '<tr><td colspan=3 align=left   ' +
                   'background="' + top.ImagePath + 'navf_empty.gif">'
tempstr += '<img src="' + top.ImagePath + 'navf_empty.gif" width=30 height=28>'
tempstr += SectionLink(sectionId, 'HOME',      '',                                       'Home page',           120,28)
tempstr += '<img src="' + top.ImagePath + 'navf_empty.gif" width=4  height=28>'
tempstr += SectionLink(sectionId, 'ADVERTISE', 'info.htm',                               'Advertise',           120,28)
tempstr += '<img src="' + top.ImagePath + 'navf_empty.gif" width=4  height=28>'
tempstr += SectionLink(sectionId, 'PROMOPROD', 'promotionalproducts/calendarpromo.html', 'Promotional Products',120,28)
tempstr += '<img src="' + top.ImagePath + 'navf_empty.gif" width=4  height=28>'
tempstr += SectionLink(sectionId, 'HOMEFIN',   '!http://www.mortgageunlimited.com',      'Home Financing',      120,28)
tempstr += '<img src="' + top.ImagePath + 'navf_empty.gif" width=4  height=28>'
tempstr += SectionLink(sectionId, 'MEMBERS',   '!http://www.vipbizcenter.net',           'Member Area',         120,28)

tempstr += '</td></tr></table>'
if ( isNS4 ) tempstr += '</td></tr></table>'
document.write(tempstr)

//----- end top-of-page header block

return
}

//-------------------------------------------------------------------
// EndScreen: Closes web page begun by "StartScreen()"
// Use: EndScreen()
//-------------------------------------------------------------------
function EndScreen() {
  return
  }


// ImgUp: Turn the specified navigation button to the "up" position
function ImgUp(imgName) {
  if ( document.images )
         { document[imgName].src = eval(imgName + "up.src") }
    else { imgName = null; }
  return true
  }

// ImgDown: Turn the specified navigation button to the "Down" position
function ImgDown(imgName) {
  if ( document.images )
         { document[imgName].src = eval(imgName + "down.src") }
    else { imgName = null; }
  return true
  }

// ImgOver: Turn the specified navigation button to the "Over" position
function ImgOver(imgName) {
  if ( document.images )
         { document[imgName].src = eval(imgName + "over.src") }
    else { imgName = null; }
  return true
  }


//-------------------------------------------------------------------
// SectionLink: Generate HTML for a major section in the nav bar
// Use: SectionLink(callerid,thisitem,thisurl,navtitle,width,height)
//   callerid  - Section ID of requester
//   thisitem  - Section ID associated with the following items
//   thisurl   - URL of target file
//   navtitle  - description for the "bubble" text
//   width     - width  of the graphic (in pixels)
//   height    - height of the graphic (in pixels)
//-------------------------------------------------------------------
function SectionLink(callerid,thisitem,thisurl,navtitle,width,height) {
  if (thisurl == undefined) thisurl = ''
  if (thisurl.substr(0,1) == '!')
         { thisurl = thisurl.substr(1);           targ = 'target="_new" ' }
    else { thisurl = top.baseURL + '/' + thisurl; targ = ''               }
  imgprefix = thisitem.toLowerCase()
  if (callerid == thisitem)
         { result = '<a href="' + thisurl + '" ' + targ + '>' +
                    '<img src="' + eval(imgprefix + 'here.src') + '" ' +
                    'border=0 width=' + width + ' height=' + height +
                    ' name="' + imgprefix + '" alt="' + navtitle + '"></a>' }
    else { result = '<a href="' + thisurl + '" ' + targ +
                    'onMousedown=ImgDown("' + imgprefix + '") ' +
                    'onMouseOver=ImgOver("' + imgprefix + '") ' +
                    'onMouseOut=ImgUp("'    + imgprefix + '")>' +
                    '<img src="' + eval(imgprefix + 'up.src') + '" ' +
                    'border=0 width=' + width + ' height=' + height +
                    ' name="' + imgprefix + '" alt="' + navtitle + '"></a>' }
  return result
  }


//-------------------------------------------------------------------
// ScriptFN: Returns only the filename of a URL
// Use: ScriptFN([url])
//   If URL not provided, the current URL is used.
//-------------------------------------------------------------------
function ScriptFN(surl) {
  if ( surl == undefined ) surl = document.location.pathname
  pathend = surl.lastIndexOf('/') + 1
  fnext   = surl.substr(pathend)
  return fnext.substr(0,fnext.indexOf('.'))
  }


//-------------------------------------------------------------------
// PopWindow: "Pop-up" a window
//-------------------------------------------------------------------
function PopWindow(popfile,popid,popx,popy,popwidth,popheight) {
  if ( popid     == null ) popid     = ''
  if ( popwidth  == null ) popwidth  = 400
  if ( popx      == null ) popx      = window.screen.width  - popwidth - 50
  if ( popheight == null ) popheight = window.screen.height - 140
  if ( popy      == null ) popy      = 40
  screenopts = 'location=no,menubar=no,resizable=yes,' +
               'scrollbars=yes,toolbar=no,' +
               'height=' + popheight + ',width=' + popwidth
  if (isNS)
         { screenopts += ',screenX=' + popx + ',screenY=' + popy }
    else { screenopts += ',left='    + popx + ',top='     + popy }
  popwin = window.open(popfile,popid, screenopts)
  window.popwin.focus()
  }


//-------------------------------------------------------------------
// getCookie: Retrieve a cookie's value by name; returns "null" if not set
//            str = getCookie(cookiename)
//-------------------------------------------------------------------
function getCookie(name){
  var cname = name + "=";
  var dc = document.cookie;
  if (dc.length > 0) {
    begin = dc.indexOf(cname);
    if (begin != -1) {
      begin += cname.length;
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
      return unescape(dc.substring(begin, end));
      }
    }
  return null;
  }

//-------------------------------------------------------------------
// setCookie: Sets a cookie's value
//            setCookie(cookiename, value, [expires])
//-------------------------------------------------------------------
function setCookie(name, value, expires) {
  document.cookie = name + "=" + escape(value) +
           ((expires == null) ? "" : "; expires=" + expires.toGMTString());
  }

//-------------------------------------------------------------------
// delCookie: Delete a cookie
//            delCookie(cookiename)
//-------------------------------------------------------------------
function delCookie(name) {
  document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
  }

//-------------------------------------------------------------------
// MakeArray: create an array of the designated size
//            MakeArray(number-of-items)
//-------------------------------------------------------------------
function MakeArray(n) {
  this.length = n
  for (var i = 0; i <= n; i++) { this[i] = 0 }
  return this
  }

//-------------------------------------------------------------------
// DateStr: Return a date string formatted from the passed date value.
// Use: DateStr([date], { FULL | SHORT } )
//        date   - The date to format; if omitted, the current
//                 date/time is used
//        FULL   - Returns a fully-qualified date (this is the default)
//                 e.g. "Sunday, August 29, 1999 at 3:00:00 p.m."
//        SHORT  - Returns an abbreviated date string
//                 e.g. "Sunday, 29 August 1999"
//-------------------------------------------------------------------
function DateStr(dsparm,dstype) {
  if ( dsparm==null ) dsparm=''
  if ( dstype==null ) dstype='FULL'; else { dstype='SHORT' }
  dow=new MakeArray(6); moy=new MakeArray(11)
  dow[0]='Sunday';    dow[1]='Monday';   dow[2]='Tuesday';   dow[3]='Wednesday'
  dow[4]='Thursday';  dow[5]='Friday';   dow[6]='Saturday'
  moy[0]='January';   moy[1]='February'; moy[2]='March';     moy[3]='April'
  moy[4]='May';       moy[5]='June';     moy[6]='July';      moy[7]='August'
  moy[8]='September'; moy[9]='October';  moy[10]='November'; moy[11]='December'
  if ( dsparm=='' )                     // any passed value?
         { dsdate  = new Date() }       //   no, get today's date
    else { dsdate  = new Date(dsparm) } //   yes, get the date
  year  = dsdate.getYear()  ; hour    = dsdate.getHours()
  month = dsdate.getMonth() ; minutes = dsdate.getMinutes()
  dom   = dsdate.getDate()  ; seconds = dsdate.getSeconds()
  day   = dsdate.getDay()
  if        ( year < 100  ) { yyyy = year + 2000 }
    else if ( year < 1000 ) { yyyy = year + 1900 }
    else                    { yyyy = year }
  if        ( hour <= 11 ) { ampm='a.m.' }
    else if ( hour == 12 ) { ampm='p.m.' }
    else                   { ampm='p.m.'; hour=hour-12 }
  if ( hour == 0 ) showhour="00"; else showhour=hour
  if ( minutes < 10 ) minutes = "0" + minutes
  if ( seconds < 10 ) seconds = "0" + seconds
  if ( dstype == 'FULL' )
         { retstr = dow[day] + ", " + moy[month] + " " + dom + ", " + yyyy +
                    " at " + showhour + ":" + minutes + ":" + seconds + " " + ampm }
    else { retstr = dow[day] + ", <nobr>" + dom + " " + moy[month] + " " + yyyy + "</nobr>"}
  return retstr
  }


//-------------------------------------------------------------------
// PrevPage: Show a "return to previous page" link
//    PrevPage()
//-------------------------------------------------------------------
function PrevPage() {
  document.writeln('<a href="javascript:history.back();">' +
                   '<img src="' + top.ImagePath +
                   'ReturnToPrevPage.gif" ' +
                   'border=0 align=middle>Return to calling page</a>')
  }



//-------------------------------------------------------------------
// PrevNextPage: Show Previous/Next page links
//    PrevNextPage([prevURL],[prevFrame],[prevText],
//                 [nextURL],[nextFrame],[nextText], [RETURN])
//       prevURL   - URL of previous page; if null, no "prevpage" link shown
//       prevFrame - target frame (if any)
//       prevText  - Optional text for "previous page" link
//       nextURL   - URL of next page; if null, no "nextpage" link shown
//       nextFrame - target frame (if any)
//       nextText  - Optional text for "next page" link
//       RETURN    - If specified, generate a "return to caller" link
//-------------------------------------------------------------------
function PrevNextPage(prevURL,prevFrame,prevText,nextURL,nextFrame,nextText,wantRet) {
  if ( prevURL   == null ) prevURL   = ''
  if ( prevFrame == null ) prevFrame = ''
  if ( nextURL   == null ) nextURL   = ''
  if ( nextFrame == null ) nextFrame = ''
  if ( wantRet   == null ) wantRet   = ''
  if ( prevURL == '' && nextURL == '' && wantRet == '' ) return
  if ( prevURL  == '' )          // do previous-page handling
         { prevURL   = '<br>'
           prevclass = ''
           }
    else { if ( prevText  == null ) prevText  = ''
           if ( prevText  != ''   ) prevText  = ' (' + prevText + ')'
           if ( prevFrame != ''   ) prevFrame = ' target="' + prevFrame + '"'
           prevURL   = '<a href="' + prevURL + '"' + prevFrame + '>' +
                       '<img src="' + top.ImagePath + 'prevpage.gif" ' +
                       'align=middle border=0 alt="Previous page">' +
                       'Prev Page' + prevText + '</a>&nbsp;'
           prevclass = ' class="prevnextpage"'
           }
  if ( nextURL  == '' )          // do next-page handling
         { nextURL   = '<br>'
           nextclass = ''
           }
    else { if ( nextText  == null ) nextText  = ''
           if ( nextText  != ''   ) nextText  = ' (' + nextText + ')'
           if ( nextFrame != ''   ) nextFrame = ' target="' + nextFrame + '"'
           nextURL   = '&nbsp;<a href="' + nextURL + '"' + nextFrame + '>' +
                       'Next Page' + nextText +
                       '<img src="' + top.ImagePath + 'nextpage.gif" ' +
                       'align=middle border=0 alt="Next page"></a>'
           nextclass = ' class="prevnextpage"'
           }
  if ( wantRet  == '' )          // do return-to-caller handling
         { RetURL    = '<br>'
           Retclass  = ''
           }
    else { RetURL    = '<a href="javascript:history.back();">' +
                       '<img src="' + top.ImagePath + 'callpage.gif" ' +
                       'align=middle border=0 alt="Backup one page">' +
                       'Backup one page</a>'
           Retclass  = ' class="prevnextpage"'
           }
  // generate HTML
  temp1 = '<table width="100%" border=0><tr>'
  temp2 = '<td align=left width="45%"><table cellspacing=0 cellpadding=0><tr>' +
             '<td height=16'  + prevclass + '>' + prevURL + '</td>' +
             '</tr></table></td>'
  temp3 = '<td align=left width="10%"><table cellspacing=0 cellpadding=0><tr>' +
             '<td height=16'  + Retclass + ' nowrap>' + RetURL + '</td>' +
             '</tr></table></td>'
  temp4 = '<td align=right width="45%"><table cellspacing=0 cellpadding=0><tr>' +
             '<td height=16'  + nextclass + '>' + nextURL + '</td>' +
             '</tr></table></td>'
  temp5 = '</tr></table>'
//alert(temp1 + temp2 + temp3 + temp4 + temp5)
  document.writeln(temp1 + temp2 + temp3 + temp4 + temp5)
  return
  }


//-------------------------------------------------------------------
// PageTop: Create top-of-page HTML text
//    PageTop(title [, parm1, parm2, ..., parmx ] )
//      title - The title of this page to be displayed to the user
//      parm  - any one of the following parameters:
//         { PRINT | NOPRINT }
//              Should the print-this-page icon be shown?
//              If omitted, NOPRINT is assumed.
//         CLASS=class
//              The CSS class to be used for the title.  If omitted,
//              the class "titlepage" is used.
//              e.g.  'CLASS=h2'
//         PREV=url | [ description ] | [ frame ]
//              A "previous-page" link to the specified url should be
//              generated.  If a description is provided, it is shown.
//              If a frame name is specified, a target is generated.
//              e.g.  'PREV=overview.html'
//              e.g.  'PREV=overview.html|Overview description'
//              e.g.  'PREV=overview.html|Overview description|dataframe'
//         NEXT=url | [ description ] | [ frame ]
//              A "next-page" link to the specified url should be
//              generated.  If a description is provided, it is shown.
//              If a frame name is specified, a target is generated.
//              e.g.  'NEXT=detail.html'
//              e.g.  'NEXT=detail.html|Detail Information'
//              e.g.  'NEXT=detail.html|Detail Information|dataframe'
//         { RETURN | NORETURN ]
//              Should a "return-to-calling-page" link be generated?
//              If omitted, NORETURN is assumed.
//
//-------------------------------------------------------------------
function PageTop(pagetitle) {
  var tclass='titlepage', _print=false, _return=false
  var pu='', pt='', pf='', nu='', nt='', nf=''
  if ( pagetitle == null ) pagetitle = ''
  //----- scan & evaluate the passed parameters
  for ( var ix=1; ix < arguments.length; ix++ ) {
    thisParm = arguments[ix]
    if ( thisParm == '' ) continue      // ignore null parms
    tempray = thisParm.split('=',2)
    keyword = tempray[0].toUpperCase()
    data    = tempray[1]; if ( data == undefined ) data = ''
    switch (keyword) {
      case 'PRINT'   : _print  = true;  break;
      case 'NOPRINT' : _print  = false; break;
      case 'RETURN'  : _return = true;  break;
      case 'NORETURN': _return = false; break;
      case 'CLASS'   : tclass  = data;  break;
      case 'NEXT'    :
        tempray = data.split('|',3);
        nu = tempray[0];
        nt = tempray[1]; if ( nt == undefined ) nt = '';
        nf = tempray[2]; if ( nf == undefined ) nf = '';
        break;
      case 'PREV'    :
        tempray = data.split('|',3);
        pu = tempray[0];
        pt = tempray[1]; if ( pt == undefined ) pt = '';
        pf = tempray[2]; if ( pf == undefined ) pf = '';
        break;
      default: alert(keyword + ' is an unknown keyword to PageTop() in ' +
                     document.URL)
      }
    }
  //----- generate the appropriate HTML
  document.writeln('<a name="PageTop"></a>')
  if ( pu != '' || nu != '' || _return ) {    // show links if any given
    PrevNextPage(pu,pf,pt,nu,nf,nt,_return ? 'RETURN' : '')
    document.writeln('<br>')
    }
  if ( _print && browser_version>=4 ) {  // show print icon if requested
       prticon = '<a href="Javascript:window.print()" class=ptprint>' +
                 '<img src="' + top.ImagePath +
                 'printer.gif" align=right ' +
                 'width=32 height=42 border=0 alt="Print this page"></a>'
       document.writeln(prticon);
       }
  if ( pagetitle != '') {  // show page title if a title provided

    if ( ( browser_type == 'NS' ) && ( browser_version <= 4 ) )
           { document.writeln('<h1><i>' + pagetitle + '</i></h1>')
             }
      else { document.writeln('<span class="' + tclass + '">' +
                              pagetitle + '</span>')
             }
    }
  return
  }

//-------------------------------------------------------------------
// PageBottom: Create bottom-of-page HTML text
//    PageBottom( [ parm1 [, parm2, parm3, ... , parmx ] ] )
//      parm - any one of the following parameters:
//         { DATE | NODATE }
//              Should the date of the calling HTML file be shown?
//              If omitted, DATE is assumed.
//         { FEED | NOFEED }
//              Should a Feedback-type link be included?
//              If omitted, FEED is assumed.
//         PREV=url | [ description ] | [ frame ]
//              A "previous-page" link to the specified url should be
//              generated.  If a description is provided, it is shown.
//              If a frame name is specified, a target is generated.
//              e.g.  'PREV=overview.html'
//              e.g.  'PREV=overview.html|Overview description'
//              e.g.  'PREV=overview.html|Overview description|dataframe'
//         { PROP | NOPROP }
//              Should the "Copyright ..." text be shown?
//              If omitted, PROP is assumed.
//         NEXT=url | [ description ] | [ frame ]
//              A "next-page" link to the specified url should be
//              generated.  If a description is provided, it is shown.
//              If a frame name is specified, a target is generated.
//              e.g.  'NEXT=detail.html'
//              e.g.  'NEXT=detail.html|Detail Information'
//              e.g.  'NEXT=detail.html|Detail Information|dataframe'
//         { RETURN | NORETURN ]
//              Should a "return-to-calling-page" link be generated?
//              If omitted, NORETURN is assumed.
//         { HITBOX | NOHITBOX ]
//              Should the "hitbox" be generated for tracking hits?
//              If omitted, HITBOX is assumed.
//-------------------------------------------------------------------
function PageBottom() {
  var _date=true, _feed=false, _prop=true, _return=true,  _hitbox=false
  var pu='', pt='', pf='', nu='', nt='', nf=''
  //----- scan & evaluate the passed parameters
  for ( var ix=0; ix < arguments.length; ix++ ) {
    thisParm = arguments[ix]
    if ( thisParm == null ) continue      // ignore null parms
    if ( thisParm == ''   ) continue
    tempray = thisParm.split('=',2)
    keyword = tempray[0].toUpperCase()
    data    = tempray[1]; if ( data == undefined ) data = ''
    switch (keyword) {
      case 'DATE'    : _date   = true;  break;
      case 'NODATE'  : _date   = false; break;
      case 'FEED'    : _feed   = true;  break;
      case 'NOFEED'  : _feed   = false; break;
      case 'PROP'    : _prop   = true;  break;
      case 'NOPROP'  : _prop   = false; break;
      case 'RETURN'  : _return = true;  break;
      case 'NORETURN': _return = false; break;
      case 'HITBOX'  : _hitbox = true;  break;
      case 'NOHITBOX': _hitbox = false; break;
      case 'NEXT'    :
        tempray = data.split('|',3);
        nu = tempray[0];
        nt = tempray[1]; if ( nt == undefined ) nt = '';
        nf = tempray[2]; if ( nf == undefined ) nf = '';
        break;
      case 'PREV'    :
        tempray = data.split('|',3);
        pu = tempray[0];
        pt = tempray[1]; if ( pt == undefined ) pt = '';
        pf = tempray[2]; if ( pf == undefined ) pf = '';
        break;
      default: alert(keyword + ' is an unknown keyword to PageBottom() in ' +
                     document.URL)
      }
    }
  //----- generate the appropriate HTML
  document.writeln('<center><a name="PageBottom"><p></a>')
  if ( pu != '' || nu != '' || _return ) {    // show links if any given
    document.writeln('<p>')
    PrevNextPage(pu,pf,pt,nu,nf,nt,_return ? 'RETURN' : '')
    }
  if ( _prop || _date || _feed || _hitbox ) {  // generate footer if needed
    document.write('<hr noshade><table><tr>')
    if ( _prop )
           { temp = '<font color="#000080" size="1">Copyright &copy;1995-2005 ' +
                    '- All Rights Reserved.<br>CBBN Business Center&reg; '    +
                    'Classifieds Better Business Net Inc.</font><br>'     +
                    '<a href="' + top.baseURL + '/include/disclaimer.htm">'   +
                    '<font color="#000080" size="1">&#91;Disclaimer&#93;</font></a>'
             }
      else { temp = '&nbsp;' }
    document.writeln('<td align=center valign=top>' + temp + '</td>')
    if ( _hitbox )
           { temp = '<img src="http://comm1.digits.com/wc/xxxxxxxx">' }
      else { temp = '&nbsp;' }
    document.write('<td width="30%" valign=top align=center>' + temp + '</td>')
    temp = '<td align=center valign=top><p>'
    if ( _date ) {
      temp += '<span class=footdate><nobr>Page last updated: ' +
              DateStr(document.lastModified) + '</nobr></span><br>'
      }
    if ( _feed ) {
      temp += '<span class=footfeed><nobr>' +
              'Questions about this web site or this page? ' +
              '<a href="mailto:' + feedback_email +
              '?subject=VipBizCenter%20Website%20Feedback%20(' +
              document.location.href + ')">' +
              'Tell us about it!</a></nobr></span>'
      }
    document.writeln(temp + '</td></tr></table></center>')
    }
  }
