//-------------------------------------------------------------------
// File:     common.js
// Purpose:  Contains commonly-used JavaScript code in SaundersGroup.com
// security: COPYRIGHT (c) Copyright 2006-2010 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
//   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
//   ShowClose          - Generate standard "close this window" HTML
//-------------------------------------------------------------------
// 2006-12-15 GLR - Initial creation
// 2007-01-21 GLR - Change website feedback text
// 2007-03-01 GLR - Add Market/Economic Opinion nav button; revamp marquee
// 2007-03-12 GLR - Point to ASP files for the presentations
// 2008-04-28 GLR - Add new opinion file; update copyright
// 2008-05-30 GLR - Add Glossary section; add new opinion letter
// 2008-07-11 GLR - Add new opinion letter
// 2008-07-14 GLR - Add 3 historical opinion letters
// 2008-07-23 GLR - Change "NASD" to FINRA
// 2008-08-11 GLR - Add 8/11/2008 opinion letter
// 2008-09-29 GLR - Add Bear Market Study opinion letter
// 2008-10-09 GLR - Add Oct 8 Market Letter
// 2008-11-09 GLR - Add Nov 5 Market Letter
// 2008-12-22 GLR - Add Dec 17 Market Letter
// 2009-02-05 GLR - Add Feb 5 Market Letter; update oopyright date
// 2009-03-16 GLR - Make the Glossary a sub-menued item, add Secular term doc
// 2009-04-07 GLR - Add April 2009 market newsletter
// 2009-04-15 GLR - Remove "Presentations"; add "Stock Market Charts";
//                  create ShowChartTitle and ShowChart functions
// 2009-06-15 GLR - Add June 2009 Opinion letter
// 2009-07-09 GLR - Update stock market charts: remove 3; add 4
// 2009-07-25 GLR - Add July 22 2009 Opinion letter
// 2009-10-02 GLR - Fix typo in company marquee crawl; add Market Letters Source
//                  section and button; update Dow Jones daily chart
// 2009-11-02 GLR - Add November 2 2009 Opinion letter
// 2009-11-09 GLR - Changes to the Stock Market Charts
// 2010-02-02 GLR - Add Jan opinion letter
// 2010-02-24 GLR - Upgrade logo to Flash version (on home page only)
// 2010-03-04 GLR - Add March 1st Opinion letter
// 2010-04-19 GLR - Add April 13 Opinion letter; update DowJonesDaily graph
// 2010-05-10 JM  - Added new Market Chart DowJonesDaily_20100510.png and added new Market Letter May 10, 2010
// 2010-06-04 JM  - Added new Market Chart DownJonesDaily_20100604
// 2010-07-01 JM  - Added new Market Letter (July 1, 2010) & new chart (DowJonesDaily_20100701) 
//-------------------------------------------------------------------

// ----- set variables
var author_name     = 'Gary Richtmeyer'
var author_email    = 'gary@CandGWeb.com'

// ----- Use a date of Dec 31, 2019 23:59:59 to set a "permanent" cookie -----
var permdate = new Date(2019,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';

var ChartNum = 0          // for the ShowChart function

//*******************************************************************
// 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/'
  }


