/* [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 theSitetree=[ 
	['PAGE','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','2152',jdecode('About+Us'),jdecode(''),'/2152.html','true',[],''],
	['PAGE','2178',jdecode('News'),jdecode(''),'/2178.html','true',[],''],
	['PAGE','2204',jdecode('What+do+we+do'),jdecode(''),'/2204/index.html','true',[ 
		['PAGE','2230',jdecode('Cash+flow'),jdecode(''),'/2204/2230.html','true',[],''],
		['PAGE','2256',jdecode('Business+Planning'),jdecode(''),'/2204/2256.html','true',[],''],
		['PAGE','2282',jdecode('Due+diligence'),jdecode(''),'/2204/2282.html','true',[],''],
		['PAGE','2308',jdecode('Non-exec+Directorship'),jdecode(''),'/2204/2308.html','true',[],''],
		['PAGE','2334',jdecode('Outsource+Back+office'),jdecode(''),'/2204/2334.html','true',[],'']
	],''],
	['PAGE','2360',jdecode('Contact+Us'),jdecode(''),'/2360.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Solid';
theSitetree.paletteFamily='8396BA';
theSitetree.keyvisualId='4361';
theSitetree.keyvisualName='kv_4361.jpg';
theSitetree.fontsetId='10800';
theSitetree.graphicsetId='11232';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8396BA';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Solid',
				paletteFamily: 	'8396BA',
				keyvisualId: 	'4361',
				keyvisualName: 	'kv_4361.jpg',
				fontsetId: 		'10800',
				graphicsetId: 	'11232',
				contentColor: 	'FFFFFF',
				contentBGColor: '8396BA',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20090423-074948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2204',
internalId:  '',
customField: '20090316-100903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20090415-130412'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9141141']={
webappId:    '1501',
documentId:  '2101',
internalId:  '9141141',
customField: '1501'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2101',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2152',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2178',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2204',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2230',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2256',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2282',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2308',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2334',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2360',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20090507-075932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2230',
internalId:  '',
customField: '20090415-152353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2256',
internalId:  '',
customField: '20090415-152452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2282',
internalId:  '',
customField: '20090415-131953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2308',
internalId:  '',
customField: '20090415-152624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2334',
internalId:  '',
customField: '20090415-134143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2360',
internalId:  '',
customField: '20090507-080656'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEFIB';
var companyName   = 'Eightbyte+Limited';
var htmlTitle	  = 'Eightbyte+business+consultants+to+the+Computer+Games+Industry';
var metaKeywords  = 'Computer+Games+Industry%2C+interim+finance+director%2C+Guitar+Hero%2C+Activision%2C+Kuju%2C+Take+Two%2C+Vodafone%2C++Eightbyte+Limited%2C+development%2C+publishing%2C+distribution%2C+due+diligence%2C+cashflow+management%2C+product+launch%2C+business+consultant%2C+business+planning%2C+fund+raising%2C+management+accounting%2C+financial+management%2C+non+executive+directorship%2C+outsourced+back+office+function%2C+commercial+success%2C+Gerry+Tucker%2C+eightbyte.co.uk';
var metaContents  = 'Your+business+needs+the+help+and+expertise+that+can+be+provided+by+us%21Cash+flow+planning+and+managementBusiness+planning+%E2%80%93+you+need+to+know+whether+or+not+your+business+will+work+and+how+it%E2%80%99s+goingAdding+value+to+your+business+%E2%80%93+structuring+commercial+deals%2C+most+effective+ways+of+operating';
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();
};
