//-------------------------------------------------------------------
// File:     jcookie.js
// Purpose:  Contains commonly-used JavaScript code for PrintShop101.com
//           (a result of combining the original "jcookie.js" and
//           ps101common.js)
// Author:   Gary Richtmeyer (gary@CandGWeb.com) and Anton Kiriwas
// Following functions originally written by Anton Kiriwas
//    getKeyCookie, setKeyCookie, getCookie, setCookie
//
//-------------------------------------------------------------------
// jcookie.js 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
//   PopHelp            - Pop-up a "help"-type window
//   PopWindow          - Pop-up a generic window
//   PrevNextBase       - Base code for PrevNextSect() and PrevNextStep()
//   PrevNextPage       - Generate prev/next "page" navigation links
//   PrevNextSect       - Generate prev/next "section" navigation links
//   PrevNextStep       - Generate prev/next "step" navigation links
//   PrevPage           - Generate standard "return to previous page" HTML
//   setCookie          - Set the specified cookie to a certain value
//   SetNavNode         - Activate "node(s)" in the navigation applet
//   ShowClose          - Generate standard "close this window" HTML
//-------------------------------------------------------------------
// 2004-09-20 GLR - Initial definition for PrintShop101.com
//-------------------------------------------------------------------

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

// ----- Use a date of Dec 31, 2009 23:59:59 to set a "permanent" cookie -----
var permdate = new Date(2009,12,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 HIDDEN   = (isNS) ? 'hide' : 'hidden';
var VISIBLE  = (isNS) ? 'show' : 'visible';


//==================================================================*
// Functions copied from original "jcookie.js" file                 *
//==================================================================*

//This function i used to set the cookie value for a key page
function setKeyCookie( key ) {
        setCookie("key", key, null, "/", null, null)
}

//This function creates a full cookie string using the given
//information
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
        var dc = document.cookie;
        var prefix = name + "=";
        var begin = dc.indexOf("; " + prefix);
        if (begin == -1) {
                begin = dc.indexOf(prefix);
                if (begin != 0) {
                        return null;
                }
        } else
                begin += 2;
        var end = document.cookie.indexOf(";", begin);
        if (end == -1)
                end = dc.length;
        return unescape(dc.substring(begin + prefix.length, end));
}

//This function recieves the cookie value
function getKeyCookie() {
        if (document.cookie == "") {
                return ""
        }
        var ss = getCookie("key")
        if (ss == null)
                return ""
        else
                return ss
}

//In this function it decides which URL to send the user back to
//Based on the key value.  This is where you add new partne
//Information and key values
function getURL( key ) {
        if (key == "k00")
            return "http://www.printshop101.com/keypages/keyhouse.htm"
        else if (key == "kSO")
            return "http://www.printshop101.com/keypages/kSO.htm"
        else if (key == "lcy")
            return "http://www.printshop101.com/keypages/keylgcy.htm"
        else if (key == "sample")
            return "http://www.printshop101.com/keypages/sample.htm"
        else if (key == "tga")
            return "http://www.printshop101.com/keypages/keytga.htm"
        else if (key == "poster")
            return "http://www.printshop101.com/keypages/house.htm"
        else if (key == "salspln")
            return "http://www.printshop101.com/keypages/keyhouse.htm"
        else if (key == "kpii")
            return "http://www.printshop101.com/keypages/keypii.htm"
        else if (key == "m01")
            return "http://www.printshop101.com/keypages/keyhouse.htm"
        else if (key == "fp01")
            return "http://www.printshop101.com/keypages/keyhouse.htm"
        else if (key == "fp02")
            return "http://www.printshop101.com/keypages/keyhouse.htm"
        else if (key == "pii")
            return "http://www.printshop101.com/keypages/keypii.htm"
        else if (key == "peg")
            return "http://www.printshop101.com/keypages/keypeg.htm"
        else if (key == "piw")
            return "http://www.printshop101.com/keypages/keyhouse.htm"
        else if (key == "fsi")
            return "http://www.printshop101.com/keypages/keyfsi.htm"
        else if (key == "icd")
            return "http://www.printshop101.com/keypages/keyiced.htm"
		else if (key == "pcd")
            return "http://www.printshop101.com/keypages/pcard1.htm"
		else if (key == "eml")
            return "http://www.printshop101.com/keypages/keymail.htm"
		else if (key == "psh")
            return "http://www.printshop101.com/keypages/keyps1.htm"
		else if (key == "phc")
            return "http://www.printshop101.com/keypages/keyphc.htm"
		else
            return ""
}