//-------------------------------------------------------------------
// ShowMarquee: Create the requested marquee
// Use: ShowMarquee(marqueetype) 
//   marqueetype =   NONE      - Show no marquee (default)
//                   TICKER    - Show stock prices
//                   PROVIDER  - Used on Provider-Links page 
//                   COMPANY   - About our company
//                   ABOUTUS   - What we do
//-------------------------------------------------------------------
function ShowMarquee(smparm) {
smparm = smparm.toUpperCase()
temp   = ''
switch (smparm) {
  //-- stock market ticker
  case 'TICKER' : 
    temp  = '<table border="0" cellspacing="1" width="700" bgcolor="#FFFFFF">' +
            '<tr><td width="700">'
    temp += '<APPLET NAME="Ticker2" '                              +
	        	        'CODE="Ticker.class" '                         +
		                'ARCHIVE="Ticker.jar" '                        +
		                'CODEBASE="http://java.barchart.com/ticker/" ' +
		                'HEIGHT="48" '                                 +
    		            'WIDTH="700" '                                 +
	                  '>'
    temp += '<PARAM NAME="panels"      VALUE="3">'                 +
    	      '<PARAM NAME="1:symbols"   VALUE="\'Indices,$NASX:Nasdaq,$NYS:NYSE,$IUX:Russell,$VLA:Value Line">' +
	          '<PARAM NAME="1:scroll"    VALUE="-1, 20">'            +
	          '<PARAM NAME="1:bgcolor"   VALUE="#0000FF">'           +
    	      '<PARAM NAME="1:fgcolor"   VALUE="#FFFFFF">'           +
	          '<PARAM NAME="1:pscolor"   VALUE="#00CC00">'           +
	          '<PARAM NAME="1:ngcolor"   VALUE="#33fdff">'           +
    	      '<PARAM NAME="1:hilight"   VALUE="#FFFF00">'           +
	          '<PARAM NAME="1:font"      VALUE="Arial, Normal, 12">' +
	          '<PARAM NAME="2:symbols"   VALUE="\'Stocks,MSFT:Microsoft,IBM,QQQQ,SIEB:Siebert,TSA:Sports Authority,EBAY,YHOO:Yahoo!">' +
    	      '<PARAM NAME="2:scroll"    VALUE="-1, 30">'            +
	          '<PARAM NAME="2:bgcolor"   VALUE="#FFFFFF">'           +
	          '<PARAM NAME="2:fgcolor"   VALUE="#000000">'           +
    	      '<PARAM NAME="2:pscolor"   VALUE="#00AA00">'           +
	          '<PARAM NAME="2:ngcolor"   VALUE="#AA0000">'           +
	          '<PARAM NAME="2:hilight"   VALUE="#0000FF">'           +
    	      '<PARAM NAME="2:font"      VALUE="Arial, Normal, 12">' +
	          '<PARAM NAME="3:symbols"   VALUE="\'Commodities,CH7:March Corn,CLY0:Crude Oil Cash,SPZ6:S&P 500 Futures">' +
	          '<PARAM NAME="3:scroll"    VALUE="-1,  10">'           +
    	      '<PARAM NAME="3:bgcolor"   VALUE="#333333">'           +
	          '<PARAM NAME="3:fgcolor"   VALUE="#FFFFFF">'           +
	          '<PARAM NAME="3:pscolor"   VALUE="#00CC00">'           +
    	      '<PARAM NAME="3:ngcolor"   VALUE="#33fdff">'           +
	          '<PARAM NAME="3:hilight"   VALUE="#CCFFFF">'           +
	          '<PARAM NAME="3:font"      VALUE="Arial, Normal, 12">'
    temp += '</APPLET>'
    temp += '</td></tr></table>'
    break;
  
  //-- Provider marquee
  case 'PROVIDER': 
    temp  = '<marquee class=marquee1 height="18" scrollamount="4" behavior="scroll"">'
    temp += 'Fidelity Investments&nbsp;&nbsp; '                                       +
            'Great-West Retirement Services&nbsp;&nbsp; '                             +
            'Prudential Financial "Growing and Protecting Your Wealth"&nbsp;&nbsp; '  +
            'Mass Mutual Financial Group&nbsp;&nbsp; '                                +
            'TheStandard&nbsp; '                                                      +
            'John Hancock&nbsp;&nbsp; '                                               +
            'T.RowePrice "Invest with Confidence"&nbsp;&nbsp; '                       +
            'American Funds&nbsp;&nbsp; '                                             +
            'MFS Investment Management&nbsp;&nbsp; '                                  +
            'Nationwide "On Your Side"&nbsp;&nbsp; '                                  +
            'SECURIAN&nbsp; '                                                         +
            'Principal Financial Group&nbsp;&nbsp; '                                  +
            'TransAmerica "The Power of the Pyramid"&nbsp;&nbsp; '                    +
            'SECURITIES RESEARCH&nbsp;&nbsp; '                                        +
            'America United Life Insurance Company'
    temp += '</marquee>'  
    break;
  
  //-- Company marquee
  case 'COMPANY':
    temp  = '<marquee class=marquee1 height="14" scrollamount="4" behavior="scroll">'
    temp += 'Knowledge&nbsp;&nbsp; Resources&nbsp;&nbsp; Goals&nbsp;&nbsp; '            +
            'Benefits&nbsp;&nbsp; Quality&nbsp;&nbsp; Analysis&nbsp;&nbsp; '            +
            'Advice&nbsp;&nbsp; Viglilance&nbsp;&nbsp; Aid&nbsp;&nbsp; '                +
            'Maximize&nbsp;&nbsp; Utilization&nbsp;&nbsp; Benefits&nbsp;&nbsp; '        +
            'Responsibility&nbsp;&nbsp; Liability&nbsp;&nbsp; Investments&nbsp;&nbsp; ' +
            'Options&nbsp;&nbsp; Education&nbsp;&nbsp; Advise&nbsp;&nbsp; '             +
            'Needs&nbsp;&nbsp; Goals&nbsp;&nbsp; Manage&nbsp;&nbsp; '                   +
            'Retirement&nbsp;&nbsp; Income&nbsp;&nbsp; Consulting&nbsp;&nbsp;'
    temp += '</marquee>'
    break;
  
  //-- ContactUs marquee
  case 'ABOUTUS':
    temp  = '<marquee class=marquee1 height="14" scrollamount="4" behavior="scroll">'
    temp += 'Saunders Financial Advisory Inc. is your one stop for all your ' +
            'financial investments, helping secure your future retirement plans.'
    temp += '</marquee>'
    break;
    
  //-- Do nothing if an unknown marquee type
  default: 
  }
return temp
}


