/* [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','4568',jdecode('HOME'),jdecode(''), jdecode('%2F4568.html'), 'true',[],'',''],
	['PAGE','10401',jdecode('ABOUT+HEALING+HANDS'),jdecode(''), jdecode('%2F10401.html'), 'true',[],'',''],
	['PAGE','40701',jdecode('TESTIMONIALS'),jdecode(''), jdecode('%2F40701.html'), 'true',[],'',''],
	['PAGE','10422',jdecode('CONTACT+HEALING+HANDS'),jdecode(''), jdecode('%2F10422.html'), 'true',[],'',''],
	['PAGE','10443',jdecode('EVENTS+%26+NEWS'),jdecode(''), jdecode('%2F10443.html'), 'true',[],'',''],
	['PAGE','54601',jdecode('NATURE%26%23x27%3BS+SUNSHINE'),jdecode(''), jdecode('%2F54601.html'), 'true',[],'',''],
	['PAGE','47501',jdecode('MIKE%26%23x27%3BS+MAINTENANCE'),jdecode(''), jdecode('%2F47501.html'), 'true',[],'',''],
	['PAGE','10464',jdecode('HOLISTIC+MASSAGE'),jdecode(''), jdecode('%2F10464.html'), 'true',[],'',''],
	['PAGE','27101',jdecode('BENEFITS+OF+MASSAGE'),jdecode(''), jdecode('%2F27101.html'), 'true',[],'',''],
	['PAGE','14401',jdecode('OFFICE+THERAPY'),jdecode(''), jdecode('%2F14401.html'), 'true',[],'',''],
	['PAGE','13722',jdecode('INDIAN+HEAD+MASSAGE'),jdecode(''), jdecode('%2F13722.html'), 'true',[],'',''],
	['PAGE','13743',jdecode('REIKI'),jdecode(''), jdecode('%2F13743.html'), 'true',[],'',''],
	['PAGE','35701',jdecode('MEDITATION'),jdecode(''), jdecode('%2F35701.html'), 'true',[],'',''],
	['PAGE','11001',jdecode('LIGHT+FANTASTIC'),jdecode(''), jdecode('%2F11001.html'), 'true',[],'',''],
	['PAGE','11022',jdecode('WORKSHOPS'),jdecode(''), jdecode('%2F11022.html'), 'true',[],'',''],
	['PAGE','13785',jdecode('BOOK-+SPIRITUAL+LIGHT*'),jdecode(''), jdecode('%2F13785.html'), 'true',[],'',''],
	['PAGE','40727',jdecode('LINKS'),jdecode(''), jdecode('%2F40727.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1737';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='290';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1737',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'290',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4568',
internalId:  '',
customField: '20120120-160136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20110303-163621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20071022-231531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10443',
internalId:  '',
customField: '20110523-083612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10464',
internalId:  '',
customField: '20120120-161519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20080520-223930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11022',
internalId:  '',
customField: '20101209-163937'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '10422',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13722',
internalId:  '',
customField: '20071024-001622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13743',
internalId:  '',
customField: '20111024-144157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13785',
internalId:  '',
customField: '20080414-194005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20071107-134335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20111011-121515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54601',
internalId:  '',
customField: '20110810-211308'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4568',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20111024-144558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40701',
internalId:  '',
customField: '20111011-115416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40727',
internalId:  '',
customField: '20091121-144537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47501',
internalId:  '',
customField: '20091122-151627'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN24EY';
var companyName   = 'Healing+Hands';
var htmlTitle	  = 'healinghandsnorwich.com';
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();
};

