/* [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','6701',jdecode('Home'),jdecode(''), jdecode('%2F6701.html'), 'true',[],'',''],
	['PAGE','6794',jdecode('Training%2FFAQ%26%23x27%3Bs'),jdecode(''), jdecode('%2F6794%2Findex.html'), 'true',[ 
		['PAGE','146312',jdecode('FAQ%26%23x27%3BS%2F3S+Articles'),jdecode(''), jdecode('%2F6794%2F146312.html'), 'true',[],'',''],
		['PAGE','16622',jdecode('Horse+Education'),jdecode(''), jdecode('%2F6794%2F16622.html'), 'true',[],'',''],
		['PAGE','16643',jdecode('Human+Education'),jdecode(''), jdecode('%2F6794%2F16643.html'), 'true',[],'',''],
		['PAGE','16664',jdecode('3S+Horse'),jdecode(''), jdecode('%2F6794%2F16664.html'), 'true',[],'',''],
		['PAGE','16685',jdecode('Training%2FVideos'),jdecode(''), jdecode('%2F6794%2F16685.html'), 'true',[],'','']
	],'',''],
	['PAGE','6815',jdecode('EquiSizing'),jdecode(''), jdecode('%2F6815.html'), 'true',[],'',''],
	['PAGE','8201',jdecode('For+Sale'),jdecode(''), jdecode('%2F8201%2Findex.html'), 'true',[ 
		['PAGE','8222',jdecode('Horses'),jdecode(''), jdecode('%2F8201%2F8222.html'), 'true',[],'',''],
		['PAGE','8264',jdecode('Rider+Equipment'),jdecode(''), jdecode('%2F8201%2F8264.html'), 'true',[],'',''],
		['PAGE','8285',jdecode('Horse+Equipment'),jdecode(''), jdecode('%2F8201%2F8285.html'), 'true',[],'','']
	],'',''],
	['PAGE','6836',jdecode('Events'),jdecode(''), jdecode('%2F6836%2Findex.html'), 'true',[ 
		['PAGE','15601',jdecode('Local+weather'),jdecode(''), jdecode('%2F6836%2F15601.html'), 'true',[],'',''],
		['PAGE','110012',jdecode('Event+Reports+and+Pictures'),jdecode(''), jdecode('%2F6836%2F110012.html'), 'true',[],'','']
	],'',''],
	['PAGE','6752',jdecode('About+Us'),jdecode(''), jdecode('%2F6752%2Findex.html'), 'true',[ 
		['PAGE','106812',jdecode('Directions'),jdecode(''), jdecode('%2F6752%2F106812.html'), 'true',[],'',''],
		['PAGE','112312',jdecode('Contact+Us'),jdecode(''), jdecode('%2F6752%2F112312.html'), 'true',[],'',''],
		['PAGE','112612',jdecode('The+Ranch'),jdecode(''), jdecode('%2F6752%2F112612.html'), 'true',[],'',''],
		['PAGE','134712',jdecode('Testimonials'),jdecode(''), jdecode('%2F6752%2F134712.html'), 'true',[],'','']
	],'',''],
	['PAGE','29301',jdecode('Sponsor%2FAdvertisers'),jdecode(''), jdecode('%2F29301.html'), 'true',[],'','']];
var siteelementCount=21;
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 prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Linear',
				paletteFamily: 	'404040',
				keyvisualId: 	'2187',
				keyvisualName: 	'auto.jpg',
				fontsetId: 		'361',
				graphicsetId: 	'414',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				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: '20120128-104846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6752',
internalId:  '',
customField: '20101128-114113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6794',
internalId:  '',
customField: '20111113-125646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6815',
internalId:  '',
customField: '20111226-182616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6836',
internalId:  '',
customField: '20120128-103615'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20101122-222018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8222',
internalId:  '',
customField: '20111113-133244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134712',
internalId:  '',
customField: '20101128-115556'
};
webappMappings['7080']=webappMappings['7080-323']={
webappId:    '7080',
documentId:  '15601',
internalId:  '323',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20120128-110528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16622',
internalId:  '',
customField: '20111212-183217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16664',
internalId:  '',
customField: '20091105-084113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16685',
internalId:  '',
customField: '20111126-144147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16643',
internalId:  '',
customField: '20100715-003253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110012',
internalId:  '',
customField: '20101128-115251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112312',
internalId:  '',
customField: '20101128-114855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8264',
internalId:  '',
customField: '20101031-101824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8285',
internalId:  '',
customField: '20110110-201726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146312',
internalId:  '',
customField: '20111127-164342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20090327-212315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106812',
internalId:  '',
customField: '20101128-115015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112612',
internalId:  '',
customField: '20091016-204815'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
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();
};