//-------------------------------------------------------------------
// StartScreen: Setup initial screen layout, header section and navigation.
// Use: StartScreen('sectionId','nodeId' [, parm1, parm2 ... parmx ])
//   sectionId - ID of the active major section
//   nodeId    - ID of the active minor section
// Optional parameers:   
//   DIRLEVEL=x  Directory level (0=root, 1=one "down", 2=two "down"...)
//               (defaults to 0 (root directory))
//   MARQUEE=x   See "ShowMarquee()" for valid values
//-------------------------------------------------------------------
function StartScreen(sectionId,nodeId) {
  var _dirlevel=0, _marquee=""
  sectionId = sectionId.toUpperCase()
  nodeId    = nodeId.toUpperCase()                     
  //----- scan & evaluate the optional parameters
  for ( var ix=2; 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 'DIRLEVEL' : _dirlevel = data;  break;
    	case 'MARQUEE'  : _marquee  = data;  break;
    	default: alert(keyword + ' is an unknown keyword to StartScreen() in ' + document.URL)
      }
    } 
  setGlobalVars(_dirlevel)
    
//----- Define the navigation icons
navWidth  = 200
navHeight = 30
if (document.images) {
  var button_prefix = "main_"
  var ip = top.ImagePath + button_prefix
//advisoriesdown        = new Image(navWidth,navHeight); advisoriesdown.src        = ip + "advisories_down.gif";
//advisorieshere        = new Image(navWidth,navHeight); advisorieshere.src        = ip + "advisories.gif";
//advisoriesover        = new Image(navWidth,navHeight); advisoriesover.src        = ip + "advisories_over.gif";
//advisoriesup          = new Image(navWidth,navHeight); advisoriesup.src          = ip + "advisories_up.gif";
  chartsdown            = new Image(navWidth,navHeight); chartsdown.src            = ip + "stockmarketcharts_down.gif";
  chartshere            = new Image(navWidth,navHeight); chartshere.src            = ip + "stockmarketcharts.gif";
  chartsover            = new Image(navWidth,navHeight); chartsover.src            = ip + "stockmarketcharts_over.gif";
  chartsup              = new Image(navWidth,navHeight); chartsup.src              = ip + "stockmarketcharts_up.gif";
  contactusdown         = new Image(navWidth,navHeight); contactusdown.src         = ip + "contactus_down.gif";
  contactushere         = new Image(navWidth,navHeight); contactushere.src         = ip + "contactus.gif";
  contactusover         = new Image(navWidth,navHeight); contactusover.src         = ip + "contactus_over.gif";
  contactusup           = new Image(navWidth,navHeight); contactusup.src           = ip + "contactus_up.gif";
  glossarydown          = new Image(navWidth,navHeight); glossarydown.src          = ip + "glossaryofterms_down.gif";
  glossaryhere          = new Image(navWidth,navHeight); glossaryhere.src          = ip + "glossaryofterms.gif";
  glossaryover          = new Image(navWidth,navHeight); glossaryover.src          = ip + "glossaryofterms_over.gif";
  glossaryup            = new Image(navWidth,navHeight); glossaryup.src            = ip + "glossaryofterms_up.gif";  
  homedown              = new Image(navWidth,navHeight); homedown.src              = ip + "home_down.gif";
  homehere              = new Image(navWidth,navHeight); homehere.src              = ip + "home.gif";
  homeover              = new Image(navWidth,navHeight); homeover.src              = ip + "home_over.gif";
  homeup                = new Image(navWidth,navHeight); homeup.src                = ip + "home_up.gif";
  mlsdown               = new Image(navWidth,navHeight); mlsdown.src               = ip + "marketletterssource_down.gif";
  mlshere               = new Image(navWidth,navHeight); mlshere.src               = ip + "marketletterssource.gif";
  mlsover               = new Image(navWidth,navHeight); mlsover.src               = ip + "marketletterssource_over.gif";
  mlsup                 = new Image(navWidth,navHeight); mlsup.src                 = ip + "marketletterssource_up.gif";
  opiniondown           = new Image(navWidth,navHeight); opiniondown.src           = ip + "marketeconomicopinion_down.gif";
  opinionhere           = new Image(navWidth,navHeight); opinionhere.src           = ip + "marketeconomicopinion.gif";
  opinionover           = new Image(navWidth,navHeight); opinionover.src           = ip + "marketeconomicopinion_over.gif";
  opinionup             = new Image(navWidth,navHeight); opinionup.src             = ip + "marketeconomicopinion_up.gif";
  ourcompanydown        = new Image(navWidth,navHeight); ourcompanydown.src        = ip + "ourcompany_down.gif";
  ourcompanyhere        = new Image(navWidth,navHeight); ourcompanyhere.src        = ip + "ourcompany.gif";
  ourcompanyover        = new Image(navWidth,navHeight); ourcompanyover.src        = ip + "ourcompany_over.gif";
  ourcompanyup          = new Image(navWidth,navHeight); ourcompanyup.src          = ip + "ourcompany_up.gif";
  presentationsdown     = new Image(navWidth,navHeight); presentationsdown.src     = ip + "presentations_down.gif";
  presentationshere     = new Image(navWidth,navHeight); presentationshere.src     = ip + "presentations.gif";
  presentationsover     = new Image(navWidth,navHeight); presentationsover.src     = ip + "presentations_over.gif";
  presentationsup       = new Image(navWidth,navHeight); presentationsup.src       = ip + "presentations_up.gif";
  providerlinksdown     = new Image(navWidth,navHeight); providerlinksdown.src     = ip + "providerlinks_down.gif";
  providerlinkshere     = new Image(navWidth,navHeight); providerlinkshere.src     = ip + "providerlinks.gif";
  providerlinksover     = new Image(navWidth,navHeight); providerlinksover.src     = ip + "providerlinks_over.gif";
  providerlinksup       = new Image(navWidth,navHeight); providerlinksup.src       = ip + "providerlinks_up.gif";
  servicesdown          = new Image(navWidth,navHeight); servicesdown.src          = ip + "services_down.gif";
  serviceshere          = new Image(navWidth,navHeight); serviceshere.src          = ip + "services.gif";
  servicesover          = new Image(navWidth,navHeight); servicesover.src          = ip + "services_over.gif";
  servicesup            = new Image(navWidth,navHeight); servicesup.src            = ip + "services_up.gif";
  }