//==================================================================*
// Functions from ps101common.js                                    *
//==================================================================*


//*******************************************************************
// Custom functions for manipulating the "FolderTree" Javascript
// navigation "tree"
//*******************************************************************

//-----------------------------------------------------------
// highlightNode:  Highlight/Execute the passed node SUID
//   highlightNode(suid [,XEQ] )
//-----------------------------------------------------------
function highlightNode(sui,xeq) {
  if ( xeq == 'XEQ' )
         xeq = true
    else xeq = false

  //----- First, ensure all parent nodes of selected node are open
  thisNode   = suiArray[sui]
  if (thisNode == undefined) { return void(0); }
  path       = new Array
  npath      = 0
  nLevel     = thisNode.nodeLevel
  thisparent = thisNode.nodeParent
  for (j = 0; j < nLevel; j++) {
     path[j]    = thisparent
     thisNode   = thisparent
     thisparent = thisNode.nodeParent
     }
  for (j = nLevel-1; j >-1; j--) {
     thisNode = path[j]
     if (!thisNode.isOpen) { clickOnNode(thisNode.id) }
     }

  //----- Second, reset appearance of currently-selected node (if any)
  thisNode = suiArray[sui]
  if (selectedNode) {
    if (selectedNode.isFolder)
           selectedNode.setIcon("default","default","default","default")
      else selectedNode.setIcon("default","default")
    if (!selectedNode.iconImg) {
      if (bV == 2)
             selectedNode.iconImg = selectedNode.navObj.document.images["nodeIcon"+selectedNode.id]
        else if (bV == 1 || doc.images)
               selectedNode.iconImg = doc.images["nodeIcon"+selectedNode.id]
      }
    if (selectedNode.iconImg) {
      selectedNode.iconImg.src = selectedNode.nodeIcon("",iNA)
      if (bV == 1) {
        if (doc.all["text" + selectedNode.id]) {
          selectedChild                       = doc.all["text"+selectedNode.id]
  //      selectedChild.style.fontStyle       = "italic"
          selectedChild.style.backgroundColor = "transparent"
          selectedChild.style.color           = document.vlinkColor
          selectedChild.style.fontWeight      = "normal"
          selectedChild.style.fontStyle       = "normal"
          }
        }
      }
    }

  //----- Last, set appearance of selected node
  selectedNode = thisNode
  if (!selectedNode.iconImg) {
    if (bV == 2)
           selectedNode.iconImg = selectedNode.navObj.document.images["nodeIcon"+selectedNode.id]
      else if (bV == 1 || doc.images)
             selectedNode.iconImg = doc.images["nodeIcon"+selectedNode.id]
    }
  if (thisNode.iconImg) {
    thisNode.iconImg.src = thisNode.nodeIcon("",iNA)
    if (bV == 1) {
      if (!selectedNode.navObj) selectedNode.navObj = doc.all["node" + selectedNode.id]
      if (doc.all["text" + selectedNode.id]) {
        selectedChild                       = doc.all["text"+selectedNode.id]
  //    selectedChild.style.fontStyle       = "italic"
        selectedChild.style.backgroundColor = "yellow"
        selectedChild.style.color           = "red"
  //    selectedChild.style.fontWeight      = "bold"
        }
      selectedNode.navObj.scrollIntoView(false)
      }
    }
  if ( xeq ) {                     // invoking the URL for this node?
    if (selectedNode.hreference)   //   yes, do so if a URL is specified
      { self.frames[baseFrame].location = selectedNode.hreference }
    }
  if (bV == 2) {
    self.frames[menuFrame].scroll(0, selectedNode.navObj.pageY - self.frames[menuFrame].innerHeight/2)
    }
  return;
  }


