/* [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','1701',jdecode('Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','66237',jdecode('The+Black+Country'),jdecode(''), jdecode('%2F66237.html'), 'true',[],'',''],
	['PAGE','51337',jdecode('Black+Country+Postcards'),jdecode(''), jdecode('%2F51337.html'), 'true',[],'',''],
	['PAGE','262017',jdecode('Black+Country+Churches'),jdecode(''), jdecode('%2F262017.html'), 'true',[],'',''],
	['PAGE','134959',jdecode('Black+Country+Day+Trips'),jdecode(''), jdecode('%2F134959.html'), 'true',[],'',''],
	['PAGE','155095',jdecode('Black+Country+Industries+'),jdecode(''), jdecode('%2F155095.html'), 'true',[],'',''],
	['PAGE','161695',jdecode('Black+Country+Schools'),jdecode(''), jdecode('%2F161695.html'), 'true',[],'',''],
	['PAGE','262043',jdecode('Black+Country+Shops'),jdecode(''), jdecode('%2F262043.html'), 'true',[],'',''],
	['PAGE','10826',jdecode('Old+Family+Photos'),jdecode(''), jdecode('%2F10826.html'), 'true',[],'',''],
	['PAGE','52937',jdecode('Old+Holiday+Photos'),jdecode(''), jdecode('%2F52937.html'), 'true',[],'',''],
	['PAGE','66637',jdecode('Old+Holiday+Postcards'),jdecode(''), jdecode('%2F66637.html'), 'true',[],'',''],
	['PAGE','123548',jdecode('Old+Costume+Styles'),jdecode(''), jdecode('%2F123548.html'), 'true',[],'',''],
	['PAGE','131059',jdecode('Old+Transport'),jdecode(''), jdecode('%2F131059.html'), 'true',[],'',''],
	['PAGE','10852',jdecode('Miscellany%2FMemorabilia'),jdecode(''), jdecode('%2F10852.html'), 'true',[],'',''],
	['PAGE','159795',jdecode('Old+Invoices%2FBill+Heads'),jdecode(''), jdecode('%2F159795.html'), 'true',[],'',''],
	['PAGE','190717',jdecode('Old+Business+Adverts'),jdecode(''), jdecode('%2F190717.html'), 'true',[],'',''],
	['PAGE','156095',jdecode('Nostalgic+Adverts'),jdecode(''), jdecode('%2F156095.html'), 'true',[],'',''],
	['PAGE','181506',jdecode('Significant+Events'),jdecode(''), jdecode('%2F181506.html'), 'true',[],'',''],
	['PAGE','129759',jdecode('Eminent+People'),jdecode(''), jdecode('%2F129759.html'), 'true',[],'',''],
	['PAGE','131759',jdecode('Tribute+to+ARP+Messenger'),jdecode(''), jdecode('%2F131759.html'), 'true',[],'',''],
	['PAGE','10878',jdecode('Black+Country+Memories'),jdecode(''), jdecode('%2F10878.html'), 'true',[],'',''],
	['PAGE','143459',jdecode('Requests+for+Info%2FPhotos'),jdecode(''), jdecode('%2F143459.html'), 'true',[],'',''],
	['PAGE','40437',jdecode('Parish+Records'),jdecode(''), jdecode('%2F40437.html'), 'true',[],'',''],
	['PAGE','108248',jdecode('Monumental+Inscriptions'),jdecode(''), jdecode('%2F108248.html'), 'true',[],'',''],
	['PAGE','10956',jdecode('Research+Service'),jdecode(''), jdecode('%2F10956.html'), 'true',[],'',''],
	['PAGE','262117',jdecode('Book+Reviews'),jdecode(''), jdecode('%2F262117.html'), 'true',[],'',''],
	['PAGE','265117',jdecode('Prints+For+Sale'),jdecode(''), jdecode('%2F265117.html'), 'true',[],'',''],
	['PAGE','50237',jdecode('Important+Bits'),jdecode(''), jdecode('%2F50237.html'), 'true',[],'',''],
	['PAGE','134059',jdecode('Email+Form+%26+Links'),jdecode(''), jdecode('%2F134059.html'), 'true',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Practice';
theSitetree.paletteFamily='D7D5D7';
theSitetree.keyvisualId='6798';
theSitetree.keyvisualName='kv_6798.jpg';
theSitetree.fontsetId='11218';
theSitetree.graphicsetId='12028';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B2B2B2';
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: 			'Practice',
				paletteFamily: 	'D7D5D7',
				keyvisualId: 	'6798',
				keyvisualName: 	'kv_6798.jpg',
				fontsetId: 		'11218',
				graphicsetId: 	'12028',
				contentColor: 	'000000',
				contentBGColor: 'B2B2B2',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20111123-141518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155095',
internalId:  '',
customField: '20111118-144650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40437',
internalId:  '',
customField: '20110413-233513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134059',
internalId:  '',
customField: '20110413-232259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10878',
internalId:  '',
customField: '20111118-144907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10826',
internalId:  '',
customField: '20111116-151252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10852',
internalId:  '',
customField: '20111116-151142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129759',
internalId:  '',
customField: '20110411-173144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181506',
internalId:  '',
customField: '20110411-173207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159795',
internalId:  '',
customField: '20110411-173415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10956',
internalId:  '',
customField: '20110411-192707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131759',
internalId:  '',
customField: '20110411-173127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123548',
internalId:  '',
customField: '20110411-173525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52937',
internalId:  '',
customField: '20110411-173636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51337',
internalId:  '',
customField: '20111118-010903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '190717',
internalId:  '',
customField: '20110411-173353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '262017',
internalId:  '',
customField: '20111118-144118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66637',
internalId:  '',
customField: '20110411-173612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156095',
internalId:  '',
customField: '20110411-173333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66237',
internalId:  '',
customField: '20110411-173916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50237',
internalId:  '',
customField: '20110411-172749'
};
webappMappings['7008']=webappMappings['7008-3461']={
webappId:    '7008',
documentId:  '134059',
internalId:  '3461',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161695',
internalId:  '',
customField: '20111118-144436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131059',
internalId:  '',
customField: '20110412-185205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143459',
internalId:  '',
customField: '20110411-172918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108248',
internalId:  '',
customField: '20110411-192029'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134959',
internalId:  '',
customField: '20110413-030241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '262043',
internalId:  '',
customField: '20111117-170017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '265117',
internalId:  '',
customField: '20111118-015858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '262117',
internalId:  '',
customField: '20111118-145048'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEWEP';
var companyName   = 'Black+Country+Genealogy+%26+Family+History';
var htmlTitle	  = 'Black+Country+Genealogy+%26+Family+History';
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();
};