//----- define web page's layout
temp  = '<body background="' + top.ImagePath + 'gbc3.gif" '             +
              'rightmargin=0 bottommargin=0 '                           +
              'marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>'
document.writeln(temp)

//----- overall table for the entire page
temp  = '<table border="4" width="900" align=center cellpadding="2" '   +
               'bordercolor="#525961" bgcolor="#FFFFFF">'               +
        '<tr><td width="100%" align=center>'

//----- Begin the logo section (do Flash version if on home page, else show the logo image)
temp += '<table border="1" cellspacing="1" width="800" '                +
               'bordercolor="#EFEFEF" bgcolor="#FFFFFF"><tr><td>'
document.writeln(temp); temp = ""
if ( sectionId == 'HOME' ) {
	    AC_FL_RunContent(
         'codebase',          'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
         'width',             '900',
         'height',            '265',
		     'src',               'Logomovie',
         'quality',           'high',
         'pluginspage',       'http://www.adobe.com/go/getflashplayer',
         'align',             'middle',
         'play',              'true',
         'loop',              'false',
         'scale',             'showall',
         'wmode',             'window',
         'devicefont',        'false',
         'id',                'Logomovie',
         'bgcolor',           '#ffffff',
         'name',              'Logomovie',
         'menu',              'true',
         'allowFullScreen',   'false',
         'allowScriptAccess', 'sameDomain',
         'movie',             top.ImagePath + "Logomovie",
         'salign',            ''
         )
      }
    else {
    	document.write('<img src="' + top.ImagePath + 'SFAG_Header_Logo6.gif">')
      }  
document.writeln('</td></tr></table>')
//----- end of logo section

//----- define the page's overall layout below the logo section
  document.write('<img src="' + top.ImagePath + 'spacer.gif" width="5" height="6"><br>')
  document.write('<table width="100%" cellspacing="0" cellpadding="1">' +
                 '<tr valign=top align=left><td width="150">')

//----- start navigation portion (down left side of screen)

//----- Home ------
  document.write(SectionLink(sectionId, 'HOME', 'index.html', 'Home'))
  if ( sectionId == 'HOME' ) {
      }
//----- Services -----
  document.write(SectionLink(sectionId, 'SERVICES', 'services.html', 'Services'))
  if ( sectionId == 'SERVICES' ) {
    tempstr = '' +
      NodeLink(nodeId, 'PLAN_DESIGN',             'plan_design.html',             'Plan Design')               +
      NodeLink(nodeId, '404GUIDANCE',             '404guidance.html',             '404(a) / 404(c) Guidance')  +
      NodeLink(nodeId, 'PROVIDER_BENCHMARKING',   'provider_benchmarking.html',   'Provider Benchmarking')     +
      NodeLink(nodeId, 'INVESTMENT_ANALYSIS',     'investment_analysis.html',     'Investment Analysis')       +
      NodeLink(nodeId, 'EMPLOYEE_COMMUNICATIONS', 'employee_communications.html', 'Employee Communications')   +
      '<br>'
    document.write(tempstr)
   	}

