/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var theSitetree=[ 
	['PAGE','87',jdecode('Home'),jdecode(''),'/87.html','true',[],''],
	['PAGE','1129',jdecode('About+us'),jdecode(''),'/1129.html','true',[],''],
	['PAGE','15201',jdecode('Sweet+Sound'),jdecode(''),'/15201.html','true',[],''],
	['PAGE','1138',jdecode('Books%2FOrdering'),jdecode(''),'/1138/index.html','true',[ 
		['PAGE','1147',jdecode('Homespun'),jdecode(''),'/1138/1147.html','true',[],''],
		['PAGE','1156',jdecode('I+Was+A+Teen...'),jdecode(''),'/1138/1156.html','true',[],''],
		['PAGE','1165',jdecode('Ch.+Companion'),jdecode(''),'/1138/1165.html','true',[],'']
	],''],
	['PAGE','1174',jdecode('Nest+Egg'),jdecode(''),'/1174/index.html','true',[ 
		['PAGE','1183',jdecode('Nena%26%23x27%3Bs+Nest'),jdecode(''),'/1174/1183.html','true',[],''],
		['PAGE','1192',jdecode('Red+Maple+Press'),jdecode(''),'/1174/1192.html','true',[],''],
		['PAGE','1201',jdecode('Worship+Arts'),jdecode(''),'/1174/1201.html','true',[],'']
	],''],
	['PAGE','1210',jdecode('JO+1970+Reunions'),jdecode(''),'/1210.html','true',[],''],
	['PAGE','1219',jdecode('Extras'),jdecode(''),'/1219/index.html','true',[ 
		['PAGE','1228',jdecode('Jeff%26%23x27%3Bs+PPT'),jdecode(''),'/1219/1228.html','true',[],''],
		['PAGE','1237',jdecode('Me+2+and+Too%21'),jdecode(''),'/1219/1237.html','true',[],'']
	],''],
	['PAGE','8353',jdecode('Guestbook'),jdecode(''),'/8353/index.html','true',[ 
		['PAGE','8352',jdecode('Read+Guestbook'),jdecode(''),'/8353/8352.html','false',[],'']
	],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Nature';
theSitetree.paletteFamily='8C8B8C';
theSitetree.keyvisualId='3642';
theSitetree.keyvisualName='kv_3642.jpg';
theSitetree.fontsetId='10717';
theSitetree.graphicsetId='10884';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Nature',
				paletteFamily: 	'8C8B8C',
				keyvisualId: 	'3642',
				keyvisualName: 	'kv_3642.jpg',
				fontsetId: 		'10717',
				graphicsetId: 	'10884',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'8C8B8C',
				e_color: 		'8C8B8C',
				f_color: 		'8C8B8C',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2045068']={
webappId:    '1501',
documentId:  '87',
internalId:  '2045068',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1129',
internalId:  '',
customField: '20090627-190013'
};
webappMappings['1002']=webappMappings['1002-8353AHW050IN3VEL']={
webappId:    '1002',
documentId:  '8353',
internalId:  '8353AHW050IN3VEL',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '87',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87',
internalId:  '',
customField: '20090629-234544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1138',
internalId:  '',
customField: '20090629-232050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1147',
internalId:  '',
customField: '20090629-232945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1156',
internalId:  '',
customField: '20090629-233546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1165',
internalId:  '',
customField: '20090629-233741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1174',
internalId:  '',
customField: '20061220-052945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20061220-045521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1192',
internalId:  '',
customField: '20061220-050122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20061220-053623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1210',
internalId:  '',
customField: '20090625-155345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1219',
internalId:  '',
customField: '20061216-230236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1228',
internalId:  '',
customField: '20061216-230236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1237',
internalId:  '',
customField: '20061216-230236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8353',
internalId:  '',
customField: '20070102-050039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8352',
internalId:  '',
customField: '20070102-050039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20090629-232711'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3VEL';
var companyName   = 'Red+Maple+Press';
var htmlTitle	  = 'Red+Maple+Press+presents+.+.+.';
var metaKeywords  = '';
var metaContents  = '';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
