/* [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','48012',jdecode('Home+Page'),jdecode(''),'/48012.html','true',[],'',''],
	['PAGE','37012',jdecode('About+Adrian'),jdecode(''),'/37012.html','true',[],'',''],
	['PAGE','45112',jdecode('More+About+Adrian'),jdecode(''),'/45112/index.html','true',[ 
		['PAGE','45912',jdecode('Speaking'),jdecode(''),'/45112/45912.html','true',[],'',''],
		['PAGE','45938',jdecode('Driving'),jdecode(''),'/45112/45938.html','true',[],'','']
	],'',''],
	['PAGE','47612',jdecode('Motivation+%26+Philosophy'),jdecode(''),'/47612.html','true',[],'',''],
	['PAGE','39412',jdecode('Testimonials'),jdecode(''),'/39412.html','true',[],'',''],
	['PAGE','38212',jdecode('Web+Links'),jdecode(''),'/38212.html','true',[],'',''],
	['PAGE','5901',jdecode('Home+Page+%28OLD%29'),jdecode(''),'/5901.html','false',[],'',''],
	['PAGE','15501',jdecode('What+Adrian+Teaches+%28OLD%29'),jdecode(''),'/15501.html','false',[],'',''],
	['PAGE','15601',jdecode('How+Adrian+Teaches+%28OLD%29'),jdecode(''),'/15601.html','false',[],'',''],
	['PAGE','22201',jdecode('About+Speaking+%28OLD%29'),jdecode(''),'/22201.html','false',[],'',''],
	['PAGE','24101',jdecode('About+Voice+%28OLD%29'),jdecode(''),'/24101.html','false',[],'',''],
	['PAGE','21601',jdecode('Corporate+Training+%28OLD%29'),jdecode(''),'/21601.html','false',[],'',''],
	['PAGE','21627',jdecode('Charitable+Sector+%28OLD%29'),jdecode(''),'/21627.html','false',[],'',''],
	['PAGE','9101',jdecode('About+Adrian+%28OLD%29'),jdecode(''),'/9101.html','false',[],'',''],
	['PAGE','11401',jdecode('More+About+Adrian+%28OLD%29'),jdecode(''),'/11401.html','false',[],'',''],
	['PAGE','26601',jdecode('Speaking+%28OLD%29'),jdecode(''),'/26601.html','false',[],'',''],
	['PAGE','26501',jdecode('Driving+%28OLD%29'),jdecode(''),'/26501.html','false',[],'',''],
	['PAGE','11801',jdecode('Testimonials+%28OLD%29'),jdecode(''),'/11801.html','false',[],'',''],
	['PAGE','33512',jdecode('Book+Recommendations'),jdecode(''),'/33512.html','false',[],'',''],
	['PAGE','2701',jdecode('Contact+Adrian'),jdecode(''),'/2701.html','true',[],'',''],
	['PAGE','14201',jdecode('Web+Links+%28OLD%29'),jdecode(''),'/14201.html','false',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='D72B2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10893';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'D72B2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10893',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D72B2B',
				e_color: 		'D72B2B',
				f_color: 		'D72B2B',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20100620-090551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100326-200414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20100327-102256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20100330-090059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100327-101346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20100330-093026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20100330-112953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20100330-112739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20100125-100833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21627',
internalId:  '',
customField: '20100330-093540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20100125-100751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20100125-100812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20100330-093949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20100330-092232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33512',
internalId:  '',
customField: '20100126-142949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38212',
internalId:  '',
customField: '20100620-084840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37012',
internalId:  '',
customField: '20100620-085121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39412',
internalId:  '',
customField: '20100620-084820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45112',
internalId:  '',
customField: '20100620-084949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45912',
internalId:  '',
customField: '20100620-085018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45938',
internalId:  '',
customField: '20100620-085046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47612',
internalId:  '',
customField: '20100620-084912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48012',
internalId:  '',
customField: '20100620-085151'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3MNS';
var companyName   = '';
var htmlTitle	  = 'Adrian+Barrett+-+Speaker+%E2%97%8F+Trainer+%E2%97%8F+Mentor+%E2%97%8F+Coach';
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();
};