//----- Market/Economic Opinions -----
  document.write(SectionLink(sectionId, 'OPINION', 'Opinion-20100701.html', 'Market/Economic Opinions'))
  if ( sectionId == 'OPINION' ) {
    tempstr = '' +
	  NodeLink(nodeId, 'OPINION-20100701',                 'Opinion-20100701.html',                 '01 July 2010 (Current)')
+	  
	  NodeLink(nodeId, 'OPINION-20100510',                 'Opinion-20100510.html',                 '10 May 2010')
+	
      NodeLink(nodeId, 'OPINION-20100413',                 'Opinion-20100413.html',                 '13 April 2010')
+        
      NodeLink(nodeId, 'OPINION-20100301',                 'Opinion-20100301.html',                 '1 March 2010')                     +    
      NodeLink(nodeId, 'OPINION-20100129',                 'Opinion-20100129.html',                 '29 January 2010')                  +    
      NodeLink(nodeId, 'OPINION-20091102',                 'Opinion-20091102.html',                 '2 November 2009')                  +    
      NodeLink(nodeId, 'OPINION-20091001',                 'Opinion-20091001.html',                 '1 October 2009')                   +          
      NodeLink(nodeId, 'OPINION-20090722',                 'Opinion-20090722.html',                 '22 July 2009')                     +          
      NodeLink(nodeId, 'OPINION-20090612',                 'Opinion-20090612.html',                 '12 June 2009')                     +      
      NodeLink(nodeId, 'NEWSLETTER-04-2009',               'Newsletter-04-2009.html',               '1 April 2009')                     +  
      NodeLink(nodeId, 'MARKETNEWS-20090205',              'MarketNews-20090205.html',              '5 February 2009')                  +
      NodeLink(nodeId, 'MARKETNEWS-20081217',              'MarketNews-20081217.html',              '17 December 2008')                 +
      NodeLink(nodeId, 'MARKETNEWS-5NOV2008',              'MarketNews-5Nov2008.html',              '5 November 2008')                  +
      NodeLink(nodeId, 'OCTOBER2008MARKETLETTER-20081008', 'October2008MarketLetter-20081008.html', '8 October 2008')                   +
      NodeLink(nodeId, 'BEARMARKETSTUDY-20080929',         'BearMarketStudy-20080929.html',         '29 Sep 2008 - Bear Market Study')  +
      NodeLink(nodeId, 'OPINION-20080811',                 'Opinion-20080811.html',                 '11 August 2008')                   +
      NodeLink(nodeId, 'OPINION-20080708',                 'Opinion-20080708.html',                 '8 July 2008')                      +
      NodeLink(nodeId, 'OPINION-20080527',                 'Opinion-20080527.html',                 '27 May 2008')                      +
      NodeLink(nodeId, 'OPINION-20080428',                 'Opinion-20080428.html',                 '28 April 2008')                    +
      NodeLink(nodeId, 'OPINION-20080122',                 'Opinion-20080122.html',                 '22 January 2008')                  +
      NodeLink(nodeId, 'OPINION-20070226',                 'Opinion-20070226.html',                 '26 Feb 2007')                      +
      NodeLink(nodeId, 'OPINION-20071026',                 'Opinion-20071026.html',                 '26 October 2007')                  +
      NodeLink(nodeId, 'OPINION-20070719',                 'Opinion-20070719.html',                 '19 July 2007')                     +            
      '<br>'
    document.write(tempstr)
   	}

//----- Stock Market Charts -----
  document.write(SectionLink(sectionId, 'CHARTS', './StockMarketCharts/index.html', 'Stock Market Charts'))
  if ( sectionId == 'CHARTS' ) {
    tempstr = '' +
      NodeLink(nodeId, 'DOWJONESDAILY_20100701',           './StockMarketCharts/DowJonesDaily_20100701.html',      'Dow Jones Daily: 07/09-06/10')      +
      NodeLink(nodeId, 'DOWJONESLONGTERM_20091110',        './StockMarketCharts/DowJonesLongTerm_20091110.html',   'Dow Jones Long-Term: 1995-2009')    +
      NodeLink(nodeId, 'OIL_20091111',                     './StockMarketCharts/Oil_20091111.html',                'Oil: 1/07-11/09')                   +
      NodeLink(nodeId, 'TRANSPORTATION_20091110',          './StockMarketCharts/Transportation_20091110.html',     'Transportation Index: 11/08-11/09') +            
      '<br>'
    document.write(tempstr)
   	}
   	
