/* [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','6701',jdecode('Home'),jdecode(''),'/6701.html','true',[],''],
	['PAGE','29301',jdecode('Sponsor%2FAdvertisers'),jdecode(''),'/29301.html','true',[],''],
	['PAGE','6815',jdecode('NCR+EXCA'),jdecode(''),'/6815/index.html','true',[ 
		['PAGE','12701',jdecode('Extreme+Cowboy+Training'),jdecode(''),'/6815/12701.html','true',[],''],
		['PAGE','114812',jdecode('Rules+%26+FAQ%26%23x27%3Bs'),jdecode(''),'/6815/114812.html','true',[],''],
		['PAGE','139212',jdecode('NCR+EXCA+Articles'),jdecode(''),'/6815/139212.html','true',[],'']
	],''],
	['PAGE','8201',jdecode('For+Sale'),jdecode(''),'/8201/index.html','true',[ 
		['PAGE','8222',jdecode('Horses'),jdecode(''),'/8201/8222.html','true',[],''],
		['PAGE','8264',jdecode('People+Equipment'),jdecode(''),'/8201/8264.html','true',[],''],
		['PAGE','8285',jdecode('Horse+Equipment'),jdecode(''),'/8201/8285.html','true',[],'']
	],''],
	['PAGE','6836',jdecode('Events'),jdecode(''),'/6836/index.html','true',[ 
		['PAGE','15601',jdecode('Local+weather'),jdecode(''),'/6836/15601.html','true',[],''],
		['PAGE','110012',jdecode('Event+Reports+and+Pictures'),jdecode(''),'/6836/110012.html','true',[],'']
	],''],
	['PAGE','6794',jdecode('Training%2FFAQ%26%23x27%3Bs'),jdecode(''),'/6794/index.html','true',[ 
		['PAGE','146312',jdecode('FAQ%26%23x27%3BS'),jdecode(''),'/6794/146312.html','true',[],''],
		['PAGE','16622',jdecode('Horse+Education'),jdecode(''),'/6794/16622.html','true',[],''],
		['PAGE','16643',jdecode('People+Education'),jdecode(''),'/6794/16643.html','true',[],''],
		['PAGE','16664',jdecode('3S+Horse'),jdecode(''),'/6794/16664.html','true',[],''],
		['PAGE','16685',jdecode('3S+Rider'),jdecode(''),'/6794/16685.html','true',[],''],
		['PAGE','23901',jdecode('3S+Articles'),jdecode(''),'/6794/23901.html','true',[],'']
	],''],
	['PAGE','6752',jdecode('About+Us'),jdecode(''),'/6752/index.html','true',[ 
		['PAGE','106812',jdecode('Directions'),jdecode(''),'/6752/106812.html','true',[],''],
		['PAGE','112312',jdecode('Contact+Us'),jdecode(''),'/6752/112312.html','true',[],''],
		['PAGE','112612',jdecode('The+Ranch'),jdecode(''),'/6752/112612.html','true',[],''],
		['PAGE','134712',jdecode('Testimonials'),jdecode(''),'/6752/134712.html','true',[],'']
	],''],
	['PAGE','121512',jdecode('Vote+for+Calendar+Pictures'),jdecode(''),'/121512.html','false',[],'']];
var siteelementCount=26;
theSitetree.topTemplateName='Linear';
theSitetree.paletteFamily='404040';
theSitetree.keyvisualId='2187';
theSitetree.keyvisualName='auto.jpg';
theSitetree.fontsetId='361';
theSitetree.graphicsetId='414';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Linear',
				paletteFamily: 	'404040',
				keyvisualId: 	'2187',
				keyvisualName: 	'auto.jpg',
				fontsetId: 		'361',
				graphicsetId: 	'414',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'CC6600',
				e_color: 		'FFCC66',
				f_color: 		'999966',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100125-112617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6752',
internalId:  '',
customField: '20091016-204651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6794',
internalId:  '',
customField: '20100120-084538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6815',
internalId:  '',
customField: '20091103-093201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6836',
internalId:  '',
customField: '20100123-213010'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20100131-204206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8222',
internalId:  '',
customField: '20100131-212148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121512',
internalId:  '',
customField: '20090804-171213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134712',
internalId:  '',
customField: '20091016-204729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090707-150249'
};
webappMappings['7080']=webappMappings['7080-323']={
webappId:    '7080',
documentId:  '15601',
internalId:  '323',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139212',
internalId:  '',
customField: '20091109-190442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20091031-091735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16622',
internalId:  '',
customField: '20091105-090106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16664',
internalId:  '',
customField: '20091105-084113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16685',
internalId:  '',
customField: '20091105-084507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16643',
internalId:  '',
customField: '20091105-084709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110012',
internalId:  '',
customField: '20100119-083112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112312',
internalId:  '',
customField: '20090704-130438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8264',
internalId:  '',
customField: '20100131-204613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8285',
internalId:  '',
customField: '20100131-204449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146312',
internalId:  '',
customField: '20100120-085030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20090327-212315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114812',
internalId:  '',
customField: '20090707-145843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106812',
internalId:  '',
customField: '20090712-110439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112612',
internalId:  '',
customField: '20091016-204815'
};
webappMappings['7060']=webappMappings['7060-063653fe384cc3dc39cc09bea88b60e0']={
webappId:    '7060',
documentId:  '23901',
internalId:  '063653fe384cc3dc39cc09bea88b60e0',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20090203-235258'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEYSC';
var companyName   = 'SAFETY%2C+SANITY+%26+SUCCESS%21%21';
var htmlTitle	  = '3S-Ranch';
var metaKeywords  = 'Horses%2C+riding+lessons%2C+horse+training%2C+horse+rehabilitation%2C+trail+riding%2C+obstacle+course+riding';
var metaContents  = '3S-Ranch+horse+and+people+training+facility+for+the+serious+rider+who+wants+to+get+the+most+out+of+themselves+and+their+horses.+++Focusing+on+creating+versital+and+balanced+horses.+';
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();
};
