/* [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','4101',jdecode('Home'),jdecode(''),'/4101.html','true',[],'',''],
	['PAGE','17701',jdecode('For+Individuals'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','11001',jdecode('For+Coaches'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','7627',jdecode('For+Teachers'),jdecode(''),'/7627.html','true',[],'',''],
	['PAGE','11301',jdecode('For+Entrepreneurs'),jdecode(''),'/11301.html','true',[],'',''],
	['PAGE','7601',jdecode('For+Small+Businesses'),jdecode(''),'/7601.html','true',[],'',''],
	['PAGE','11901',jdecode('Testimonials'),jdecode(''),'/11901.html','true',[],'',''],
	['PAGE','13401',jdecode('Investment'),jdecode(''),'/13401.html','true',[],'',''],
	['PAGE','14101',jdecode('Shop'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','11427',jdecode('Jobs'),jdecode(''),'/11427.html','false',[],'',''],
	['PAGE','4152',jdecode('About+us'),jdecode(''),'/4152.html','true',[],'',''],
	['PAGE','4178',jdecode('Contact+Us'),jdecode(''),'/4178.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Quadrat';
theSitetree.paletteFamily='C95293';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10449';
theSitetree.graphicsetId='10839';
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: 			'Quadrat',
				paletteFamily: 	'C95293',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10449',
				graphicsetId: 	'10839',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'C95293',
				e_color: 		'807E7E',
				f_color: 		'434242',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20100809-165746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4152',
internalId:  '',
customField: '20100809-172200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4178',
internalId:  '',
customField: '20100809-172311'
};
webappMappings['7008']=webappMappings['7008-4887']={
webappId:    '7008',
documentId:  '4178',
internalId:  '4887',
customField: 'language:en;country:GB;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100809-170958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7627',
internalId:  '',
customField: '20100809-170805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100809-170551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100809-170859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20100809-170108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11427',
internalId:  '',
customField: '20100129-210720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100809-171547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20100809-163845'
};
webappMappings['4001']=webappMappings['4001-11141368']={
webappId:    '4001',
documentId:  '14101',
internalId:  '11141368',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100809-165408'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN31X8';
var companyName   = 'Purple+Coaching';
var htmlTitle	  = 'Purple+Coaching+-+We+Coach+Entrepreneurs%2C+Businesses%2C+Coaches%2C+Teachers%3B+Life-Coaching';
var metaKeywords  = 'actualisation%2C+Altrincham%2C+business%2C+business+coach%2C+business+coaching%2C+businesses%2C+career%2C+Cheshire%2C+coach%2C+coaches%2C+coaching%2C+coaching+academy%2C+coaching+mentor%2C+director%2C+directors%2C+education%2C+entrepreneur%2C+entrepreneurs%2C+free%2C+Lancashire%2C+life+coach%2C+life-coach%2C++life+coaching%2C++life-coaching%2C+Manchester%2C+mentor%2C+mentor+coach%2C+mentors%2C+mentoring%2C+North-West%2C+performance+coaching%2C+personal+development%2C+purple%2C+Purple+Coaching%2C+SME%2C+start-up%2C+teacher%2C+teachers%2C+training%2C+vision';
var metaContents  = 'Coach+and+mentor+services+for+clients+across+the+UK%2C+and+beyond.++FREE+initial+consultation.++Purple+Coaching+provide+our+clients+with+outstanding+one-to-one+Coaching+and+a+range+of+other+first-rate+Personal+Development+services%3A+-+Mentoring+and+Coaching+for+Coaches++-+Professional+Coaching+for+Entrepreneurs+-+Business+Coaching+for+Directors+of+existing+and+start-up+businesses+-+Career+coaching+for+Teachers+and+other+Education+%2F+Training+professionals+-+Personal+Performance+Coaching+for+any+individual+';
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();
};