//----- Glossary of Terms -----
  document.write(SectionLink(sectionId, 'GLOSSARY', 'GlossaryOfTerms.html', 'Glossary of Terms'))
  if ( sectionId == 'GLOSSARY' ) {
   tempstr = '' +
      NodeLink(nodeId, 'GLOSSARYOFTERMS',                  'GlossaryOfTerms.html',              'Market Technical Terminology')            +
      NodeLink(nodeId, 'SECULARBEARMARKETS',               'SecularBearMarkets.html',           'Secular Bear Markets - 16 March 2009')    +            
      '<br>'
    document.write(tempstr)
   	}
   	
//----- Presentations -----
//document.write(SectionLink(sectionId, 'PRESENTATIONS', 'presentations/index.html', 'Presentations'))
//if ( sectionId == 'PRESENTATIONS' ) {
//  tempstr = '' +
//    NodeLink(nodeId, 'LANDAIR',                'javascript:PopPres(\'LandAir/LandAir_presentation.asp\')',              'LandAir')             +
//    NodeLink(nodeId, 'FORWARDAIR',             'javascript:PopPres(\'ForwardAir/ForwardAir_presentation.asp\')',        'Forward Air')         +
//    NodeLink(nodeId, 'STARTRANSPORTATION',     'javascript:PopPres(\'StarTransportation/StarTrans_presentation.asp\')', 'Star Transportation') +
//    '<br>'
//  document.write(tempstr)
// 	}

//----- Provider Links -----
  document.write(SectionLink(sectionId, 'PROVIDERLINKS', 'ProviderLinks/ProviderLinks.html', 'Provider Links'))
  if ( sectionId == 'PROVIDERLINKS' ) {
     	}
     	
//----- Market Letters Source -----
  document.write(SectionLink(sectionId, 'MLS', 'MarketLettersSource.html', 'Market Letters Source'))
  if ( sectionId == 'MLS' ) {
     	}
    	
//----- Our Company -----
  document.write(SectionLink(sectionId, 'OURCOMPANY', 'company.html', 'Our Company'))
  if ( sectionId == 'OURCOMPANY' ) {
     	}

//----- CONTACT US ------
  document.write(SectionLink(sectionId, 'CONTACTUS', 'ContactUs.html', 'Contact Us'))
  if ( sectionId == 'CONTACTUS' ) {
      }

//----- end the navigation portion (left vertical column), then begin the cell which is the major portion of the page
  document.write('</td><td width=5>' +
                 '<img src="' + top.ImagePath + 'spacer.gif" width="5" height="3"></td>' +
                 '<td>' + ShowMarquee(_marquee) )
  return
  }

//-------------------------------------------------------------------
// EndScreen: Finish and close the table begun by "StartScreen()"
// Use: EndScreen( [ parm1 [, parm2, parm3, ... , parmx ] ] )
//      parm - any one of the following parameters:
//         { DATE | NODATE }        Default: DATE
//              Should the date of the calling HTML file be shown?
//         { FEED | NOFEED }        Default: FEED
//              Should a Feedback-type link be included?
//         { HITBOX | NOHITBOX }    Default: NOHITBOX
//              Should the "hitbox" be generated for tracking hits?
//         { SUPPORT | NOSUPPORT }  Default: SUPPORT
//              Should the website support info be shown?
//-------------------------------------------------------------------
function EndScreen() {
	var _date=true, _feed=true, _hitbox=false, _support=true
  //----- 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 'HITBOX'   : _hitbox  = true;  break;
      case 'NOHITBOX' : _hitbox  = false; break;
      case 'SUPPORT'  : _support = true;  break;
      case 'NOSUPPORT': _support = false; break;
      default: alert(keyword + ' is an unknown keyword to PageBottom() in ' + document.URL)
      }
    }

//----- End the screen and show copyright
  document.writeln('</td></tr></table>')
  temp  = '<p><table border="1" cellspacing="1" width="100%" bgcolor="#525961" height="25">' +
          '<tr><td width="100%" height="20" align=center>'
  temp += '<span class="copyright">' +
          '©2006-2010 Saunders Financial Advisory Group, Inc.&nbsp; All rights reserved.' +
          '</span>'
  temp += '</td></tr></table>'
  document.writeln(temp); temp=""