//-----------------------------------------------------------
// clickAction: Highlight the selected node
//   (for use with the "FolderTree" menuing code)
//-----------------------------------------------------------
function clickAction(thisNode) {
  if (selectedNode) {
    if (selectedNode.isFolder)
           selectedNode.setIcon("default","default","default","default")
      else selectedNode.setIcon("default","default")
    if (!selectedNode.iconImg) {
      if (bV == 2)
             selectedNode.iconImg = selectedNode.navObj.document.images["nodeIcon"+selectedNode.id]
        else if (bV == 1 || doc.images)
               selectedNode.iconImg = doc.images["nodeIcon"+selectedNode.id]
      }
    selectedNode.iconImg.src = selectedNode.nodeIcon("",iNA)
    if (bV == 1) {
      if (doc.all["text" + selectedNode.id]) {
        selectedChild                       = doc.all["text"+selectedNode.id]
        selectedChild.style.fontStyle       = "italic"
        selectedChild.style.backgroundColor = "transparent"
        selectedChild.style.color           = document.vlinkColor
        selectedChild.style.color           = "FA63C6"
        selectedChild.style.fontWeight      = "normal"
        selectedChild.style.fontStyle       = "normal"
        }

      }
    }
//if (thisNode.isFolder)
//       thisNode.setIcon("globe","globe","globe","globe")
//  else thisNode.setIcon("globe","globe")
  selectedNode = thisNode
  if (!selectedNode.iconImg) {
    if (bV == 2)
           selectedNode.iconImg = selectedNode.navObj.document.images["nodeIcon"+selectedNode.id]
      else if (bV == 1 || doc.images)
             selectedNode.iconImg = doc.images["nodeIcon"+selectedNode.id]
    }

  thisNode.iconImg.src = thisNode.nodeIcon("",iNA)
  if (bV == 1) {
    if (!selectedNode.navObj) selectedNode.navObj = doc.all["node" + selectedNode.id]
    if (doc.all["text" + selectedNode.id]) {
      selectedChild                       = doc.all["text"+selectedNode.id]
//    selectedChild.style.fontStyle       = "italic"
      selectedChild.style.backgroundColor = "yellow"
      selectedChild.style.color           = "red"
      selectedChild.style.fontWeight      = "normal"
      }
    }
  return ;
  }

//-------------------------------------------------------------------
// SetNavNode: set the navigation bar to highlight desired node
// Use: SetNavNode('node1|node2| ... |nodex')
//   The navbar applet is queried to determine the current node.
//   If the current node does not match the last (or only) node
//   in the passed list, the applet is told to reset the display.
//-------------------------------------------------------------------
function SetNavNode(nodestr) {
  if ( nodestr == null) nodestr = ''
  if ( nodestr != ''  ) {
    if ( nodestr.substr(nodestr.length-1,1) != '|' ) nodestr += '|'
    var lastbar       = nodestr.lastIndexOf('|')
    var nexttolastbar = nodestr.lastIndexOf('|',lastbar-1)
    var nodeid = nodestr.substr(nexttolastbar + 1, lastbar - nexttolastbar-1)
    top.highlightNode(nodeid)
    }
  return
  }


//*******************************************************************
// Miscellaneous functions
//*******************************************************************

//-------------------------------------------------------------------
// setGlobalVars: set global variables
//   Called by "index.html" and other "stand-alone" pages
//   (e.g. not running within a frame established by "index.html").
//   Other files refer to these variables as "top.xxxx".
//-------------------------------------------------------------------
function setGlobalVars() {
  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)
    }
  baseURL   = document.location.protocol + '//' +
              document.location.host     +
              temp.substring(0,temp.lastIndexOf('/'))
  ImagePath = baseURL + '/images/'
  }

//-------------------------------------------------------------------
// 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()
  }


//-------------------------------------------------------------------
// 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] + ", " + dom + " " + moy[month] + " " + yyyy }
  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>')
  }

//-------------------------------------------------------------------
// PrevNextSect: Show Previous/Next "section" links
//    PrevNextSect([prevURL],[nextURL],[TOP] [BOTTOM])
//       See "PrevNextBase()" for a description of the parameters
//-------------------------------------------------------------------
function PrevNextSect(prevURL,nextURL,opts) {
  PrevNextBase('SECTION',prevURL,nextURL,opts)
  return
  }

//-------------------------------------------------------------------
// PrevNextStep: Show Previous/Next "step" links
//    PrevNextStep([prevURL],[nextURL],[TOP] [BOTTOM])
//       See "PrevNextBase()" for a description of the parameters
//-------------------------------------------------------------------
function PrevNextStep(prevURL,nextURL,opts) {
  PrevNextBase('STEP',prevURL,nextURL,opts)
  return
  }

