/* [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','5001',jdecode('Welcome'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','5182',jdecode('Client+Benefits'),jdecode(''),'/5182.html','true',[],'',''],
	['PAGE','5156',jdecode('Client+Profiles'),jdecode(''),'/5156.html','true',[],'',''],
	['PAGE','5078',jdecode('Bookkeeping+Services'),jdecode(''),'/5078.html','true',[],'',''],
	['PAGE','5104',jdecode('Secretarial+Services'),jdecode(''),'/5104.html','true',[],'',''],
	['PAGE','5130',jdecode('Business+Services'),jdecode(''),'/5130.html','true',[],'',''],
	['PAGE','12501',jdecode('About+Us'),jdecode(''),'/12501.html','true',[],'',''],
	['PAGE','5208',jdecode('Terms+of+Business'),jdecode(''),'/5208.html','true',[],'',''],
	['PAGE','7579',jdecode('Contact+Us'),jdecode(''),'/7579.html','true',[],'',''],
	['PAGE','5234',jdecode(''),jdecode(''),'/5234.html','true',[],'',''],
	['PAGE','5052',jdecode('Would+You+Like'),jdecode(''),'/5052.html','false',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F5F5F5';
theSitetree.keyvisualId='2156';
theSitetree.keyvisualName='boerse.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='407';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'F5F5F5',
				keyvisualId: 	'2156',
				keyvisualName: 	'boerse.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'407',
				contentColor: 	'666666',
				contentBGColor: 'F5F5F5',
				a_color: 		'F5F5F5',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100113-163546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20100106-153539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5078',
internalId:  '',
customField: '20100107-172432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5104',
internalId:  '',
customField: '20100107-172511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5130',
internalId:  '',
customField: '20100111-122153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5156',
internalId:  '',
customField: '20100111-120704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5182',
internalId:  '',
customField: '20100111-120033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5208',
internalId:  '',
customField: '20100111-122846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5234',
internalId:  '',
customField: '20091214-155626'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5001',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5052',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5078',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5104',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-6318']={
webappId:    '7008',
documentId:  '7579',
internalId:  '6318',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5130',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5156',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5182',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5208',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7579',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5234',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7579',
internalId:  '',
customField: '20100111-122537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20100113-164759'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3JP0';
var companyName   = 'BALANCE+ASSOCIATES+-+08000+234+369';
var htmlTitle	  = 'Bookkeeping%2CSecretarial+Support%2CBusiness+Support%2CAccounts';
var metaKeywords  = 'Bookkeeping%2CAdministration%2CManagement%2CBudgets%2CSAGE%2CReports%2CAccounts%2CSecretarial%2CSupport%2CConsultancy%2C+Personal+Assisiant.';
var metaContents  = 'Balance+Associates+is+a+firm+that+is+dedicated+to+assisting+small+to+medium+sized+businesses%2C+to+improve+their+bookkeeping%2C+secretarial+and+day+to+day+management+systems%2C+in+order+to+allow+them+to+progress+their+mainstream+functionality.';
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();
};

