/* [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','8101',jdecode('Home'),jdecode(''),'/8101.html','true',[],'',''],
	['PAGE','8664',jdecode('Improving+competitiveness'),jdecode(''),'/8664.html','true',[],'',''],
	['PAGE','23101',jdecode('Sustainable+growth'),jdecode(''),'/23101.html','true',[],'',''],
	['PAGE','8685',jdecode('Turnaround+%26+rescue'),jdecode(''),'/8685.html','true',[],'',''],
	['PAGE','8706',jdecode('Coaching+%26+mentorship'),jdecode(''),'/8706.html','true',[],'',''],
	['PAGE','54901',jdecode('Corporate+governance'),jdecode(''),'/54901.html','true',[],'',''],
	['PAGE','49501',jdecode('Training+%26+development'),jdecode(''),'/49501.html','true',[],'',''],
	['PAGE','41101',jdecode('Mergers+%26+acquisitions'),jdecode(''),'/41101/index.html','true',[ 
		['PAGE','15901',jdecode('Growth+investments'),jdecode(''),'/41101/15901.html','true',[],'',''],
		['PAGE','49322',jdecode('Businesses+for+sale'),jdecode(''),'/41101/49322.html','true',[],'',''],
		['PAGE','41122',jdecode('Investor+zone'),jdecode(''),'/41101/41122.html','true',[],'',''],
		['PAGE','41201',jdecode('Sell+your+business'),jdecode(''),'/41101/41201.html','true',[],'','']
	],'',''],
	['PAGE','30843',jdecode('Free+resources'),jdecode(''),'/30843.html','true',[],'',''],
	['PAGE','8748',jdecode('Our+team'),jdecode(''),'/8748.html','true',[],'',''],
	['PAGE','8152',jdecode('Contact+us'),jdecode(''),'/8152.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='D43F3F';
theSitetree.keyvisualId='9814';
theSitetree.keyvisualName='kv_9814.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13031';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'D43F3F',
				keyvisualId: 	'9814',
				keyvisualName: 	'kv_9814.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13031',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1667']={
webappId:    '7008',
documentId:  '8152',
internalId:  '1667',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20100829-150859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8664',
internalId:  '',
customField: '20090909-203729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8685',
internalId:  '',
customField: '20090909-201549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8706',
internalId:  '',
customField: '20090909-201809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8748',
internalId:  '',
customField: '20090829-110124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8152',
internalId:  '',
customField: '20100829-151124'
};
webappMappings['7008']=webappMappings['7008-2386']={
webappId:    '7008',
documentId:  '23101',
internalId:  '2386',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1839']={
webappId:    '7008',
documentId:  '41122',
internalId:  '1839',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20100829-145159'
};
webappMappings['7008']=webappMappings['7008-2388']={
webappId:    '7008',
documentId:  '8706',
internalId:  '2388',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-2385']={
webappId:    '7008',
documentId:  '8664',
internalId:  '2385',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1707']={
webappId:    '7008',
documentId:  '15901',
internalId:  '1707',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20100829-144037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30843',
internalId:  '',
customField: '20090909-071814'
};
webappMappings['7008']=webappMappings['7008-2387']={
webappId:    '7008',
documentId:  '8685',
internalId:  '2387',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1840']={
webappId:    '7008',
documentId:  '41201',
internalId:  '1840',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41101',
internalId:  '',
customField: '20100829-150957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41122',
internalId:  '',
customField: '20090826-180634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20090826-181111'
};
webappMappings['7008']=webappMappings['7008-2375']={
webappId:    '7008',
documentId:  '49322',
internalId:  '2375',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-2389']={
webappId:    '7008',
documentId:  '49501',
internalId:  '2389',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49501',
internalId:  '',
customField: '20090909-204629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49322',
internalId:  '',
customField: '20101108-184711'
};
webappMappings['7008']=webappMappings['7008-2456']={
webappId:    '7008',
documentId:  '54901',
internalId:  '2456',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54901',
internalId:  '',
customField: '20090909-203907'
};
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN2CAM';
var companyName   = 'Profitably+Managing+Growth';
var htmlTitle	  = 'Profitably+managing+growth';
var metaKeywords  = 'Profitable+growth%2C+Turnarounds%2C+Business+venture%2C+small+business%2C+owner+managed+business%2C+CORPORATE+RENEWAL%2C+Business+diagnostics%2C+Turnaround+strategy%2C+Turnaround+plans%2C+Crisis+management%2C+Implementation+projects%2C+Portfolio+performance+support%2C+Acquisitions%2C+Due+diligences%2C+Business+planning%2C+Feasibility+Studies%2C+Balanced+scorecard%2C+Entrepreneurial+strategy%2C+Business+process+engineering%2C+Commercialisation+projects%2C+Alignment+to+market+needs%2C+BUSINESS+VENTURING%2C+business+finance%2C+business+for+sale%2C+business+broker%2C+business+acquisitions%2C+business+finance%2C+corporate+finance%2C+mergers+acquisitions%2C+business+model%2C+owner+manager%2C+business+model+innovation%2C+business+performance%2C+profit+performance%2C+Networking%2C+Strategic+workshops%2C+Interim+management%2C+Entrepreneur+mentorship%2C++Executive+decision+support%2C+Implementation+projects%2C+Executive+placements%2C+BUSINESS+LEADERSHIP%2C+company+director%2C+cash+flow+management';
var metaContents  = 'Profit+Growth+Consultants+focus+on+assisting+clients+to+PROFITABLY+MANAGING+GROWTH+through+a+range+of+targeted+interventions+built+on+a+foundation+of+business+model+optimisation.+The+services+are+clustered+into+three+groups%3A+BUSINESS+VENTURING%2C+CORPORATE+RENEWAL%2C+BUSINESS+LEADERSHIP';
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();
};

