/* [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','6401',jdecode('Home'),jdecode(''),'/6401.html','true',[],'',''],
	['PAGE','6452',jdecode('About+Carla'),jdecode(''),'/6452.html','true',[],'',''],
	['PAGE','6494',jdecode('Spiritual+Coaching'),jdecode(''),'/6494.html','true',[],'',''],
	['PAGE','9912',jdecode('Monday+Night+Meditation'),jdecode(''),'/9912.html','true',[],'',''],
	['PAGE','6473',jdecode('Talks%2C+Classes%2C+Etc.'),jdecode(''),'/6473.html','true',[],'',''],
	['PAGE','6515',jdecode('Retreats'),jdecode(''),'/6515.html','true',[],'',''],
	['PAGE','62726',jdecode('Laos+2011'),jdecode(''),'/62726.html','true',[],'',''],
	['PAGE','84626',jdecode('Laos+2009+Photos'),jdecode(''),'/84626.html','true',[],'',''],
	['PAGE','69726',jdecode('Audio+Dharma+Talks'),jdecode(''),'/69726.html','true',[],'',''],
	['PAGE','23710',jdecode('Nature+Retreat+Photos'),jdecode(''),'/23710.html','true',[],'',''],
	['PAGE','87126',jdecode('Practice+Page'),jdecode(''),'/87126.html','true',[],'',''],
	['PAGE','82926',jdecode('Sangha+Events'),jdecode(''),'/82926.html','true',[],'',''],
	['PAGE','29760',jdecode('Sangha+Bulletin+Board'),jdecode(''),'/29760.html','true',[],'',''],
	['PAGE','19310',jdecode('Send+an+Email'),jdecode(''),'/19310.html','true',[],'',''],
	['PAGE','47715',jdecode('Favorites'),jdecode(''),'/47715.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='FBF36C';
theSitetree.keyvisualId='5820';
theSitetree.keyvisualName='kv_5820.jpg';
theSitetree.fontsetId='11097';
theSitetree.graphicsetId='11869';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easylife',
				paletteFamily: 	'FBF36C',
				keyvisualId: 	'5820',
				keyvisualName: 	'kv_5820.jpg',
				fontsetId: 		'11097',
				graphicsetId: 	'11869',
				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:  '6401',
internalId:  '',
customField: '20100901-130834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6494',
internalId:  '',
customField: '20100612-122546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6515',
internalId:  '',
customField: '20100901-123521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6473',
internalId:  '',
customField: '20100901-124851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6452',
internalId:  '',
customField: '20100612-122514'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9912',
internalId:  '',
customField: '20100813-103844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47715',
internalId:  '',
customField: '20091210-201245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29760',
internalId:  '',
customField: '20100626-183830'
};
webappMappings['7008']=webappMappings['7008-3460']={
webappId:    '7008',
documentId:  '19310',
internalId:  '3460',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19310',
internalId:  '',
customField: '20090528-000704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23710',
internalId:  '',
customField: '20100210-122931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87126',
internalId:  '',
customField: '20100820-153955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62726',
internalId:  '',
customField: '20100629-131209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69726',
internalId:  '',
customField: '20100816-175715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82926',
internalId:  '',
customField: '20100820-093207'
};
webappMappings['7060']=webappMappings['7060-ec9efa96e44967e8783b88d446129d39']={
webappId:    '7060',
documentId:  '84626',
internalId:  'ec9efa96e44967e8783b88d446129d39',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84626',
internalId:  '',
customField: '20100629-134038'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLDTK';
var companyName   = 'Bloom+of+the+Present';
var htmlTitle	  = 'Bloom+of+the+Present';
var metaKeywords  = 'Carla+Brennan%2C+Bloom+of+the+Present%2C+bloomofthepresent%2C+meditation%2C+Vipassana%2C+nature%2C+retreats%2C+wilderness%2C+Santa+Cruz%2C+spiritual%2C+coaching%2C+dharma%2C+Buddhism%2C+Buddhist%2C+mindfulness%2C+Laos%2C+Ben+Lomond%2C+Moab%2C+California';
var metaContents  = 'This+website+lists+the+meditation-related+programs+and+activities+of+Vipassana+teacher+Carla+Brennan.';
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();
};