//----- generate the appropriate HTML
  if ( _date || _feed || _hitbox || _support ) {  // generate footer if needed
    document.write('<table width="908" align=center><tr valign=top>')
    if ( _support )
           { temp = '<span class="footsupport">' +
//                  '<nobr>Site created by: <a target="_blank" href="http://www.studio4design.net">www.studio4design.net</a></nobr>' +
                    '<nobr>Site maintained by: <a target="_blank" href="http://www.CandGWeb.com">C&amp;G Web Enterprises</a></nobr>' +
                    '</span>'
             }
      else { temp = '&nbsp;' }
    document.write('<td>' + temp + '</td>')
    if ( _hitbox )
           { temp = '<img src="http://comm1.digits.com/wc/candgweb">' }
      else { temp = '&nbsp;' }
    document.write('<td width="30%" valign=top align=center>' + temp + '</td>')
    temp = '<td align=right valign=top>'
    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:' + author_email +
              '?subject=SaundersGroup.com%20Website%20Feedback%20(' +
              document.location.href + ')">' +
              'Tell us about it!</a></nobr></span>'
      }
    document.writeln(temp + '</td></tr></table></center>')
    }
  return
  }



//-------------------------------------------------------------------
// PageTop: Create top-of-page HTML text for the "data" portion of the web page
//    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 "titlepage" class 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 + 'printer2.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 for the "data" portion of the web page
//    PageBottom( [ parm1 [, parm2, parm3, ... , parmx ] ] )
//      parm - any one of the following parameters:
//         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 ]   Default: NORETURN
//              Should a "return-to-calling-page" link be generated?
//-------------------------------------------------------------------
function PageBottom() {
  var _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 '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' : '')
           temp = '<hr size=1 width="100%">'
           }
    else { temp = '<p><hr size=1 width="75%" align=center>'
    	    }
  temp += '<div class=offer>'                                              +
          'Securities offered solely through Securities Research, Inc., Member FINRA and SIPC.<br>' +
          'Investment Advisory offered through SCS Asset Management, Inc.<br>' +
          'Saunders Financial is independent of Securities Research, Inc.' +
          '</div>'
  document.writeln(temp + '<br></td></tr></table>')
  }


//-------------------------------------------------------------------
// Miscellanous routines for the navigation graphics
//-------------------------------------------------------------------

// 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)
//   callerid  - Section ID of requester
//   thisitem  - Section ID associated with the following items
//   thisurl   - URL of target file
//   navtitle  - description for the "bubble" text
//-------------------------------------------------------------------
function SectionLink(callerid,thisitem,thisurl,navtitle) {
  if (thisurl == undefined) thisurl = ''
  if (thisurl.substr(0,1) == '!')
         thisurl = thisurl.substr(1)
    else thisurl = top.baseURL + '/' + thisurl
  imgprefix = thisitem.toLowerCase()
  if (callerid == thisitem)
         { result = '<a href="' + thisurl + '">' +
                    '<img src="' + eval(imgprefix + 'here.src') + '" ' +
                    'border=0 width=' + navWidth + ' height=' + navHeight +
                    ' name="' + imgprefix + '" alt="' + navtitle + '"></a>' }
    else { result = '<a href="' + thisurl + '" ' +
                    'onMousedown=ImgDown("' + imgprefix + '") ' +
                    'onMouseOver=ImgOver("' + imgprefix + '") ' +
                    'onMouseOut=ImgUp("'    + imgprefix + '")>' +
                    '<img src="' + eval(imgprefix + 'up.src') + '" ' +
                    'border=0 width=' + navWidth + ' height=' + navHeight +
                    ' name="' + imgprefix + '" alt="' + navtitle + '"></a>' }
                    
  return result + '<br><img src="' + top.ImagePath + 'spacer.gif" width=5 height=5><br>'
  }


//-------------------------------------------------------------------
// NodeLink: Generate HTML for a node "under" a major section
// Use: NodeLink(callerid,thisitem,thisurl,thisdesc)
//   callerid  - Node ID of requester
//   thisitem  - Node ID associated with the following items
//   thisurl   - URL of target file
//   thisdesc  - text for the link description
//-------------------------------------------------------------------
function NodeLink(callerid,thisitem,thisurl,thisdesc) {
  if ( callerid == thisitem )
         linkclass = 'nodehere'
    else linkclass = 'nodenothere'
  if ( thisurl.substr(thisurl,11) == "javascript:")
         { temp = thisurl }
    else { temp = top.baseURL + '/' + thisurl }
  return '<img src="' + top.ImagePath + 'rightred2.gif" align=bottom width=7 height=14>'  +
         ' <a href="' + temp + '">'                          +
         '<span class=' + linkclass + '>' + thisdesc + '</span></a><br>'
  }


//-------------------------------------------------------------------
// ScriptFN: Returns only the filename of a URL
// Use: ScriptFN([url])
//      If no URL is 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  = window.screen.width  - 40
  if ( popx      == null ) popx      = 20
  if ( popheight == null ) popheight = window.screen.height - 40
  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()
  }
