/* [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','5601',jdecode('Home'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','5652',jdecode('About+Keith'),jdecode(''),'/5652.html','true',[],'',''],
	['PAGE','5678',jdecode('Associates'),jdecode(''),'/5678.html','true',[],'',''],
	['PAGE','76555',jdecode('What+our+patients+say+'),jdecode(''),'/76555.html','true',[],'',''],
	['PAGE','5704',jdecode('Brentwood+Practice'),jdecode(''),'/5704.html','true',[],'',''],
	['PAGE','5730',jdecode('Ingatestone+Practice'),jdecode(''),'/5730.html','true',[],'',''],
	['PAGE','72655',jdecode('Cranial+Osteopathy+for+all'),jdecode(''),'/72655.html','true',[],'',''],
	['PAGE','5808',jdecode('Cranial++For+Children'),jdecode(''),'/5808.html','true',[],'',''],
	['PAGE','57855',jdecode('Sports+Massage'),jdecode(''),'/57855.html','true',[],'',''],
	['PAGE','5834',jdecode('Allergy+testing'),jdecode(''),'/5834.html','true',[],'',''],
	['PAGE','57455',jdecode('Traditional+Acupuncture'),jdecode(''),'/57455.html','true',[],'',''],
	['PAGE','56281',jdecode('Cosmetic+Acupuncture'),jdecode(''),'/56281.html','true',[],'',''],
	['PAGE','40955',jdecode('Plagiocephaly'),jdecode(''),'/40955.html','true',[],'',''],
	['PAGE','56255',jdecode('Opening+Hours'),jdecode(''),'/56255.html','true',[],'',''],
	['PAGE','5756',jdecode('Fees+'),jdecode(''),'/5756.html','true',[],'',''],
	['PAGE','5860',jdecode('Products+Available'),jdecode(''),'/5860.html','true',[],'',''],
	['PAGE','50455',jdecode('New+NICE+News'),jdecode(''),'/50455.html','true',[],'',''],
	['PAGE','63355',jdecode('Blog'),jdecode(''),'/63355.html','true',[],'',''],
	['PAGE','70855',jdecode('The+Equine+Osteopath'),jdecode(''),'/70855.html','true',[],'',''],
	['PAGE','72255',jdecode('Essex+Life'),jdecode(''),'/72255.html','false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='61926E';
theSitetree.keyvisualId='6905';
theSitetree.keyvisualName='kv_6905.jpg';
theSitetree.fontsetId='11214';
theSitetree.graphicsetId='12037';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='80AF8C';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'61926E',
				keyvisualId: 	'6905',
				keyvisualName: 	'kv_6905.jpg',
				fontsetId: 		'11214',
				graphicsetId: 	'12037',
				contentColor: 	'FFFFFF',
				contentBGColor: '80AF8C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20100210-193618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20100210-193650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5678',
internalId:  '',
customField: '20091214-114030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5704',
internalId:  '',
customField: '20100210-193821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5730',
internalId:  '',
customField: '20100111-161246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5756',
internalId:  '',
customField: '20100210-194321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40955',
internalId:  '',
customField: '20090309-165029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5808',
internalId:  '',
customField: '20100420-113854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5834',
internalId:  '',
customField: '20080617-113411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5860',
internalId:  '',
customField: '20080617-113718'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56255',
internalId:  '',
customField: '20100420-113340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56281',
internalId:  '',
customField: '20090619-141940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50455',
internalId:  '',
customField: '20090530-112845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57455',
internalId:  '',
customField: '20090915-145037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57855',
internalId:  '',
customField: '20090915-144835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72655',
internalId:  '',
customField: '20100210-193940'
};
webappMappings['7050']=webappMappings['7050-2415']={
webappId:    '7050',
documentId:  '63355',
internalId:  '2415',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63355',
internalId:  '',
customField: '20090819-114024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72255',
internalId:  '',
customField: '20090923-095305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76555',
internalId:  '',
customField: '20091214-141731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70855',
internalId:  '',
customField: '20091012-154310'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2ITA';
var companyName   = 'Feel+Better+Get+Moving+Quicker+with+Osteopathy';
var htmlTitle	  = 'Keith+Sparling+Osteopathy+-+The+Brentwood+Osteopath+25+Years+of+Excellence';
var metaKeywords  = 'Osteopath+Brentwood%2C+Osteopath+Essex%2C+Osteopath+chelmsford%2C+Osteopath+romford%2C+osteopath+ingatestone%2C+osteopath+mountnessing%2C+sports+injuries%2C+neck+pain%2C+shoulder+pain%2C+headaches%2C+migraines%2C+arthritis%2C+cranial+osteopath%2C+sports+massage+brentwood%2C+acupuncture+brentwood%2C+cosmetic+acupuncture+brentwood%2C+RSI%2C+chiropractor+brentwood%2C+acupunturist+brentwood%2C+acupuncture+essex';
var metaContents  = 'Keith+Sparling+and+associates+Registered+Osteopath+covering+brentwood+and+ingatestone+25+years+of+excellence+treating+many+conditions++back+pain+brentwood%2C+romford%2C+chelmsford%2C+essex.+also+we+are+able+to+offer+acupuncture%2C+sports+massage.';
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();
};
