/* [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','1601',jdecode('Home'),jdecode(''),'/1601.html','true',[],'',''],
	['PAGE','1652',jdecode('The+Chiropractors'),jdecode(''),'/1652.html','true',[],'',''],
	['PAGE','1673',jdecode('The+Rest+of+the+Team'),jdecode(''),'/1673.html','true',[],'',''],
	['PAGE','1694',jdecode('First+Visit+and+Treatment'),jdecode(''),'/1694.html','true',[],'',''],
	['PAGE','1715',jdecode('FAQs'),jdecode(''),'/1715.html','true',[],'',''],
	['PAGE','1736',jdecode('Service'),jdecode(''),'/1736.html','true',[],'',''],
	['PAGE','1757',jdecode('News'),jdecode(''),'/1757.html','true',[],'',''],
	['PAGE','1778',jdecode('How+to+Find+Us+'),jdecode(''),'/1778.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='E99C2E';
theSitetree.keyvisualId='9685';
theSitetree.keyvisualName='kv_9685.gif';
theSitetree.fontsetId='10659';
theSitetree.graphicsetId='11182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'E99C2E',
				keyvisualId: 	'9685',
				keyvisualName: 	'kv_9685.gif',
				fontsetId: 		'10659',
				graphicsetId: 	'11182',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				a_color: 		'000000',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20100123-215946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1757',
internalId:  '',
customField: '20100123-215640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1652',
internalId:  '',
customField: '20100123-220336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1694',
internalId:  '',
customField: '20070108-114402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1673',
internalId:  '',
customField: '20100123-215113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1715',
internalId:  '',
customField: '20070104-130534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1736',
internalId:  '',
customField: '20100123-220140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1778',
internalId:  '',
customField: '20071113-162416'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXX68';
var companyName   = 'Hythe+Chiropractic+Centre';
var htmlTitle	  = 'Hythe+Chiropractic+Centre';
var metaKeywords  = 'chiropractic%2C+bad+back%2C+manipulate%2C+spine%2C+dry+needling%2C+ultra+sound%2C+laser+treatment%2C+babies+colic%2C+reflexology%2C+indian+head+massage%2C+orthotics%2C+foot+care%2C+podiatry%2C+chiropody%2C+www.Hythe+Chiropractic+Centre.com%2C+www.chirohythe.co.uk%2C+martine+huisman%2C+grant+bierling%2C+philip+dewhurst%2C+pauline+hinves%2C+ann+kelly';
var metaContents  = 'www.Hythe+Chiropractic+Centre.com%2C+www.chirohythe.co.uk';
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();
};