//-------------------------------------------------------------------
// PopPres: "Pop-up" a window for a presentation
//-------------------------------------------------------------------
function PopPres(popfile) {
  popx      = 20
  popy      = 40
  popwidth  = Math.min(1120,window.screen.width - 40)
  popheight = Math.min(620,window.screen.height - 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,'present', screenopts)
  window.popwin.focus()
  }

//-------------------------------------------------------------------
// ShowClose: Display the text to close a pop-up window
//-------------------------------------------------------------------
function ShowClose(sc1p) {
  document.writeln(ShowClose2(sc1p))
  return null
  }
//----- ShowClose2: Returns text to close a pop-up window
function ShowClose2(sc2p) {
  if ( sc2p == null ) sc2p = ''
  if ( sc2p == ''   ) sc2p = 'right'
  return '<table width="100%"><tr>' +
         '<td align=' + sc2p + ' valign=baseline class="closetext">' +
         '<a href="javascript:window.close();">' +
         '<img src="' + ImagePath + 'close_cross.gif" ' +
         'border=0 width=10 height=10></a> ' +
         '<a href="javascript:window.close();">Close window</td>' +
         '</tr></table>'
  }


//-------------------------------------------------------------------
// More(url): Show "More" to associated page
//-------------------------------------------------------------------
function More(closeurl) {
  closeurl = '<span class=moretext><nobr>&nbsp; &nbsp;' +
             '<a href="' + closeurl + '">More...' +
             '<img src="' + ImagePath + 'rightred2.gif" ' +
             'width=7 height=14 border=0></a></nobr></span>'
  document.writeln(closeurl)
  return
  }


//-------------------------------------------------------------------
// ShowChartTitle: Show the title for a Stock Market Chart
//     ShowChartTitle(title-of-chart)
// ShowChart:      Show a Stock Market Chart
//     ShowChart(ImageName,ImgOpts [, parm1, parm2, ... ] )
//         parmx = If newsletter link(s) are referenced in the chart:
//             "l,t,r,b,url,alt" - "left,top,right,bottom" are the coordinates of the title in the graphic
//                                 "url" - url to invoke
//                                 "alt" - any ALT= text to display for this link
//-------------------------------------------------------------------
function ShowChartTitle(ChartTitle) {
	document.writeln('<h2>' + ChartTitle + '</h2>')
	return
  }
function ShowChart(ChartImageName,ImgOpts) {
  if ( ImgOpts == undefined ) ImgOpts = ''
  ChartNum  = ChartNum + 1
  LetterNum = 0
  mapstr    = ""
  tempstr   = ""
  letterstr = ""
//----- scan & evaluate any optional parameters
  for ( var ix=2; ix < arguments.length; ix++ ) {
    thisParm = arguments[ix]
    if ( thisParm == '' ) continue      // ignore null parms
    LetterNum = LetterNum + 1
    if ( mapstr == "" ) mapstr = "<map name=chart" + ChartNum + ">"
    tempray = thisParm.split(',',6)
    if ( tempray[5] =  undefined ) tempray[5] = ""
    if ( tempray[5] == ""        ) tempray[5] = "Display this newsletter"
    mapstr = mapstr + "<area  href='" + tempray[4] + "'" +
                             " alt='" + tempray[5] + "'" +
                          " coords='" + tempray[0] + "," + tempray[1] + "," + tempray[2] + "," + tempray[3] + "'>"
    } 
  if ( mapstr !== "" ) {
    mapstr = mapstr + "</map>"
    ImgOpts = ImgOpts + " usemap=#chart" + ChartNum
    }
  numstring = "One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve"
  tempray = numstring.split(' ',12)
  switch (LetterNum) {
  	case 0:  break;
  	case 1:  letterstr = "A Market/Economic Opinion letter is"
  	         break;
  	default: letterstr =  tempray[LetterNum-1] + " Market/Economic Opinion letters are" 
    }
  if ( letterstr !== "" ) {
  	letterstr = "<span class=chartletter>(" + letterstr + " referenced by this chart.  Click the letter's name to view it. " +
  	            "When you are finished, use your browser's back-arrow to return here.)</span>"
    }  
  tempstr = mapstr + tempstr + letterstr +
           "<p><table border='2'  bordercolor='#0F2C90' cellpadding='5'>" +
              "<tr><td>" +
              "<img src='" + ChartImageName + "' " + ImgOpts + " border='0'>" +
              "</td></tr></table>"
  document.writeln(tempstr)
  return
  }

//-------------------------------------------------------------------
// 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>')
  }

//-------------------------------------------------------------------
// 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="Previously displayed page">' +
                       'Previously displayed 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
  }


//----------------------------------------------------------------------------------------
// Flash related routines
//----------------------------------------------------------------------------------------
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2008 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
	var version;
	var axo;
	var e;
	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";
			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";
			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
  document.write(str);
}
function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    
    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}