/* JavaScript Document

// *************************************************************************************
// Horizontal Links Navigation Javascript
// Usage: In the head of your document put this script. (you knew that, right?)
//        In the body of your document put: <SCRIPT Language="JavaScript">HNav()</script
//      * Change the BaseURL1 to your base URL.
//      * Though not necessary, if using a betatest site or two hosts or any form of second host,
//        change the BaseURL2 to that URL. BaseURL2 can be left blank.
//      * This script draws on your folder names... good names = good navigation. Bad names = bad navigation.
//      * In lieu of spaces in folder names, you can use the underscore character.
//      * the var 'IndexFile' is used if you want to use something other than 'index.htm' in your folder
//        structure. For example, I like 'Home.htm'. If you do use index.htm or index.html (or whatever your
//        server automatically dishes up), blank out IndexFile to ''.
//
// Version: 0.92
// Date: 30JAN2003
// Author: Eric Zander (eric_zander@yahoo.com)
//
// NOTE: This script is free... please send me an email letting me know you're using it and what you think.
//
// *************************************************************************************
*/

function HNav() {

/* though all variables are here, the only three you'll need to worry about are the first 3,
// HTMLString1, and HTMLString2.
// BaseURL1 and BaseURL2 are explained above. You can change the look of your navigation text by
// modifying HTMLString1. HTMLString2 is the character used as a seperator.
*/

var BaseURL1 = "livingmemorialsproject.net/"
var BaseURL2 = ""
var IndexFile = "index.htm"

var DocURLRef = document.URL
var DocURL = DocURLRef
var DocURLSplit = ''

var HomeURL = ''
var TextURL = ''
var LinkURL = ''
var LinkURLSpacer = ''
var HTMLString = ''
var HTMLString1 = ''
var HTMLString2 = ' &gt; '
var HTMLString3 = ''

/* Check for which URL is used. BaseURL1 is the default.*/

if (BaseURL1 || BaseURL2 !='') {
	if (DocURL.search(BaseURL1)!= -1){
		DocURL=DocURL.slice(DocURL.indexOf(BaseURL1) + BaseURL1.length)
		HomeURL = DocURLRef.slice(0, DocURLRef.indexOf(BaseURL1) + BaseURL1.length) + 'index.htm'
		}
	if (DocURL.search(BaseURL2)!= -1 && BaseURL2 !='') {
		DocURL=DocURL.slice(DocURL.indexOf(BaseURL2) + BaseURL2.length)
		HomeURL = DocURLRef.slice(0, DocURLRef.indexOf(BaseURL2) + BaseURL2.length) + 'index.htm'
		}
	}



/* split you string into an array. Each folder will get it's own array value*/

DocURLSplit = DocURL.split('/')

/* build the relative paths*/

for (var i=0; i<(DocURLSplit.length-1); i++) {
	LinkURLSpacer+='../'
	}

/* build the actual string from right to left (reverse of how you'd read it) using relative links.*/

for (var i=0; i<(DocURLSplit.length-1); i++) {
	LinkURL = LinkURLSpacer + DocURLSplit[i] + '/'+ IndexFile
	TextURL = DocURLSplit[i].replace(/_/g, " ")

	if(i==(DocURLSplit.length-2)){ // the far right folder is not a link.
	HTMLString += HTMLString2 + TextURL
	LinkURLSpacer = LinkURLSpacer.slice(0,-3)
	}
	else{ // but every other folder is.
	HTMLString += HTMLString2 + '<a href="'+LinkURL+'" class="crumb" target="_parent">'+TextURL+'</a>'
	LinkURLSpacer = LinkURLSpacer.slice(0,-3)
	}
	}

/* now add the home link and output it to you HTML document.*/

HTMLString = HTMLString1.concat("LIVING MEMORIALS PROJECT".link(HomeURL), HTMLString, HTMLString3)
document.writeln(HTMLString)
}