// 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 +'/'

// BOOK Left Navigation List
var booknav = '' +
// secondary_nav_id    : Hot Text               : URL                  '  parser
//---------------------:------------------------:----------------------'-----------
' introduction         : Introduction           : book.htm             '  + sep +
' reviews              : Reviews                : reviews.htm          '  + sep +
' orders      		   : Orders        			: orders.htm       	   '  + sep +
' testimonials         : Testimonials           : testimonials.htm     '  + sep +
' toc                  : Chapter Samples        : toc.htm              '  + sep +
' about                : About the Author       : about.htm            '  + sep +
' dedication           : Dedication             : dedication.htm       '  ;	

// FOR PARENTS Left Navigation List
var forparentsnav = '' +
// secondary_nav_id : Hot Text                : URL                    '  parser
//------------------:-------------------------:------------------------'-----------
' introduction      : Introduction            : forparents.htm         '  + sep +
' tips              : Tips                    : tips.htm               '  + sep +
' questionnaire     : Questionnaire           : questionnaire.htm      '  + sep +
' newsletters       : Newsletters			  : newsletters.htm        '  + sep +
' humor             : Humor			          : humor.htm              '  + sep +
' inspiration       : Inspiration			  : inspiration.htm        '  + sep +
' furtherreading    : Further Reading         : furtherreading.htm	   '  ;	

// MEDIA CENTER Left Navigation List
var mediacenternav = '' +
// secondary_nav_id    : Hot Text                 : URL                  '  parser
//---------------------:--------------------------:----------------------'-----------
' introduction         : Introduction             : mediacenter.htm      '  + sep +   
' contactinfo          : Contact Information      : contactinfo.htm      '  + sep +    
' authorinfo           : Author Information       : authorinfo.htm       '  + sep +    
' booksummary          : Book Summary             : booksummary.htm      '  + sep +    
' mediaquestions       : Media Questions          : mediaquestions.htm   '  + sep +    
' interviews           : Interviews & Appearances : interviews.htm       '  ;	

// COMMENTS Left Navigation List	
var commentsnav = '' +
// secondary_nav_id    : Hot Text               : URL                '  parser
//---------------------:------------------------:--------------------'-----------
' introduction         : Introduction           : comments.htm       '  ;

// LINKS Left Navigation List	
var linksnav = '' +
// secondary_nav_id    : Hot Text               : URL                '  parser
//---------------------:------------------------:--------------------'-----------
' general              : General Links          : links.htm          '  ;


// Global and Footer Navigation	
var globalnav = '' +
// global_nav_id   : Hot Text       : URL                           '  parser
//---------------------:------------------------:--------------------------'-----------
' forparents       : For Parents    : forparents/forparents.htm     '  + sep +
' book             : Book           : book/book.htm                 '  + sep +
' mediacenter      : Media Center   : mediacenter/mediacenter.htm   '  + sep +
' comments         : Comments       : comments/comments.htm         '  + sep +
' drhall           : Dr. Hall       : book/about.htm                '  + sep +
' links            : Links          : links/links.htm               '  ;	

//=====================================================================================



// Create a method for trimming
String.prototype.normalize = function()
{
  return this.replace( /^\s+/g , '' ).replace( /\s+$/g , '' ).replace( /\s+/g , " " ) ;
}


// Before Left Nav
beforeleftnav =
'<td valign="top"><img src="' + path + 'images/spacer.gif" width="10" height="1" border="0"></td><td align="right" valign="top"><img src="' +path + 'images/spacer.gif" width="155" height="63" border="0">'

// Build Left Navigation function
function LeftNav(theNav) {
    if (theNav != '::' || '') {
	var aleftnav = theNav.split(sep);
	document.write('&nbsp;<br>');
	// 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);
		}
	}
}

// Order Book
orderbook =
'<br>&nbsp;<br><a href="' +path + 'book/orders.htm"><img src="' +path + 'images/book_ord.gif" width="118" height="195" alt="Order Today!" title="Order Today!" border="0"></a>'

// After Left Nav
if (ie3||ie4||ie5)  { yellowlineheight = '100%'; }
else { yellowlineheight = '250' }

afterleftnav =
'</td><td width="15" align="right" valign="top">&nbsp;&nbsp;&nbsp;<img src="' +path + 'images/yellowline.gif" width="2" height="' + yellowlineheight +'" border="0"></td>'



// Main Footer Navigation (note year is a variable)
var year = '2002';

Footer = '<br><img src="../images/spacer.gif" width="450" height="1" alt="" border="0"></td></tr></table><p><table width="100%" border="0"  cellpadding="0" cellspacing="0"><tr><td bgcolor="003366" align="center" width="650"><p align="center" class="footer">&nbsp;<br><a href="#top" class="footer">Back to Top</a><br><a href="' + forparents_url + '" class="footer">FOR PARENTS</a>&nbsp;&nbsp;&nbsp;&#149;&nbsp;&nbsp;&nbsp;<a href="' + book_url + '" class="footer">BOOK</a>&nbsp;&nbsp;&nbsp;&#149;&nbsp;&nbsp;&nbsp;<a href="' + mediacenter_url + '" class="footer">MEDIA CENTER</a>&nbsp;&nbsp;&nbsp;&#149;&nbsp;&nbsp;&nbsp;<a href="' + comments_url + '" class="footer">COMMENTS</a>&nbsp;&nbsp;&nbsp;&#149;&nbsp;&nbsp;&nbsp;<a href="' + drhall_url + '" class="footer">DR. HALL</a>&nbsp;&nbsp;&nbsp;&#149;&nbsp;&nbsp;&nbsp;<a href="' + links_url + '" class="footer">LINKS</a>&nbsp;&nbsp;&nbsp;&#149;&nbsp;&nbsp;&nbsp;<a href="' + home_url + '" class="footer">HOME</a><br><br>Copyright &copy; 1996-2010 David C Hall MD/FamilyHealing.com<br><a href=mailto:drdave@familyhealing.com class="footer">drdave@familyhealing.com</a><br>Site updated January 7, 2010</a><br>&nbsp;</td><td bgcolor="003366"><img src="images/spacer.gif" width="100%" height="1" alt="" border="0"></td></tr></table>'
