/* [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','1511',jdecode('Home'),jdecode(''),'/1511.html','true',[],'',''],
	['PAGE','59923',jdecode('Black+Country+Gazette'),jdecode(''),'/59923/index.html','true',[ 
		['PAGE','53223',jdecode('Mushroom+Green+Chainshop'),jdecode(''),'/59923/53223.html','true',[],'',''],
		['PAGE','60323',jdecode('Wood+Green+Cemetery'),jdecode(''),'/59923/60323.html','true',[],'',''],
		['PAGE','64423',jdecode('Kudos+House+Faces+Demolition'),jdecode(''),'/59923/64423.html','true',[],'','']
	],'',''],
	['PAGE','35123',jdecode('Black+Country+Past+%26+Present'),jdecode(''),'/35123.html','true',[],'',''],
	['PAGE','38323',jdecode('My+Restoration+Wish+List'),jdecode(''),'/38323.html','true',[],'',''],
	['PAGE','6679',jdecode('Amy%26%23x27%3Bs+Page'),jdecode(''),'/6679.html','true',[],'',''],
	['PAGE','70523',jdecode('Dave+Fisher%26%23x27%3Bs+Page'),jdecode(''),'/70523.html','true',[],'',''],
	['PAGE','29223',jdecode('Gillian%26%23x27%3Bs+Page'),jdecode(''),'/29223.html','true',[],'',''],
	['PAGE','9001',jdecode('Pam+Couchman%26%23x27%3Bs+Page'),jdecode(''),'/9001.html','true',[],'',''],
	['PAGE','65023',jdecode('Peace%2C+Nicklin+%26+Beebee+'),jdecode(''),'/65023.html','true',[],'',''],
	['PAGE','25223',jdecode('Peter+Lodge%26%23x27%3Bs+Page'),jdecode(''),'/25223.html','true',[],'',''],
	['PAGE','17212',jdecode('Raymond+Griffiths%26%23x27%3B+Page'),jdecode(''),'/17212.html','true',[],'',''],
	['PAGE','68423',jdecode('Sergeant+Ivan+John+Green'),jdecode(''),'/68423.html','true',[],'',''],
	['PAGE','6601',jdecode('Steelway+Fensecure++++++++'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','30923',jdecode('Steve+Clohessy%26%23x27%3Bs+Page'),jdecode(''),'/30923.html','true',[],'',''],
	['PAGE','67123',jdecode('The+Birks+Family'),jdecode(''),'/67123.html','true',[],'',''],
	['PAGE','32423',jdecode('Tom%26%23x27%3Bs+Page'),jdecode(''),'/32423.html','true',[],'',''],
	['PAGE','49923',jdecode('Who%2C+When+%26+Where+'),jdecode(''),'/49923.html','true',[],'',''],
	['PAGE','25823',jdecode('Black+Country+Messages'),jdecode(''),'/25823.html','true',[],'',''],
	['PAGE','11101',jdecode('Requests+for+Info%2FPhotos'),jdecode(''),'/11101.html','true',[],'',''],
	['PAGE','42723',jdecode('CHARITABLE+GROUPS'),jdecode(''),'/42723.html','true',[],'',''],
	['PAGE','54323',jdecode('WMHBT'),jdecode(''),'/54323.html','true',[],'',''],
	['PAGE','44723',jdecode('LOCAL+GROUPS'),jdecode(''),'/44723.html','true',[],'',''],
	['PAGE','47423',jdecode('CHAS'),jdecode(''),'/47423.html','true',[],'',''],
	['PAGE','14301',jdecode('Friends+of+Dudley+Archives'),jdecode(''),'/14301.html','true',[],'',''],
	['PAGE','45023',jdecode('Friends+of+Sandwell+Archives'),jdecode(''),'/45023.html','true',[],'',''],
	['PAGE','46423',jdecode('Hales+owen+History+Society'),jdecode(''),'/46423.html','true',[],'',''],
	['PAGE','72523',jdecode('Heart+of+Landscape'),jdecode(''),'/72523.html','true',[],'',''],
	['PAGE','57023',jdecode('L%26WHS'),jdecode(''),'/57023.html','true',[],'',''],
	['PAGE','12701',jdecode('SJCPG'),jdecode(''),'/12701/index.html','true',[ 
		['PAGE','23023',jdecode('St+John%2C+Kate%26%23x27%3Bs+Hill%2C+Dudley'),jdecode(''),'/12701/23023.html','true',[],'',''],
		['PAGE','23123',jdecode('Commonwealth+War+Graves'),jdecode(''),'/12701/23123.html','true',[],'',''],
		['PAGE','20412',jdecode('SJCPG+-++Appeals+%26+Events'),jdecode(''),'/12701/20412.html','true',[],'','']
	],'',''],
	['PAGE','45123',jdecode('Walsall+Family+History+Society'),jdecode(''),'/45123.html','true',[],'',''],
	['PAGE','11001',jdecode('SMALL+BUSINESSES'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','19112',jdecode('Items+For+Sale'),jdecode(''),'/19112.html','true',[],'',''],
	['PAGE','19912',jdecode('Links'),jdecode(''),'/19912.html','true',[],'',''],
	['PAGE','13101',jdecode('Email+Form'),jdecode(''),'/13101.html','true',[],'','']];
var siteelementCount=40;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='633633';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12688';
theSitetree.contentColor='D3A62A';
theSitetree.contentBGColor='463230';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rivet',
				paletteFamily: 	'633633',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12688',
				contentColor: 	'D3A62A',
				contentBGColor: '463230',
				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:  '9001',
internalId:  '',
customField: '20100209-234546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42723',
internalId:  '',
customField: '20100414-155216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25823',
internalId:  '',
customField: '20100503-235317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6679',
internalId:  '',
customField: '20100209-234502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1511',
internalId:  '',
customField: '20100815-005212'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1511',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100209-234708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30923',
internalId:  '',
customField: '20100209-234735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32423',
internalId:  '',
customField: '20100209-234754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20100209-234832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100414-155352'
};
webappMappings['7008']=webappMappings['7008-5743']={
webappId:    '7008',
documentId:  '13101',
internalId:  '5743',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20100209-235255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20100504-004840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20100402-223042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17212',
internalId:  '',
customField: '20100209-234641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19112',
internalId:  '',
customField: '20100209-235227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19912',
internalId:  '',
customField: '20100504-000539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20412',
internalId:  '',
customField: '20100705-031017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23023',
internalId:  '',
customField: '20100209-234850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23123',
internalId:  '',
customField: '20100209-234931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25223',
internalId:  '',
customField: '20100209-234605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29223',
internalId:  '',
customField: '20100209-234527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35123',
internalId:  '',
customField: '20100327-164416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49923',
internalId:  '',
customField: '20100328-000108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38323',
internalId:  '',
customField: '20100209-234429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44723',
internalId:  '',
customField: '20100414-155244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45123',
internalId:  '',
customField: '20100209-235157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45023',
internalId:  '',
customField: '20100209-235113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46423',
internalId:  '',
customField: '20100209-235143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47423',
internalId:  '',
customField: '20100209-235126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53223',
internalId:  '',
customField: '20100503-231401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54323',
internalId:  '',
customField: '20100504-014252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57023',
internalId:  '',
customField: '20100815-004511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59923',
internalId:  '',
customField: '20100624-071740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60323',
internalId:  '',
customField: '20100504-052922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64423',
internalId:  '',
customField: '20100624-072659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65023',
internalId:  '',
customField: '20100624-072311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67123',
internalId:  '',
customField: '20100705-024827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68423',
internalId:  '',
customField: '20100704-060730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70523',
internalId:  '',
customField: '20100723-205619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72523',
internalId:  '',
customField: '20100719-225006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEYHC';
var companyName   = 'Black+Country+Images+%26+The+Local+Community';
var htmlTitle	  = 'Black+Country+Images+%26+The+Local+Community';
var metaKeywords  = '';
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();
};
