/* [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','74',jdecode('HOME'),jdecode(''), jdecode('%2F74%2Findex.html'), 'true',[ 
		['PAGE','33823',jdecode('What+is+3+Day+Eventing%3F'),jdecode(''), jdecode('%2F74%2F33823.html'), 'true',[],'','']
	],'',''],
	['PAGE','698',jdecode('DIRECTIONS'),jdecode(''), jdecode('%2F698.html'), 'true',[],'',''],
	['PAGE','1160',jdecode('THE+RIDING+SCHOOL'),jdecode(''), jdecode('%2F1160%2Findex.html'), 'true',[ 
		['PAGE','1169',jdecode('TRAINING'),jdecode(''), jdecode('%2F1160%2F1169.html'), 'true',[],'',''],
		['PAGE','17401',jdecode('MY+STUDENTS'),jdecode(''), jdecode('%2F1160%2F17401.html'), 'true',[],'',''],
		['PAGE','1178',jdecode('KALLISTA+FARM+FEES'),jdecode(''), jdecode('%2F1160%2F1178.html'), 'true',[],'','']
	],'',''],
	['PAGE','1242',jdecode('THE+HORSES'),jdecode(''), jdecode('%2F1242%2Findex.html'), 'true',[ 
		['PAGE','1251',jdecode('KALLISTA+RULER'),jdecode(''), jdecode('%2F1242%2F1251.html'), 'true',[],'',''],
		['PAGE','1260',jdecode('GOED+THYMS'),jdecode(''), jdecode('%2F1242%2F1260.html'), 'true',[],'',''],
		['PAGE','1269',jdecode('PARTI+ALARME'),jdecode(''), jdecode('%2F1242%2F1269.html'), 'true',[],'',''],
		['PAGE','2924',jdecode('LETHAL+INDUSTRY'),jdecode(''), jdecode('%2F1242%2F2924.html'), 'true',[],'','']
	],'',''],
	['PAGE','4272',jdecode('EQUINE+TRANSPORT'),jdecode(''), jdecode('%2F4272.html'), 'true',[],'',''],
	['PAGE','1420',jdecode('SHOW+SCHEDULE'),jdecode(''), jdecode('%2F1420%2Findex.html'), 'true',[ 
		['PAGE','1429',jdecode('SHOW+RESULTS'),jdecode(''), jdecode('%2F1420%2F1429.html'), 'true',[],'',''],
		['PAGE','1438',jdecode('SHOW+INFO'),jdecode(''), jdecode('%2F1420%2F1438.html'), 'true',[],'','']
	],'',''],
	['PAGE','3146',jdecode('GUESTBOOK'),jdecode(''), jdecode('%2F3146%2Findex.html'), 'true',[ 
		['PAGE','3145',jdecode('READ+GUESTBOOK'),jdecode(''), jdecode('%2F3146%2F3145.html'), 'false',[],'','']
	],'',''],
	['PAGE','42623',jdecode('Snow+day%21'),jdecode(''), jdecode('%2F42623.html'), 'false',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Cable';
theSitetree.paletteFamily='34A151';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10367';
theSitetree.graphicsetId='10529';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netnation',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cable',
				paletteFamily: 	'34A151',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10367',
				graphicsetId: 	'10529',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '74',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '698',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '698',
internalId:  '',
customField: '20111207-111932'
};
webappMappings['1002']=webappMappings['1002-3146AHW050INX2X4']={
webappId:    '1002',
documentId:  '3146',
internalId:  '3146AHW050INX2X4',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74',
internalId:  '',
customField: '20111207-111739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1160',
internalId:  '',
customField: '20111207-111942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1169',
internalId:  '',
customField: '20110306-120102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1178',
internalId:  '',
customField: '20110306-114952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1242',
internalId:  '',
customField: '20110306-110809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1251',
internalId:  '',
customField: '20091104-141546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1260',
internalId:  '',
customField: '20090207-172005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1269',
internalId:  '',
customField: '20111207-112359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2924',
internalId:  '',
customField: '20100302-153510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33823',
internalId:  '',
customField: '20091104-102144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4272',
internalId:  '',
customField: '20111207-112411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1420',
internalId:  '',
customField: '20111207-112640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1429',
internalId:  '',
customField: '20110306-110717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1438',
internalId:  '',
customField: '20110306-110400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3146',
internalId:  '',
customField: '20090207-172306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3145',
internalId:  '',
customField: '20070521-014358'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '74',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-3737222']={
webappId:    '1501',
documentId:  '74',
internalId:  '3737222',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20110408-193040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42623',
internalId:  '',
customField: '20091213-195807'
};
webappMappings['7008']=webappMappings['7008-7897']={
webappId:    '7008',
documentId:  '74',
internalId:  '7897',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2X4';
var companyName   = 'KALLISTA+FARM++Sharon+Flagg';
var htmlTitle	  = 'KALLISTA+FARM++Sharon+Flagg+owner%2Ftrainer';
var metaKeywords  = 'FOR+SALE%2C+PERCHERON%2C+HEAVY+BRED%2C+WARMBLOOD%2C+EVENTING%2C+THREE+DAY%2C+THREE+DAY+EVENTING%2C+3+DAY%2C+horses%2C+sport+horses%2C+1993%2C+irish+draught%2C+thoroughbred%2C+dutch+warmblood%2C+arab%2C+arabian%2C+sharon%2C+flagg%2C++zeahlah%2C+american+sport+horse%2C+selle+francias%2C+selle+francais%2C+nevada%2C+utah%2C+riding%2C+ride%2C+equestrian%2C+deassage%2C+hunter%2C+hunt%2C+jump%2C+jumper%2C+horse+trainer%2C+horse+training%2C+school+horse%2C+school%2C+teach%2C+ride%2C+train%2C+northern%2C+utah%2C+boarding%2C+competition%2C+horse+show%2C+english%2C+horse+for+sale%2C+ring+bone%2C+retired%2C+ram+tap%2C+napa%2C+lessons%2C+fees%2C+wild+horse%2C+CTETA%2C+Rancho+Murieta%2C+Wyoming%2C+free+horse%2C+paint%2C+blue+eye+horse%2C+fallon%2C+fernley%2C+reno%2C+Leopold+at+Del+Mar%2C+Del+Mar%2C+Leopold%2C+Atlas%2C+Jay%2C+Jewells+Jem%2C+Kallista+Ruler%2C+Goed+Thyms%2C+Good+Times%2C+Lethal+Industry%2C+Tiesto%2C+Parti+Alarme%2C+Party+Alarm%2C+Aquagen%2C+horse+trailer%2C+trails+west%2C+GMC+2008%2C+GMC%2C+transportation%2C+horse+haulers%2C+grooming%2C+groom%2C+sales%2C+horse+sales%2C+horse+agent%2C+conditioning%2C+condition%2C+for+sale%2C+warmbloods+for+sale%2C+safety%2C+care%2C+concern%2C+consignment%2C+demo+rider%2C+demo%2C+pony+sale';
var metaContents  = 'home+of+sport+horses+and+riders%2C+three+day+eventing%2C+dressage%2C+show+jumping+and+horsemanship.++Warmbloods%2C+Thoroughbreds%2C+all+breeds+welcome%21++Equine+transport+and+sales';
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();
};

