/* [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 POS_TARGET=8;
var theSitetree=[ 
	['PAGE','12101',jdecode('Home'),jdecode(''),'/12101/index.html','true',[ 
		['PAGE','23701',jdecode('Mother%26%23x27%3Bs+Tribute'),jdecode(''),'/12101/23701.html','true',[],'','']
	],'',''],
	['PAGE','6936',jdecode('Life%26%23x27%3Bs+Journey'),jdecode(''),'/6936/index.html','true',[ 
		['PAGE','16901',jdecode('Today%26%23x27%3Bs+Journey'),jdecode(''),'/6936/16901.html','true',[],'','']
	],'',''],
	['PAGE','17001',jdecode('Devotionals+'),jdecode(''),'/17001/index.html','true',[ 
		['PAGE','17101',jdecode('Prayers'),jdecode(''),'/17001/17101.html','true',[],'',''],
		['PAGE','17122',jdecode('Scriptures'),jdecode(''),'/17001/17122.html','true',[],'','']
	],'',''],
	['PAGE','6852',jdecode('Diamonds'),jdecode(''),'/6852/index.html','true',[ 
		['PAGE','17143',jdecode('In+the+Spirit'),jdecode(''),'/6852/17143.html','true',[],'',''],
		['PAGE','17164',jdecode('Self+Esteem'),jdecode(''),'/6852/17164.html','true',[],'','']
	],'',''],
	['PAGE','6894',jdecode('Pearls'),jdecode(''),'/6894.html','true',[],'',''],
	['PAGE','27401',jdecode('Emeralds'),jdecode(''),'/27401.html','true',[],'',''],
	['PAGE','6873',jdecode('Awakening'),jdecode(''),'/6873.html','true',[],'',''],
	['PAGE','6915',jdecode('Affirmations%2FQuotes'),jdecode(''),'/6915.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Kids';
theSitetree.paletteFamily='FEA971';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17074';
theSitetree.graphicsetId='12446';
theSitetree.contentColor='5A6804';
theSitetree.contentBGColor='F8F8EE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kids',
				paletteFamily: 	'FEA971',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17074',
				graphicsetId: 	'12446',
				contentColor: 	'5A6804',
				contentBGColor: 'F8F8EE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20100814-072234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6852',
internalId:  '',
customField: '20100814-100709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6873',
internalId:  '',
customField: '20100813-095410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6894',
internalId:  '',
customField: '20100721-172905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6915',
internalId:  '',
customField: '20100729-173744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6936',
internalId:  '',
customField: '20100814-080651'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20100825-082102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20100824-101546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20100814-100544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17122',
internalId:  '',
customField: '20100814-095054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17143',
internalId:  '',
customField: '20100814-100812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17164',
internalId:  '',
customField: '20100725-075759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27401',
internalId:  '',
customField: '20100824-220450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20100805-192600'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INZX8U';
var companyName   = 'Journey+With+Spirit';
var htmlTitle	  = 'Journey+With+Spirit';
var metaKeywords  = 'Todays+Prayers%0D%0A%0D%0A%0D%0A%0D%0ATodays+Quotes%0D%0A%0D%0AJoyce+BeLynda+Russaw%0D%0A%0D%0AJourney+with+Spirit%0D%0A%0D%0A%0D%0A%0D%0AAffirmations%0D%0A%0D%0AJoyce+Belynda+Russaw%0D%0AJourney+With+Spirit%0D%0A%0D%0ANewsletters';
var metaContents  = 'An+Inspiration%2FMotivational+site+that+provides+you+with+spiritual+guidance+for+each+day.%0D%0A%0D%0A%0D%0A%0D%0AWe+also+offer+a+daily+newsletter+by+request+to+russaw%40bellsouth.net.';
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();
};
