/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','1141',jdecode('About+Us'),jdecode(''),'/1141/index.html','true',[ 
		['PAGE','1183',jdecode('The+Board'),jdecode(''),'/1141/1183.html','true',[],'',''],
		['PAGE','1204',jdecode('Constitution'),jdecode(''),'/1141/1204.html','true',[],'',''],
		['PAGE','1225',jdecode('Regions'),jdecode(''),'/1141/1225.html','true',[],'','']
	],'',''],
	['PAGE','952',jdecode('Aims+and+Strategy'),jdecode(''),'/952.html','true',[],'',''],
	['PAGE','1267',jdecode('Board+Meetings'),jdecode(''),'/1267.html','true',[],'',''],
	['PAGE','116801',jdecode('CWH'),jdecode(''),'/116801.html','true',[],'',''],
	['PAGE','47701',jdecode('Courses'),jdecode(''),'/47701.html','true',[],'',''],
	['PAGE','973',jdecode('Events'),jdecode(''),'/973/index.html','true',[ 
		['PAGE','26101',jdecode('AOHNP+Events'),jdecode(''),'/973/26101.html','true',[],'',''],
		['PAGE','26122',jdecode('Other+Events'),jdecode(''),'/973/26122.html','true',[],'','']
	],'',''],
	['PAGE','1120',jdecode('Links'),jdecode(''),'/1120.html','true',[],'',''],
	['PAGE','50001',jdecode('Members+Only'),jdecode(''),'/50001.html','true',[],'',''],
	['PAGE','1078',jdecode('Membership'),jdecode(''),'/1078.html','true',[],'',''],
	['PAGE','994',jdecode('News'),jdecode(''),'/994/index.html','true',[ 
		['PAGE','1015',jdecode('AOHNP+News'),jdecode(''),'/994/1015.html','true',[],'',''],
		['PAGE','1036',jdecode('General+News'),jdecode(''),'/994/1036.html','true',[],'',''],
		['PAGE','1057',jdecode('POOSH+News'),jdecode(''),'/994/1057.html','true',[],'','']
	],'',''],
	['PAGE','50701',jdecode('One+Voice'),jdecode(''),'/50701.html','true',[],'',''],
	['PAGE','1246',jdecode('Publications'),jdecode(''),'/1246/index.html','true',[ 
		['PAGE','91801',jdecode('OH+Today'),jdecode(''),'/1246/91801.html','true',[],'','']
	],'',''],
	['PAGE','1099',jdecode('Vacancies'),jdecode(''),'/1099.html','true',[],'',''],
	['PAGE','100201',jdecode('Sponsor+AOHNP'),jdecode(''),'/100201.html','true',[],'',''],
	['PAGE','1309',jdecode('Contact'),jdecode(''),'/1309.html','true',[],'',''],
	['PAGE','35401',jdecode('Discussion+Forum'),jdecode(''),'/35401.html','true',[],'',''],
	['PAGE','29506',jdecode('Guestbook'),jdecode(''),'/29506/index.html','true',[ 
		['PAGE','29501',jdecode('Read+Guestbook'),jdecode(''),'/29506/29501.html','false',[],'','']
	],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Abstract';
theSitetree.paletteFamily='FFF0D4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10551';
theSitetree.graphicsetId='10582';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFF0D4';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Abstract',
				paletteFamily: 	'FFF0D4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10551',
				graphicsetId: 	'10582',
				contentColor: 	'000000',
				contentBGColor: 'FFF0D4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100804-201944'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-29506anbt10inxxiv']={
webappId:    '1002',
documentId:  '29506',
internalId:  '29506anbt10inxxiv',
customField: 'icq=false'
};
webappMappings['1003']=webappMappings['1003-anbt10inxxiv112137d4102']={
webappId:    '1003',
documentId:  '35401',
internalId:  'anbt10inxxiv112137d4102',
customField: 'en:GB:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20100519-111640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20100802-212855'
};
webappMappings['1501']=webappMappings['1501-436556']={
webappId:    '1501',
documentId:  '901',
internalId:  '436556',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20100104-162832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20100802-210203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1141',
internalId:  '',
customField: '20100104-115107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20100123-161013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1204',
internalId:  '',
customField: '20100104-145434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1225',
internalId:  '',
customField: '20100115-150059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20100104-150140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1267',
internalId:  '',
customField: '20100802-203816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26122',
internalId:  '',
customField: '20100804-201718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1120',
internalId:  '',
customField: '20100104-162004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20100105-113312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20100802-212237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20090808-161804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20100802-215331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20100802-213852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1309',
internalId:  '',
customField: '20070111-112650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20070421-103429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29506',
internalId:  '',
customField: '20070112-155737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20070112-155737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20100802-213222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20100802-211540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50701',
internalId:  '',
customField: '20090712-152255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100201',
internalId:  '',
customField: '20090515-122752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91801',
internalId:  '',
customField: '20100105-112815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116801',
internalId:  '',
customField: '20100104-151513'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXXIV';
var companyName   = 'AOHNP+%28UK%29';
var htmlTitle	  = 'AOHNP+%28UK%29';
var metaKeywords  = 'Occupational+Health%3B+Nursing%3B+Health+and+Safety%3B+Wellbeing';
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();
};
