/* [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','2701',jdecode('Home'),jdecode(''),'/2701.html','true',[],'',''],
	['PAGE','2901',jdecode('Susan+King'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','11912',jdecode('Transformational+Therapy'),jdecode(''),'/11912.html','true',[],'',''],
	['PAGE','4201',jdecode('Therapist+Training'),jdecode(''),'/4201.html','true',[],'',''],
	['PAGE','8612',jdecode('Spiritual+Development'),jdecode(''),'/8612.html','true',[],'',''],
	['PAGE','8638',jdecode('Journey+Into+the+Heart'),jdecode(''),'/8638.html','true',[],'',''],
	['PAGE','8664',jdecode('Journey+of+Self+Discovery'),jdecode(''),'/8664.html','true',[],'',''],
	['PAGE','3101',jdecode('Courses%2C+Dates%2C+Venues'),jdecode(''),'/3101.html','true',[],'',''],
	['PAGE','3127',jdecode('Bespoke+sessions'),jdecode(''),'/3127.html','true',[],'',''],
	['PAGE','5927',jdecode('Facts'),jdecode(''),'/5927.html','true',[],'',''],
	['PAGE','2927',jdecode('Contact'),jdecode(''),'/2927.html','true',[],'',''],
	['PAGE','7401',jdecode('Testimonials'),jdecode(''),'/7401.html','true',[],'',''],
	['PAGE','2953',jdecode('Guestbook'),jdecode(''),'/2953.html','true',[],'',''],
	['PAGE','11012',jdecode('Blog'),jdecode(''),'/11012.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='A8A7A9';
theSitetree.keyvisualId='6882';
theSitetree.keyvisualName='kv_6882.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12032';
theSitetree.contentColor='4E4E4E';
theSitetree.contentBGColor='B6B5B7';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'A8A7A9',
				keyvisualId: 	'6882',
				keyvisualName: 	'kv_6882.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12032',
				contentColor: 	'4E4E4E',
				contentBGColor: 'B6B5B7',
				a_color: 		'B6B5B7',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20090920-105323'
};
webappMappings['7008']=webappMappings['7008-5612']={
webappId:    '7008',
documentId:  '2927',
internalId:  '5612',
customField: 'language:en;country:GB;'
};
webappMappings['1002']=webappMappings['1002-2953anbt10in3w8n']={
webappId:    '1002',
documentId:  '2953',
internalId:  '2953anbt10in3w8n',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2953',
internalId:  '',
customField: '20090919-161200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100403-111616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20100806-223018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3127',
internalId:  '',
customField: '20100403-111351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2927',
internalId:  '',
customField: '20090919-161102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20100720-213408'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5927',
internalId:  '',
customField: '20091228-083954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20100806-223918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8612',
internalId:  '',
customField: '20091227-152349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8638',
internalId:  '',
customField: '20091228-083121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8664',
internalId:  '',
customField: '20091227-152231'
};
webappMappings['1501']=webappMappings['1501-10968297']={
webappId:    '1501',
documentId:  '2701',
internalId:  '10968297',
customField: '1501'
};
webappMappings['7050']=webappMappings['7050-3781']={
webappId:    '7050',
documentId:  '11012',
internalId:  '3781',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11012',
internalId:  '',
customField: '20100321-141151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11912',
internalId:  '',
customField: '20100403-111119'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3W8N';
var companyName   = 'Journey+to+Wholeness';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

