/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','552',jdecode('What+Is+Reiki%3F'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','20201',jdecode('Services'),jdecode(''),'/552/20201.html','true',[],''],
		['PAGE','25701',jdecode('Reiki+Credentials'),jdecode(''),'/552/25701.html','true',[],''],
		['PAGE','26501',jdecode('SSR'),jdecode(''),'/552/26501.html','true',[],'']
	],''],
	['PAGE','34501',jdecode('Testimonials'),jdecode(''),'/34501.html','true',[],''],
	['PAGE','39901',jdecode('Reiki+for+Animals'),jdecode(''),'/39901.html','true',[],''],
	['PAGE','22601',jdecode('Reiki+FAQ%26%23x27%3Bs'),jdecode(''),'/22601.html','true',[],''],
	['PAGE','22201',jdecode('Reiki+Principles'),jdecode(''),'/22201.html','true',[],''],
	['PAGE','27601',jdecode('Inspiring+Quotes'),jdecode(''),'/27601/index.html','true',[ 
		['PAGE','32901',jdecode('Dee+in+your+inbox'),jdecode(''),'/27601/32901/index.html','true',[ 
			['PAGE','33401',jdecode('Dee+in+your+inbox+%28follow+up+page%29'),jdecode(''),'/27601/32901/33401.html','false',[],'']
		],'']
	],''],
	['PAGE','573',jdecode('Contact+Dee'),jdecode(''),'/573.html','true',[],''],
	['PAGE','37006',jdecode('Guestbook'),jdecode(''),'/37006/index.html','true',[ 
		['PAGE','37001',jdecode('Read+Guestbook'),jdecode(''),'/37006/37001.html','false',[],'']
	],''],
	['PAGE','41801',jdecode('Links'),jdecode(''),'/41801.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Eatdrink';
theSitetree.paletteFamily='C63C41';
theSitetree.keyvisualId='3358';
theSitetree.keyvisualName='kv_3358.jpg';
theSitetree.fontsetId='10425';
theSitetree.graphicsetId='10736';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Eatdrink',
				paletteFamily: 	'C63C41',
				keyvisualId: 	'3358',
				keyvisualName: 	'kv_3358.jpg',
				fontsetId: 		'10425',
				graphicsetId: 	'10736',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4E1416',
				e_color: 		'4E1416',
				f_color: 		'4E1416',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1001']=webappMappings['1001-aen010inlryh11bbbbe2d15']={
webappId:    '1001',
documentId:  '32901',
internalId:  'aen010inlryh11bbbbe2d15',
customField: ''
};
webappMappings['1001']=webappMappings['1001-aen010inlryh11bbbbe2d15']={
webappId:    '1001',
documentId:  '33401',
internalId:  'aen010inlryh11bbbbe2d15',
customField: 'followUp'
};
webappMappings['1002']=webappMappings['1002-37006aen010inlryh']={
webappId:    '1002',
documentId:  '37006',
internalId:  '37006aen010inlryh',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20081125-144053'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INLRYH';
var companyName   = 'Reiki+Dee';
var htmlTitle	  = 'Reiki+Dee';
var metaKeywords  = 'reiki+dee%2C+reiki+diana%2C+diana+crenshaw%2C+reiki+Bicester%2C+reiki+Caversfield';
var metaContents  = 'reiki%2C+metaphysics%2C+alternative+healing%2C+reiki+dee%2C+diana+reiki%2C+Diana+Crenshaw%2C+Reiki+in+Bicester%2C+reiki+in+Caversfield%2C+';
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();
};
