/* [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','1447',jdecode('Home'),jdecode(''),'/1447.html','true',[],''],
	['PAGE','1478',jdecode('About+us'),jdecode(''),'/1478/index.html','true',[ 
		['PAGE','39692',jdecode('The+People+'),jdecode(''),'/1478/39692.html','true',[],''],
		['PAGE','39734',jdecode('The+Horses'),jdecode(''),'/1478/39734.html','true',[],''],
		['PAGE','39755',jdecode('Blackie+%26+Bear+'),jdecode(''),'/1478/39755.html','false',[],'']
	],''],
	['PAGE','7712',jdecode('Lessons'),jdecode(''),'/7712.html','true',[],''],
	['PAGE','47792',jdecode('Kids+Summer+Horse+Camp+'),jdecode(''),'/47792.html','true',[],''],
	['PAGE','41892',jdecode('Clinics+%26+Classes'),jdecode(''),'/41892/index.html','false',[ 
		['PAGE','41955',jdecode('Kids+Summer+Horse+Camp'),jdecode(''),'/41892/41955.html','true',[],''],
		['PAGE','41913',jdecode('Groundwork+Shop'),jdecode(''),'/41892/41913.html','true',[],''],
		['PAGE','41934',jdecode('Mommy+%26+Me+Class+'),jdecode(''),'/41892/41934.html','true',[],'']
	],''],
	['PAGE','35592',jdecode('Girl+Scouts+'),jdecode(''),'/35592/index.html','true',[ 
		['PAGE','35613',jdecode('Daisy+'),jdecode(''),'/35592/35613.html','true',[],''],
		['PAGE','35634',jdecode('Brownie'),jdecode(''),'/35592/35634.html','true',[],''],
		['PAGE','35655',jdecode('Junior'),jdecode(''),'/35592/35655.html','true',[],'']
	],''],
	['PAGE','7733',jdecode('Training'),jdecode(''),'/7733.html','true',[],''],
	['PAGE','12845',jdecode('Prices+'),jdecode(''),'/12845.html','true',[],''],
	['PAGE','15645',jdecode('Horses+For+Sale+'),jdecode(''),'/15645.html','true',[],''],
	['PAGE','1499',jdecode('Photos'),jdecode(''),'/1499.html','true',[],''],
	['PAGE','12866',jdecode('Guestbook'),jdecode(''),'/12866.html','true',[],''],
	['PAGE','1552',jdecode('Contact'),jdecode(''),'/1552.html','true',[],''],
	['PAGE','30692',jdecode('Directions+'),jdecode(''),'/30692.html','true',[],''],
	['PAGE','32192',jdecode('Links+'),jdecode(''),'/32192.html','true',[],'']];
var siteelementCount=23;
theSitetree.topTemplateName='Noble';
theSitetree.paletteFamily='8E8E5B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17228';
theSitetree.graphicsetId='12672';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8E8E5B';
var theTemplate={
				name: 			'Noble',
				paletteFamily: 	'8E8E5B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17228',
				graphicsetId: 	'12672',
				contentColor: 	'FFFFFF',
				contentBGColor: '8E8E5B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-800530aa751f3eabf4ce837ceeea920e']={
webappId:    '7060',
documentId:  '1499',
internalId:  '800530aa751f3eabf4ce837ceeea920e',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1447',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15645',
internalId:  '',
customField: '20100216-231639'
};
webappMappings['7008']=webappMappings['7008-4345']={
webappId:    '7008',
documentId:  '1552',
internalId:  '4345',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1447',
internalId:  '',
customField: '20100205-181737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1478',
internalId:  '',
customField: '20100215-224817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1499',
internalId:  '',
customField: '20090808-154840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35592',
internalId:  '',
customField: '20100118-121452'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '30692',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1552',
internalId:  '',
customField: '20091118-140450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12866',
internalId:  '',
customField: '20090813-150030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7733',
internalId:  '',
customField: '20090904-231704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7712',
internalId:  '',
customField: '20090824-220310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12845',
internalId:  '',
customField: '20090908-100857'
};
webappMappings['7002']=webappMappings['7002-700']={
webappId:    '7002',
documentId:  '12866',
internalId:  '700',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30692',
internalId:  '',
customField: '20091129-020735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32192',
internalId:  '',
customField: '20100114-170702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35613',
internalId:  '',
customField: '20100118-123159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35634',
internalId:  '',
customField: '20100118-123628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35655',
internalId:  '',
customField: '20100118-124423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39692',
internalId:  '',
customField: '20100206-115418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39734',
internalId:  '',
customField: '20100215-231601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39755',
internalId:  '',
customField: '20100204-160056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47792',
internalId:  '',
customField: '20100308-111123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41892',
internalId:  '',
customField: '20100205-180350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41955',
internalId:  '',
customField: '20100205-180350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41913',
internalId:  '',
customField: '20100205-180350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41934',
internalId:  '',
customField: '20100205-180350'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INLUH4';
var companyName   = 'NorCal+Trail+Rides';
var htmlTitle	  = 'Online+Home+Of+NorCal+Trail+Rides%21';
var metaKeywords  = 'horseback+riding%2Chorses%2Chorses+for+sale%2Ctrail+rides%2Criding+lessons%2Chorsetraining%2Criding%2Chorsemanship%2Cnorcal%2Credding+ca%2Canderson+ca%2Cwranglers%2Cwestern%2Cenglish%2Cscenic+rides%2Csafe+horseback+riding%2Ckids+camp%2C';
var metaContents  = 'At+NorCal+Trail+Rides+we+offer+safe%2C+comfortable+horseback+trail+rides+throughout+the+Northern+California+area.We+welcome+riders+with+all+levels+of+riding+experience.+';
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();
};
