/* [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(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','1141',jdecode('About+Us'),jdecode(''), jdecode('%2F1141%2Findex.html'), 'true',[ 
		['PAGE','1183',jdecode('The+Board'),jdecode(''), jdecode('%2F1141%2F1183.html'), 'true',[],'',''],
		['PAGE','1204',jdecode('Constitution'),jdecode(''), jdecode('%2F1141%2F1204.html'), 'true',[],'',''],
		['PAGE','1225',jdecode('Regions'),jdecode(''), jdecode('%2F1141%2F1225.html'), 'true',[],'','']
	],'',''],
	['PAGE','952',jdecode('Aims+and+Strategy'),jdecode(''), jdecode('%2F952.html'), 'true',[],'',''],
	['PAGE','1267',jdecode('Board+Meetings'),jdecode(''), jdecode('%2F1267.html'), 'true',[],'',''],
	['PAGE','116801',jdecode('CWH'),jdecode(''), jdecode('%2F116801.html'), 'true',[],'',''],
	['PAGE','47701',jdecode('Courses'),jdecode(''), jdecode('%2F47701.html'), 'true',[],'',''],
	['PAGE','973',jdecode('Events'),jdecode(''), jdecode('%2F973%2Findex.html'), 'true',[ 
		['PAGE','26101',jdecode('AOHNP+Events'),jdecode(''), jdecode('%2F973%2F26101.html'), 'true',[],'',''],
		['PAGE','26122',jdecode('Other+Events'),jdecode(''), jdecode('%2F973%2F26122.html'), 'true',[],'','']
	],'',''],
	['PAGE','1120',jdecode('Links'),jdecode(''), jdecode('%2F1120.html'), 'true',[],'',''],
	['PAGE','50001',jdecode('Members+Only'),jdecode(''), jdecode('%2F50001.html'), 'true',[],'',''],
	['PAGE','1078',jdecode('Membership'),jdecode(''), jdecode('%2F1078.html'), 'true',[],'',''],
	['PAGE','994',jdecode('News'),jdecode(''), jdecode('%2F994%2Findex.html'), 'true',[ 
		['PAGE','1015',jdecode('AOHNP+News'),jdecode(''), jdecode('%2F994%2F1015.html'), 'true',[],'',''],
		['PAGE','1036',jdecode('General+News'),jdecode(''), jdecode('%2F994%2F1036.html'), 'true',[],'',''],
		['PAGE','1057',jdecode('POOSH+News'),jdecode(''), jdecode('%2F994%2F1057.html'), 'true',[],'','']
	],'',''],
	['PAGE','1246',jdecode('Publications'),jdecode(''), jdecode('%2F1246%2Findex.html'), 'true',[ 
		['PAGE','91801',jdecode('OH+Today'),jdecode(''), jdecode('%2F1246%2F91801.html'), 'true',[],'','']
	],'',''],
	['PAGE','1099',jdecode('Vacancies'),jdecode(''), jdecode('%2F1099.html'), 'true',[],'',''],
	['PAGE','100201',jdecode('Sponsor+AOHNP'),jdecode(''), jdecode('%2F100201.html'), 'true',[],'',''],
	['PAGE','1309',jdecode('Contact'),jdecode(''), jdecode('%2F1309.html'), 'true',[],'',''],
	['PAGE','35401',jdecode('Discussion+Forum'),jdecode(''), jdecode('%2F35401.html'), 'true',[],'',''],
	['PAGE','29506',jdecode('Guestbook'),jdecode(''), jdecode('%2F29506%2Findex.html'), 'true',[ 
		['PAGE','29501',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F29506%2F29501.html'), 'false',[],'','']
	],'','']];
var siteelementCount=27;
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 prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVD7'
};
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: '20120103-160632'
};
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: '20111203-160930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20111203-162901'
};
webappMappings['1501']=webappMappings['1501-436556']={
webappId:    '1501',
documentId:  '901',
internalId:  '436556',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20111211-144728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20111211-145003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1141',
internalId:  '',
customField: '20111204-122524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20111218-143339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1204',
internalId:  '',
customField: '20111204-120921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1225',
internalId:  '',
customField: '20111204-121115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20110227-163635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1267',
internalId:  '',
customField: '20111217-110346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26122',
internalId:  '',
customField: '20111217-105956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1120',
internalId:  '',
customField: '20110817-171709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20111217-110534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20111221-143301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20110817-160153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20111221-115839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20111217-111634'
};
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: '20111217-110304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20111007-111636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100201',
internalId:  '',
customField: '20110425-172707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91801',
internalId:  '',
customField: '20111221-115916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116801',
internalId:  '',
customField: '20110817-155545'
};
var webAppHostname = 'cgi.easily.co.uk:80';
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();
};

