/* [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','133',jdecode('Home'),jdecode(''),'/133.html','true',[],'',''],
	['PAGE','1183',jdecode('About+us'),jdecode(''),'/1183.html','true',[],'',''],
	['PAGE','1881',jdecode('Buy+the+Books+Here'),jdecode(''),'/1881.html','true',[],'',''],
	['PAGE','1256',jdecode('Trail+Training+Book'),jdecode(''),'/1256/index.html','true',[ 
		['PAGE','1265',jdecode('Intro+to+Trail+Training'),jdecode(''),'/1256/1265.html','true',[],'',''],
		['PAGE','1274',jdecode('Forward+to+Trail+Training'),jdecode(''),'/1256/1274.html','true',[],'',''],
		['PAGE','1283',jdecode('Table+of+Contents'),jdecode(''),'/1256/1283.html','true',[],'','']
	],'',''],
	['PAGE','1443',jdecode('Trail+Horse+Adventures+and+Advice'),jdecode(''),'/1443/index.html','true',[ 
		['PAGE','1452',jdecode('About+this+book'),jdecode(''),'/1443/1452.html','true',[],'',''],
		['PAGE','1461',jdecode('Chapter+1'),jdecode(''),'/1443/1461.html','true',[],'',''],
		['PAGE','1470',jdecode('Chapter+2'),jdecode(''),'/1443/1470.html','true',[],'','']
	],'',''],
	['PAGE','1553',jdecode('My+Free+E-Newsletter'),jdecode(''),'/1553/index.html','true',[ 
		['PAGE','1562',jdecode('Newsletter+%2382'),jdecode(''),'/1553/1562.html','true',[],'',''],
		['PAGE','1571',jdecode('Newsletter+%2383'),jdecode(''),'/1553/1571.html','true',[],'',''],
		['PAGE','1580',jdecode('Newsletter+%2384'),jdecode(''),'/1553/1580.html','true',[],'','']
	],'',''],
	['PAGE','1732',jdecode('Reviews+-+What+Readers+Say...'),jdecode(''),'/1732/index.html','true',[ 
		['PAGE','1741',jdecode('Western+Horseman+Review'),jdecode(''),'/1732/1741.html','true',[],'',''],
		['PAGE','1750',jdecode('Pegasus+Review'),jdecode(''),'/1732/1750.html','true',[],'','']
	],'',''],
	['PAGE','2002',jdecode('Photos+of+Our+Animal+Friends'),jdecode(''),'/2002.html','true',[],'',''],
	['PAGE','2521',jdecode('Great+Photos+of+Alaska+and+Out+West'),jdecode(''),'/2521.html','true',[],'',''],
	['PAGE','2620',jdecode('My+Reader%26%23x27%3Bs+Website+Links'),jdecode(''),'/2620.html','true',[],'',''],
	['PAGE','115',jdecode('Guestbook'),jdecode(''),'/115/index.html','true',[ 
		['PAGE','114',jdecode('Read+Guestbook'),jdecode(''),'/115/114.html','false',[],'','']
	],'',''],
	['PAGE','2404',jdecode('Contact'),jdecode(''),'/2404.html','true',[],'',''],
	['PAGE','2796',jdecode('Other+Places+to+Find+Me+-+Blogs%2C+articles'),jdecode(''),'/2796.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='024405';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10615';
theSitetree.graphicsetId='10803';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='024405';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delta',
				paletteFamily: 	'024405',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10615',
				graphicsetId: 	'10803',
				contentColor: 	'FFFFFF',
				contentBGColor: '024405',
				a_color: 		'327435',
				b_color: 		'226425',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133',
internalId:  '',
customField: '20090204-113752'
};
webappMappings['1002']=webappMappings['1002-115AHW050INV0E4']={
webappId:    '1002',
documentId:  '115',
internalId:  '115AHW050INV0E4',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '133',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-dca42440eb3856bfa7e64bdedefea195']={
webappId:    '7060',
documentId:  '2002',
internalId:  'dca42440eb3856bfa7e64bdedefea195',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20100505-112944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1881',
internalId:  '',
customField: '20100505-113221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1256',
internalId:  '',
customField: '20100505-113323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1265',
internalId:  '',
customField: '20080829-114312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1274',
internalId:  '',
customField: '20080829-114341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1283',
internalId:  '',
customField: '20080829-114517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1443',
internalId:  '',
customField: '20080829-114626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1452',
internalId:  '',
customField: '20080829-114740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1461',
internalId:  '',
customField: '20080829-114958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1470',
internalId:  '',
customField: '20080829-114840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1553',
internalId:  '',
customField: '20080829-115155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1562',
internalId:  '',
customField: '20080829-115329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1571',
internalId:  '',
customField: '20080829-115428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1580',
internalId:  '',
customField: '20080829-115623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1732',
internalId:  '',
customField: '20080829-115850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1741',
internalId:  '',
customField: '20080829-115911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1750',
internalId:  '',
customField: '20080829-115938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2002',
internalId:  '',
customField: '20080311-182634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2521',
internalId:  '',
customField: '20080829-115959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2620',
internalId:  '',
customField: '20090720-112101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115',
internalId:  '',
customField: '20080204-172043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114',
internalId:  '',
customField: '20080204-172043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2404',
internalId:  '',
customField: '20080829-120039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2796',
internalId:  '',
customField: '20090204-113457'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INV0E4';
var companyName   = 'Trail+Training+-+Horse+and+Rider';
var htmlTitle	  = 'Trail+Training+-+Horse+and+Rider';
var metaKeywords  = 'horse+trail+riding+training+book+judi+daly+rider+adventures+spooking+horses+bucking+rearing+balking';
var metaContents  = 'Trail+riding+website+that+advertises+the+books+Trail+Training+for+the+Horse+and+Rider+and+Trail+Horse+adventures+and+advice+by+Judi+Daly.';
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();
};
