/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','1184',jdecode('From+The+Author'),jdecode(''),'/1184.html','true',[],''],
	['PAGE','1193',jdecode('%22The+Door+To+My+Soul%22'),jdecode(''),'/1193.html','true',[],''],
	['PAGE','1202',jdecode('Press+Release%21'),jdecode(''),'/1202.html','true',[],''],
	['PAGE','1211',jdecode('Don+Patton+Ministeries%21'),jdecode(''),'/1211.html','true',[],''],
	['PAGE','1220',jdecode('My+Poetry%21'),jdecode(''),'/1220.html','true',[],''],
	['PAGE','53',jdecode('Photo+Album'),jdecode(''),'/53.html','true',[],''],
	['PAGE','62',jdecode('Authors%26%23x27%3B+Links%21'),jdecode(''),'/62.html','true',[],''],
	['PAGE','1229',jdecode('My+Music%21'),jdecode(''),'/1229.html','true',[],''],
	['PAGE','1411',jdecode('Guestbook'),jdecode(''),'/1411/index.html','true',[ 
		['PAGE','1410',jdecode('Read+Guestbook'),jdecode(''),'/1411/1410.html','false',[],'']
	],''],
	['PAGE','1892',jdecode('Html+codes+and+links%21'),jdecode(''),'/1892.html','true',[],''],
	['PAGE','2056',jdecode('Bookstore+Links%21'),jdecode(''),'/2056.html','true',[],''],
	['PAGE','8701',jdecode('Journal'),jdecode(''),'/8701.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Activate';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='2026';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='338';
theSitetree.graphicsetId='391';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='990000';
var theTemplate={
				name: 			'Activate',
				paletteFamily: 	'990000',
				keyvisualId: 	'2026',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'338',
				graphicsetId: 	'391',
				contentColor: 	'FFFFFF',
				contentBGColor: '990000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'990000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1184',
internalId:  '',
customField: '20100202-093401'
};
webappMappings['1002']=webappMappings['1002-1411AHW050IN3FTG']={
webappId:    '1002',
documentId:  '1411',
internalId:  '1411AHW050IN3FTG',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100204-140108'
};
webappMappings['7050']=webappMappings['7050-628']={
webappId:    '7050',
documentId:  '8701',
internalId:  '628',
customField: 'language:en;country:US;'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1193',
internalId:  '',
customField: '20100202-094649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1202',
internalId:  '',
customField: '20100202-095740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1211',
internalId:  '',
customField: '20100202-100517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1220',
internalId:  '',
customField: '20100202-102805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20080728-124529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20070324-040629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1229',
internalId:  '',
customField: '20100202-103800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1411',
internalId:  '',
customField: '20100202-091701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1410',
internalId:  '',
customField: '20070321-150959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1892',
internalId:  '',
customField: '20080404-142535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2056',
internalId:  '',
customField: '20100202-104049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20090221-092548'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3FTG';
var companyName   = 'Donald%27s+House+Of+Healing%21';
var htmlTitle	  = 'http%3A%2F%2Fwww.donaldraypatton.co%2F32.html';
var metaKeywords  = 'Christian%2C+religion%2C+book%2C+poetry%2C+help%2C+teach%2C+preach%2C+minister%2C+Jesus%2C+Christ%2C+Inspired%2C+soul%2C+singing%2C+marketing%2C+sales%2C+God%2C+wisdom%2C+Holy+Spirit%2C+post-polio+syndrome%2Ccancer%2C+collectionguidancelife%2C+poems%2C+trauma%2C+music%2C+song%2C+play';
var metaContents  = 'The+purpose+of+this+website+is+to+promote+the+sales+of+my+book++The+Door+To+My+Soul.+It+is+a+collection+of+spiritually+inspired+poems+that+I+wrote+with+the+guidance+of+the+Holy+spirit+while+seeking+Gods+wisdom.+My+life+had+reached+rock+bottom+when+my+wife+passed+away+from+cancer.+At+that+time%2C+the+trauma+threw+me+in+to+full+blown+post-polio+syndrome.+I+have+%2C+no20+been+a+minister+for+21+years+and+my+goal+in+life+is+to+reach+out+to+help+others+in+whatever+way+I+can.+It+may+be+in+the+way+of+singing+a+song%2C+preaching+the+gospel%2C++or+providing+a+meal+to+a+hungry+soul.+My+desire+is+to+teach+the+truth+to+anyone+who+will+listen.+By+marketing+and+selling+my+book%2C+I+will+have+more+funds+to+do+these+things.+By+religion%2C+I+am+a+christian.+And+I+have+the+spirit+of+Jesus+Christ+to+guide+and+direct+me.+I%2C+also%2C+play+music+for+anyone+who+will+listen.';
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();
};
