/* [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','115',jdecode('Home'),jdecode(''),'/115.html','false',[],''],
	['PAGE','129728',jdecode('Under+Construction'),jdecode(''),'/129728.html','true',[],''],
	['PAGE','5708',jdecode('Martha%26%23x27%3Bs+Bio'),jdecode(''),'/5708.html','false',[],''],
	['PAGE','6775',jdecode('Balance'),jdecode(''),'/6775.html','false',[],''],
	['PAGE','145',jdecode('Hosting+a+Clinic+or+Course'),jdecode(''),'/145.html','false',[],''],
	['PAGE','136',jdecode('Clinics+%26+Presentations'),jdecode(''),'/136.html','false',[],''],
	['PAGE','1528',jdecode('Hoof+Groom%E2%84%A2+Course'),jdecode(''),'/1528.html','false',[],''],
	['PAGE','154',jdecode('Hoof+Groom+List'),jdecode(''),'/154.html','false',[],''],
	['PAGE','1632',jdecode('What+is+a+Hoof+Groom%E2%84%A2'),jdecode(''),'/1632.html','false',[],''],
	['PAGE','5792',jdecode('Martha+Speaks'),jdecode(''),'/5792/index.html','false',[ 
		['PAGE','6360',jdecode('Martha+Speaks+%28follow+up+page%29'),jdecode(''),'/5792/6360.html','false',[],'']
	],''],
	['PAGE','6688',jdecode('Schedule+of+Fees+'),jdecode(''),'/6688.html','false',[],''],
	['PAGE','58828',jdecode('Educational+Materials'),jdecode(''),'/58828.html','false',[],''],
	['PAGE','163',jdecode('Tools'),jdecode(''),'/163/index.html','false',[ 
		['PAGE','5492',jdecode('Products+%28follow+up+page%29'),jdecode(''),'/163/5492.html','false',[],'']
	],''],
	['PAGE','6414',jdecode('Hoof+Care+Discussions'),jdecode(''),'/6414.html','false',[],''],
	['PAGE','5783',jdecode('Links'),jdecode(''),'/5783.html','false',[],''],
	['PAGE','108528',jdecode('MO+Info+%2F+Contact+Martha'),jdecode(''),'/108528.html','false',[],''],
	['PAGE','1274',jdecode('Guestbook'),jdecode(''),'/1274/index.html','false',[ 
		['PAGE','1273',jdecode('Read+Guestbook'),jdecode(''),'/1274/1273.html','false',[],'']
	],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='421';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'421',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129728',
internalId:  '',
customField: '20100320-141752'
};
webappMappings['1002']=webappMappings['1002-1274awh010in2cq2']={
webappId:    '1002',
documentId:  '1274',
internalId:  '1274awh010in2cq2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115',
internalId:  '',
customField: '20090619-205457'
};
webappMappings['1001']=webappMappings['1001-awh010in2cq210dcf4efb61']={
webappId:    '1001',
documentId:  '163',
internalId:  'awh010in2cq210dcf4efb61',
customField: ''
};
webappMappings['1001']=webappMappings['1001-awh010in2cq210dcf4efb61']={
webappId:    '1001',
documentId:  '5492',
internalId:  'awh010in2cq210dcf4efb61',
customField: 'followUp'
};
webappMappings['1001']=webappMappings['1001-awh010in2cq210ebe6958e2']={
webappId:    '1001',
documentId:  '5792',
internalId:  'awh010in2cq210ebe6958e2',
customField: ''
};
webappMappings['1001']=webappMappings['1001-awh010in2cq210ebe6958e2']={
webappId:    '1001',
documentId:  '6360',
internalId:  'awh010in2cq210ebe6958e2',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5708',
internalId:  '',
customField: '20090219-081653'
};
webappMappings['1003']=webappMappings['1003-awh010in2cq210f01870ea6']={
webappId:    '1003',
documentId:  '6414',
internalId:  'awh010in2cq210f01870ea6',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145',
internalId:  '',
customField: '20090216-161250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136',
internalId:  '',
customField: '20090908-101114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1528',
internalId:  '',
customField: '20090507-140720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '154',
internalId:  '',
customField: '20080128-042440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1632',
internalId:  '',
customField: '20090219-083925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5792',
internalId:  '',
customField: '20070313-214848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6360',
internalId:  '',
customField: '20061106-105545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6775',
internalId:  '',
customField: '20090219-081914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6688',
internalId:  '',
customField: '20090219-084116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58828',
internalId:  '',
customField: '20090219-084158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163',
internalId:  '',
customField: '20090326-195650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5492',
internalId:  '',
customField: '20060921-013742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6414',
internalId:  '',
customField: '20070126-143102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5783',
internalId:  '',
customField: '20090302-210519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108528',
internalId:  '',
customField: '20090219-084257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1274',
internalId:  '',
customField: '20060717-183820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1273',
internalId:  '',
customField: '20060717-183820'
};
webappMappings['7008']=webappMappings['7008-350']={
webappId:    '7008',
documentId:  '108528',
internalId:  '350',
customField: 'language:en;country:US;'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH010IN2CQ2';
var companyName   = 'UNDER+CONSTRUCTION';
var htmlTitle	  = 'Martha+Olivo%27s+MO+Standard+Hoof+Care';
var metaKeywords  = 'Hoof%3B+Barefoot%3B+Natural+Hoof+Care%3B++Barefoot+Trimming%3B+++Martha+Olivo%3B++++Barefoot+Horse%3B+++Natural+Horse+Health%3B++Horse+Care%3B++Barefoot%3B++Barefoot+Horse%3B++Horses+%3B+equine%3B+horseshoe%3B+hooves%3B++++';
var metaContents  = 'Natural+Horse%3B++Hoof%3B+hooves%3B+Barefoot+Horse%3B++Hoof+Health%3B++Trimming+and+Grooming%3B++++Horse+Health%3B++Natural+Hoof+Care%3B++Barefoot%3B+Horses%3B+equine%3B+horseshoe%3B++Martha+Olivo';
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();
};
