/* [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','19501',jdecode('home'),jdecode(''), jdecode('%2F19501.html'), 'true',[],'',''],
	['PAGE','16301',jdecode('laurel+lyons+'),jdecode(''), jdecode('%2F16301%2Findex.html'), 'true',[ 
		['PAGE','195412',jdecode('...+'),jdecode(''), jdecode('%2F16301%2F195412.html'), 'true',[],'','']
	],'',''],
	['PAGE','124501',jdecode('calendar+'),jdecode(''), jdecode('%2F124501%2Findex.html'), 'true',[ 
		['PAGE','128801',jdecode('coming+up+'),jdecode(''), jdecode('%2F124501%2F128801.html'), 'true',[],'','']
	],'',''],
	['PAGE','199512',jdecode('sessions+'),jdecode(''), jdecode('%2F199512%2Findex.html'), 'true',[ 
		['PAGE','203812',jdecode('open+hands+%7E+open+heart'),jdecode(''), jdecode('%2F199512%2F203812.html'), 'true',[],'',''],
		['PAGE','202112',jdecode('gift+certificates'),jdecode(''), jdecode('%2F199512%2F202112.html'), 'true',[],'','']
	],'',''],
	['PAGE','186312',jdecode('%22The+Origin+Medicines%22'),jdecode(''), jdecode('%2F186312%2Findex.html'), 'true',[ 
		['PAGE','130901',jdecode('the+frequencies+'),jdecode(''), jdecode('%2F186312%2F130901.html'), 'true',[],'',''],
		['PAGE','167101',jdecode('Live+Source+Alchemy'),jdecode(''), jdecode('%2F186312%2F167101.html'), 'true',[],'',''],
		['PAGE','136801',jdecode('plant+medicine+'),jdecode(''), jdecode('%2F186312%2F136801.html'), 'true',[],'','']
	],'',''],
	['PAGE','13901',jdecode('loving+service'),jdecode(''), jdecode('%2F13901%2Findex.html'), 'true',[ 
		['PAGE','38601',jdecode('reiki'),jdecode(''), jdecode('%2F13901%2F38601.html'), 'true',[],'',''],
		['PAGE','38622',jdecode('munay-ki'),jdecode(''), jdecode('%2F13901%2F38622.html'), 'true',[],'',''],
		['PAGE','38643',jdecode('ceremony'),jdecode(''), jdecode('%2F13901%2F38643.html'), 'true',[],'',''],
		['PAGE','38664',jdecode('circles'),jdecode(''), jdecode('%2F13901%2F38664.html'), 'true',[],'',''],
		['PAGE','38685',jdecode('readings+'),jdecode(''), jdecode('%2F13901%2F38685.html'), 'true',[],'',''],
		['PAGE','38706',jdecode('TRUTH'),jdecode(''), jdecode('%2F13901%2F38706.html'), 'true',[],'',''],
		['PAGE','90801',jdecode('dream+medicine'),jdecode(''), jdecode('%2F13901%2F90801.html'), 'true',[],'',''],
		['PAGE','113901',jdecode('rites+of+passage+'),jdecode(''), jdecode('%2F13901%2F113901.html'), 'true',[],'','']
	],'',''],
	['PAGE','14522',jdecode('testimonials+'),jdecode(''), jdecode('%2F14522.html'), 'true',[],'',''],
	['PAGE','54801',jdecode('animal+medicine'),jdecode(''), jdecode('%2F54801.html'), 'true',[],'',''],
	['PAGE','143001',jdecode('w%2F+gratitude+'),jdecode(''), jdecode('%2F143001%2Findex.html'), 'true',[ 
		['PAGE','42201',jdecode('story+telling+'),jdecode(''), jdecode('%2F143001%2F42201.html'), 'true',[],'',''],
		['PAGE','138801',jdecode('tv%3F'),jdecode(''), jdecode('%2F143001%2F138801.html'), 'true',[],'','']
	],'',''],
	['PAGE','14543',jdecode('contact%2Fconnect'),jdecode(''), jdecode('%2F14543.html'), 'true',[],'',''],
	['PAGE','37701',jdecode('words+'),jdecode(''), jdecode('%2F37701%2Findex.html'), 'true',[ 
		['PAGE','168901',jdecode('Gayle'),jdecode(''), jdecode('%2F37701%2F168901.html'), 'true',[],'','']
	],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Brush';
theSitetree.paletteFamily='E8C36A';
theSitetree.keyvisualId='11941';
theSitetree.keyvisualName='kv_11941.jpg';
theSitetree.fontsetId='33211';
theSitetree.graphicsetId='14103';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Brush',
				paletteFamily: 	'E8C36A',
				keyvisualId: 	'11941',
				keyvisualName: 	'kv_11941.jpg',
				fontsetId: 		'33211',
				graphicsetId: 	'14103',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54801',
internalId:  '',
customField: '20120116-150204'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '19501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20120116-150100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '186312',
internalId:  '',
customField: '20120116-144823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113901',
internalId:  '',
customField: '20120118-010452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14522',
internalId:  '',
customField: '20120202-234636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14543',
internalId:  '',
customField: '20120116-150943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20120122-233422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20120116-145058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20120118-011030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38601',
internalId:  '',
customField: '20120118-005412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38643',
internalId:  '',
customField: '20120118-005721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38664',
internalId:  '',
customField: '20120118-005936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38622',
internalId:  '',
customField: '20120118-005608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38685',
internalId:  '',
customField: '20120118-010242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38706',
internalId:  '',
customField: '20111229-224220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167101',
internalId:  '',
customField: '20111105-132249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42201',
internalId:  '',
customField: '20110901-151205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128801',
internalId:  '',
customField: '20120202-235004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168901',
internalId:  '',
customField: '20110815-200957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124501',
internalId:  '',
customField: '20120202-235518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90801',
internalId:  '',
customField: '20111101-013704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130901',
internalId:  '',
customField: '20111229-223355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136801',
internalId:  '',
customField: '20111229-224021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138801',
internalId:  '',
customField: '20110810-134958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143001',
internalId:  '',
customField: '20120116-143933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195412',
internalId:  '',
customField: '20120116-145304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '199512',
internalId:  '',
customField: '20120203-000133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '202112',
internalId:  '',
customField: '20120122-234131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203812',
internalId:  '',
customField: '20120202-235138'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INV4OC';
var companyName   = 'The+Origin+Medicines';
var htmlTitle	  = 'Laurel+Lyons+';
var metaKeywords  = 'Reiki%0AHealing+%0APsychic%0AReadings%0AIntuitive+%0ASpiritual%0AEnlightenment+%0A';
var metaContents  = 'Reiki+Master+%0AReiki+Teacher+%0APsychic%0AAromatherapy+%0AEssential+Oils+%0ADream+Work+%0AMunay-Ki+%0AFlower+Essences+';
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();
};

