/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','2501',jdecode('Dr+Claire+Ryan'),jdecode(''),'/2501.html','true',[],''],
	['PAGE','15723',jdecode('Dr+Catherine+Crane'),jdecode(''),'/15723.html','true',[],''],
	['PAGE','4101',jdecode('Network+Spinal+Analysis'),jdecode(''),'/4101.html','true',[],''],
	['PAGE','4527',jdecode('Yoga'),jdecode(''),'/4527.html','true',[],''],
	['PAGE','4501',jdecode('Events+and+talks'),jdecode(''),'/4501.html','true',[],''],
	['PAGE','6012',jdecode('Links'),jdecode(''),'/6012.html','true',[],''],
	['PAGE','4553',jdecode('Contact+Us'),jdecode(''),'/4553.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='FF6600';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17360';
theSitetree.graphicsetId='12762';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Transluszent',
				paletteFamily: 	'FF6600',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17360',
				graphicsetId: 	'12762',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20090305-165834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20100124-192831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20090305-171240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4527',
internalId:  '',
customField: '20090208-194616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20100118-135202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4553',
internalId:  '',
customField: '20100118-134603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6012',
internalId:  '',
customField: '20090208-192737'
};
webappMappings['1501']=webappMappings['1501-8869488']={
webappId:    '1501',
documentId:  '2101',
internalId:  '8869488',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15723',
internalId:  '',
customField: '20100124-192813'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEGG8';
var companyName   = 'Ola+Chiropractic';
var htmlTitle	  = '';
var metaKeywords  = 'Totnes%2C+Chiropractic+%2Ctotneschiropractic.co.uk+%2C++Ola+Chiropractic+%2C+Network+Spinal+Analysis%2C+NSA%2C+Totnes+%2CDevon%2C+Dr+Claire+Ryan%2C+chiropractic%2C+yoga%2C+wellness+%2CSouth+West+England%2C+META+name%3Dkeywords+content%3Dyoga+plymouth+%2Cdevon+yoga+%2Cdevon+massage+%2Cmassage+plymouth+%2Cchiropractic+devon+%2Cyoga+devon+uk+%2Cyoga+in+plymouth+uk+%2Cchiropractor+devon+%2Cplymouth+chiropractors+%2Cchiropractor+clinic+%2Cback+pain+chiropractor+%2Cchiropractor+uk+%2Cprimary+care+chiropractors+%2Cregistered+chiropractor+%2Cfind+a+chiropractor+%2Cchild+chiropractor+%2Csports+masseur+services+%2Csports+injury+massage+%2Csports+injury+treatments+%2Calternative+sports+injury+therapy+%2Csports+injury+uk+%2Cholistic+sports+therapist+%2Ctreating+lower+back+pain%2Clower+back+pain+treatment%2Cneck+pain+treatment%2Clower+back+pain+solution%2Cnetwork+spinal+analysis+%2C+www.totneschiropractic.co.uk';
var metaContents  = 'Totnes+Chiropractic+is+the+website+of+Ola+Chiroptractic%2C+a+wellness+practice+in+Totnes%2C+Devon+run+by+Dr+Claire+Ryan.+Using+a+new+and+exciting+form+of+chiropractic+called+Network+Spinal+Analysis%2C+Totnes+Chiropractic+can+help+with+several+disorders+including+back+and+neck+problems.+NSA+also+helps+improve+your+vitality+and+energy%2C+and+can+help+with+anxiety+and+depression.+Dr+Claire+Ryan+is+also+a+qualified+yoga+teacher.';
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();
};
