/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],''],
	['PAGE','6022',jdecode('Lessons'),jdecode(''),'/6022.html','true',[],''],
	['PAGE','35356',jdecode('School+Horses'),jdecode(''),'/35356.html','true',[],''],
	['PAGE','6043',jdecode('Boarding'),jdecode(''),'/6043.html','true',[],''],
	['PAGE','35144',jdecode('2009+Show+Schedule'),jdecode(''),'/35144.html','true',[],''],
	['PAGE','6064',jdecode('Sales'),jdecode(''),'/6064.html','true',[],''],
	['PAGE','6085',jdecode('Our+Instructor'),jdecode(''),'/6085.html','true',[],''],
	['PAGE','26901',jdecode('FAQ%26%23x27%3BS'),jdecode(''),'/26901.html','true',[],''],
	['PAGE','35679',jdecode('Links'),jdecode(''),'/35679.html','true',[],''],
	['PAGE','6106',jdecode('Contact'),jdecode(''),'/6106.html','true',[],''],
	['PAGE','9501',jdecode('Directions'),jdecode(''),'/9501.html','true',[],''],
	['PAGE','35434',jdecode('Photo+Album'),jdecode(''),'/35434.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='51';
theSitetree.graphicsetId='57';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Easy',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'51',
				graphicsetId: 	'57',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35356',
internalId:  '',
customField: '20090729-040449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20091008-232739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6085',
internalId:  '',
customField: '20091030-220254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6022',
internalId:  '',
customField: '20090908-191846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6043',
internalId:  '',
customField: '20071102-232437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6064',
internalId:  '',
customField: '20091030-221845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26901',
internalId:  '',
customField: '20080330-051420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6106',
internalId:  '',
customField: '20071127-012655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20091030-220600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35434',
internalId:  '',
customField: '20090908-190959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35679',
internalId:  '',
customField: '20091030-222043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35144',
internalId:  '',
customField: '20091008-232850'
};
webappMappings['7060']=webappMappings['7060-6623f6eda1e745a423c40e81f2886785']={
webappId:    '7060',
documentId:  '35434',
internalId:  '6623f6eda1e745a423c40e81f2886785',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2Q2';
var companyName   = 'Foxridge+Farm%2C+LLC';
var htmlTitle	  = 'Foxridge+Farm%2C+LLC';
var metaKeywords  = 'Foxridge+Farm+LLC%2C+Portland%2C+Oregon%2C+horses%2C+horse%2C+boarding%2C+hunters%2C+jumpers%2C+sales%2C+foxridge%2C+fox+ridge%2C+foxridge+farm%2C+fox+ridge+farm%2C+Mari+Kerola%2C+NW+Skyline+Blvd%2C+97229%2C+english+style+riding';
var metaContents  = 'Foxridge+Farm%2C+LLC+is+located+on+25+acres+in+NW+Portland%2C+15+minutes+from+downtown+and+adjacent+to+Forest+Park.++We+offer+full+service+boarding+and+training+in+a+beautiful+facility+with+your+horses+health+and+happiness+in+mind.++++Our+school+horse+program+is+run+by+Mari+Kerola.++';
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();
};
