/* [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','2379',jdecode('Home'),jdecode(''),'/2379.html','true',[],'',''],
	['PAGE','95601',jdecode('Database+Subscription'),jdecode(''),'/95601.html','true',[],'',''],
	['PAGE','84401',jdecode('Burial+Registers'),jdecode(''),'/84401.html','true',[],'',''],
	['PAGE','100901',jdecode('Urgent+Appeal+-+St+John%2C+Dudley'),jdecode(''),'/100901.html','true',[],'',''],
	['PAGE','37401',jdecode('All+Saints%2C+Bloxwich'),jdecode(''),'/37401.html','true',[],'',''],
	['PAGE','31901',jdecode('Baptist+Chapel%2C+Brierley+Hill'),jdecode(''),'/31901.html','true',[],'',''],
	['PAGE','34901',jdecode('Brierley+Hill+Methodist'),jdecode(''),'/34901.html','true',[],'',''],
	['PAGE','56801',jdecode('Christ+Church%2C+Coseley'),jdecode(''),'/56801.html','true',[],'',''],
	['PAGE','64901',jdecode('Gough+Road%2C+Coseley+'),jdecode(''),'/64901.html','true',[],'',''],
	['PAGE','79801',jdecode('St+Andrew%2C+Netherton'),jdecode(''),'/79801.html','true',[],'',''],
	['PAGE','52001',jdecode('St+Chad+%26+All+Saints%2C+Sedgley'),jdecode(''),'/52001.html','true',[],'',''],
	['PAGE','16927',jdecode('St+James+The+Great%2C+Dudley'),jdecode(''),'/16927.html','true',[],'',''],
	['PAGE','14727',jdecode('St+John%2C+Brierley+Hill'),jdecode(''),'/14727.html','true',[],'',''],
	['PAGE','73901',jdecode('St+John+The+Evangelist%2C+Dudley'),jdecode(''),'/73901.html','true',[],'',''],
	['PAGE','27101',jdecode('St+John+the+Baptist%2C+Halesowen'),jdecode(''),'/27101.html','true',[],'',''],
	['PAGE','5301',jdecode('St+Luke%2C+Cradley+Heath'),jdecode(''),'/5301.html','true',[],'',''],
	['PAGE','29001',jdecode('St+Mary%2C+Oldswinford'),jdecode(''),'/29001.html','true',[],'',''],
	['PAGE','18127',jdecode('St+Mary%26%23x27%3Bs+The+Mount%2C+Walsall'),jdecode(''),'/18127.html','true',[],'',''],
	['PAGE','51301',jdecode('St+Michael%2C+Himley'),jdecode(''),'/51301.html','true',[],'',''],
	['PAGE','43601',jdecode('St+Peter%2C+Greets+Green'),jdecode(''),'/43601.html','true',[],'',''],
	['PAGE','49601',jdecode('Important+Bits'),jdecode(''),'/49601.html','true',[],'',''],
	['PAGE','67801',jdecode('Links'),jdecode(''),'/67801.html','true',[],'',''],
	['PAGE','48301',jdecode('Email+Form'),jdecode(''),'/48301.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='33405B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12686';
theSitetree.contentColor='D3A62A';
theSitetree.contentBGColor='363B49';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rivet',
				paletteFamily: 	'33405B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12686',
				contentColor: 	'D3A62A',
				contentBGColor: '363B49',
				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:  '27101',
internalId:  '',
customField: '20110104-041140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14727',
internalId:  '',
customField: '20110104-040805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20110104-040210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20110104-041309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2379',
internalId:  '',
customField: '20110705-003225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18127',
internalId:  '',
customField: '20110104-041533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16927',
internalId:  '',
customField: '20110104-040740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20110104-040135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20110104-041446'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2379',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20110104-040016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20110104-041747'
};
webappMappings['7008']=webappMappings['7008-4773']={
webappId:    '7008',
documentId:  '48301',
internalId:  '4773',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20110104-042137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49601',
internalId:  '',
customField: '20110104-041825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51301',
internalId:  '',
customField: '20110104-041717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52001',
internalId:  '',
customField: '20110104-040719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56801',
internalId:  '',
customField: '20110104-040302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64901',
internalId:  '',
customField: '20110104-040418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67801',
internalId:  '',
customField: '20110704-193802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73901',
internalId:  '',
customField: '20110104-041000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79801',
internalId:  '',
customField: '20110104-040547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84401',
internalId:  '',
customField: '20110104-035800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95601',
internalId:  '',
customField: '20110705-004906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100901',
internalId:  '',
customField: '20110705-010312'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEHCM';
var companyName   = 'Black+Country+Churchyards';
var htmlTitle	  = 'Black+Country+Churchyards';
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();
};