//-------------------------------------------------------------------
// PrevNextBase: Show Previous/Next section/step links
//    PrevNextBase({SECTION|STEP},[prevURL],[nextURL],[TOP] [BOTTOM])
//       SECTION  - If specified, prev/next "section" links are created
//       STEP     - If specified, prev/next "step" links are created
//       prevURL  - Anchor name (without the "#") of previous item;
//                  if null, no "prevsect" link shown
//       nextURL  - Anchor name (without the "#") of next item;
//                  if null, no "nextsect" link shown
//       TOP      - If specified, a TopOfPage link is generated
//                  (uses the anchor created by "PageTop()"
//       BOTTOM   - If specified, a BottomOfPage link is generated
//                  (uses the anchor created by "PageBottom()"
//-------------------------------------------------------------------
function PrevNextBase(baseType,prevURL,nextURL,sectOpts) {
  var baseType  = (baseType=='STEP') ? 'step' : 'section'
  if ( prevURL  == null ) prevURL  = ''
  if ( nextURL  == null ) nextURL  = ''
  if ( sectOpts == null ) sectOpts = ''
  var wantTop  = ( sectOpts.indexOf("TOP")    != -1 )
  var wantBot  = ( sectOpts.indexOf("BOTTOM") != -1 )
  if ( prevURL=='' && nextURL=='' && !wantTop && !wantBot) return
  // generate the HTML
  temp = ''
  if ( prevURL != '' ) {     // create previous link if provided
    temp += '<a href="#' + prevURL +
            '"><img src="' + top.ImagePath +
            'prev' + baseType + '.gif" ' +
            'align=middle border=0 alt="Previous section"></a>'
    }
  if ( nextURL != '' ) {     // create next link if provided
    if ( temp.length > 0 ) temp += '&nbsp;&#124;&nbsp;'
    temp += '<a href="#' + nextURL +
            '"><img src="' + top.ImagePath +
            'next' + baseType + '.gif" ' +
            'align=middle border=0 alt="Next section"></a>'
    }
  if ( wantTop ) {           // create top-of-page if requested
    if ( temp.length > 0 ) temp += '&nbsp;&#124;&nbsp;'
    temp += '<a href="#PageTop">' +
            '<img src="' + top.ImagePath + 'topofpage.gif" ' +
            'align=middle border=0 alt="Top of Page"></a>'
    }
  if ( wantBot ) {           // create bottom-of-page if requested
    if ( temp.length > 0 ) temp += '&nbsp;&#124;&nbsp;'
    temp += '<a href="#PageBottom">' +
            '<img src="' + top.ImagePath + 'bottomofpage.gif" ' +
            'align=middle border=0 alt="Bottom of Page"></a>'
    }
  document.writeln('&#91; ' + temp + ' &#93;<br>&nbsp;')
  return
  }

//-------------------------------------------------------------------
// 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="Return to caller">' +
                       '</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 + '>' + 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, PRINT 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=true, _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
    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 "AT&T Proprietary ..." 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.
//-------------------------------------------------------------------
function PageBottom() {
  var _date=true, _feed=true, _prop=true, _return=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 '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 ) {  // generate footer if needed
    temp = '<hr noshade><table><tr><td align=center valign=middle>'
    if ( _prop )
           { temp += '<font face="Arial,helvetica,times" size=1>' +
                     '<b>AT&T-Proprietary</b><br>' +
                     'Use pursuant to Company Instructions</font></td>'
             }
      else { temp += '&nbsp;</td>' }
    document.writeln(temp + '<td width="30%">&nbsp;</td>' +
                     '<td align=center valign=middle>' +
                     '<font face="Arial,helvetica,times" size=1><p>')
    temp = ''
    if ( _date ) {
      temp += '<nobr><font size="1">Page last updated: ' +
              DateStr(document.lastModified) + '</font></nobr><br>'
      }
    if ( _feed ) {
      temp += '<font size="1"><nobr>' +
              'Questions about this site or this page? Submit a ' +
              '<a href="mailto:' + author_email +
              '?subject=e-NC3%20Ver%202%20Feedback%20(' +
              document.location.href + ')">' +
              'Feedback</a></nobr></font><br>'
      }
    document.writeln(temp + '</font></td></tr></table></center>')
    }
  return
  }

