// Build Secondary Left Navigation// Instructions for adding or deleting any navigation element
//  make sure each line starts with the single quote: (') and ends with: (' + sep +)
//  except for the last line which only requires ('  ;)
//  each line contains an ID, Hot Text and its URL
//   - the ID is the name needed to change to its state color
//     - note: ID's in the same list can NOT have the same name
//   - the Hot Text is what actually appears on the page
//     - note: If you need to use a single quote (') in the Hot Text
//             then add the \ character. It must be (\') to be treated as text only
//     - note: If you want to break some Hot Text across two lines, 
//             insert a tilde (~) between the words
//   - the URL is the destination web page from its link

//=====================================================================================

// repeating variables
var sep      = ','; 
var nl       = '<br>'; 
var sectpath = section +'/'


// WLTAYLOR IMAGES Left Navigation List
var wltimagesnav = '' +
// secondary_nav_id    : Hot Text                              : URL                '  parser
//---------------------:---------------------------------------:--------------------'-----------
' intro                : Introduction                          : wltimages.htm      '  + sep +
'                      :                                       :                    '  + sep +
'                      : <strong>Ladies Home Journal</strong>  : amliterature.htm   '  + sep +
' amliterature         : American Literature                   : amliterature.htm   '  + sep +
' longfellow           : Longfellow		                       : longfellow.htm     '  + sep +
' newengland           : New England                           : newengland.htm     '  + sep +
' pioneerwest          : Pioneer West                          : pioneerwest.htm    '  + sep +
' religious            : Religious                             : religious.htm      '  + sep +
' songs                : Songs                                 : songs.htm          '  + sep +
' vothers              : Various Others		                   : vothers.htm        '  + sep +
'                      :                                       :                    '  + sep +
'                      : <strong>Books</strong>                : books.htm          '  + sep +
' books                : Books			                       : books.htm          '  ;

// PRINTS & CARDS Left Navigation List
var gallerynav = '' +
// secondary_nav_id    : Hot Text                            : URL               '  parser
//---------------------:-------------------------------------:-------------------'-----------
' intro                : <strong>Introduction</strong>       : gallery.htm       '  + sep +
'                      :                                     :                   '  + sep +
'                      : <strong>Religious</strong>          : religious01.htm   '  + sep +
' meditate             : When I Meditate                     : religious01.htm   '  + sep +
' esther               : Esther                              : religious02.htm   '  + sep +
' shadow               : Under the Shadow                    : religious03.htm   '  + sep +
' david                : Psalm of David                      : religious04.htm   '  + sep +
'                      :                                     :                   '  + sep +
'                      : <strong>New England</strong>        : newengland01.htm  '  + sep +
' shoemaker            : Traveling Shoemaker                 : newengland01.htm  '  + sep +
' barnraising          : Barn Raising                        : newengland02.htm  '  + sep +
' school               : District School                     : newengland03.htm  '  + sep +
' farm                 : Passing of the Farm                 : newengland04.htm  '  + sep +
'                      :                                     :                   '  + sep +
'                      : <strong>Longfellow</strong>         : longfellow01.htm  '  + sep +
' pandj                : Pricilla and John                   : longfellow01.htm  '  + sep +
' ship                 : Building of the Ship                : longfellow02.htm  '  + sep +
' children             : Children&rsquo;s Hour               : longfellow03.htm  '  + sep +
' handm                : Hiawatha and Minnehaha              : longfellow04.htm  '  + sep +
'                      :                                     :                   '  + sep +
'                      : <strong>Books</strong>              : books01.htm       '  + sep +
' three                : Three Musketeers                    : books01.htm       '  + sep +
' luck                 : Luck of Roaring Camp                : books02.htm       '  ;


// BIOGRAPHY Left Navigation List
var bionav = '' +
// secondary_nav_id    : Hot Text                    : URL               '  parser
//---------------------:-----------------------------:-------------------'-----------
' bio                  : Biography                   : bio.htm           '  + sep +
'                      :                             :                   '  + sep +
' letter               : Mary Alice&#146;s Letter    : letter.htm        '  ;


// EXHIBITIONS Left Navigation List
var exhibitsnav = '' +
// secondary_nav_id    : Hot Text                : URL               '  parser
//---------------------:-------------------------:-------------------'-----------
' future               : Future Exhibits         : exhibits.htm      '  + sep +
'                      :                         :                   '  + sep +
' past                 : Past Exhibits           : past.htm          '  ;

// LINKS Left Navigation List
var linksnav = '' +
// secondary_nav_id    : Hot Text                : URL               '  parser
//---------------------:-------------------------:-------------------'-----------
'                      :                         :           '  ;


// Create a method for trimming
String.prototype.normalize = function()
{
  return this.replace( /^\s+/g , '' ).replace( /\s+$/g , '' ).replace( /\s+/g , " " ) ;
}


// Build Left Navigation function
function LeftNav(theNav) {
    if (theNav != '::' || '') {
	var aleftnav = theNav.split(sep);
	document.write('');
	// Insert top of left navigation 
	for (var i = 0; i < aleftnav.length; i++) {
		var result = aleftnav[i].split(':');
		var id     = result[0].normalize(); 
		var text   = result[1].normalize();
		var url    = result[2].normalize();
		if (text.indexOf('~') > -1) { text = text.replace('~',nl) }
		if (id == secondary_nav_id) { state = 'leftnavstate'; }
		else { state = 'leftnav' }
		document.write('<a id="'+ id +'" class="'+state+'" href="'+path+sectpath+url+'">'+text+'</a>' +nl);
		}
	}
}
