/* [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','1647',jdecode('Home'),jdecode(''),'/1647.html','true',[],'',''],
	['PAGE','3401',jdecode('Amblecote'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','132712',jdecode('Bilston'),jdecode(''),'/132712.html','true',[],'',''],
	['PAGE','12001',jdecode('Blackheath'),jdecode(''),'/12001.html','true',[],'',''],
	['PAGE','121812',jdecode('Bloxwich'),jdecode(''),'/121812.html','true',[],'',''],
	['PAGE','3427',jdecode('Brierley+Hill'),jdecode(''),'/3427.html','true',[],'',''],
	['PAGE','50001',jdecode('Brockmoor'),jdecode(''),'/50001.html','true',[],'',''],
	['PAGE','136012',jdecode('Caldmore'),jdecode(''),'/136012.html','true',[],'',''],
	['PAGE','121838',jdecode('Coseley'),jdecode(''),'/121838.html','true',[],'',''],
	['PAGE','14401',jdecode('Cradley'),jdecode(''),'/14401.html','true',[],'',''],
	['PAGE','3453',jdecode('Cradley+Heath'),jdecode(''),'/3453.html','true',[],'',''],
	['PAGE','72512',jdecode('Darlaston'),jdecode(''),'/72512.html','true',[],'',''],
	['PAGE','3479',jdecode('Dudley'),jdecode(''),'/3479.html','true',[],'',''],
	['PAGE','61501',jdecode('Dudley+Port'),jdecode(''),'/61501.html','true',[],'',''],
	['PAGE','154912',jdecode('Fullbrook'),jdecode(''),'/154912.html','true',[],'',''],
	['PAGE','134112',jdecode('Golds+Green'),jdecode(''),'/134112.html','true',[],'',''],
	['PAGE','135812',jdecode('Great+Bridge'),jdecode(''),'/135812.html','true',[],'',''],
	['PAGE','12157',jdecode('Greets+Green'),jdecode(''),'/12157.html','true',[],'',''],
	['PAGE','12701',jdecode('Halesowen'),jdecode(''),'/12701.html','true',[],'',''],
	['PAGE','132738',jdecode('Himley'),jdecode(''),'/132738.html','true',[],'',''],
	['PAGE','52101',jdecode('Holly+Hall'),jdecode(''),'/52101.html','true',[],'',''],
	['PAGE','12027',jdecode('Kingswinford'),jdecode(''),'/12027.html','true',[],'',''],
	['PAGE','147012',jdecode('Lower+Gornal'),jdecode(''),'/147012.html','true',[],'',''],
	['PAGE','12401',jdecode('Lye'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','72812',jdecode('Moxley'),jdecode(''),'/72812.html','true',[],'',''],
	['PAGE','145112',jdecode('Mushroom+Green'),jdecode(''),'/145112.html','true',[],'',''],
	['PAGE','12727',jdecode('Netherton'),jdecode(''),'/12727.html','false',[],'',''],
	['PAGE','100312',jdecode('Oldbury'),jdecode(''),'/100312.html','true',[],'',''],
	['PAGE','12053',jdecode('Old+Hill'),jdecode(''),'/12053.html','true',[],'',''],
	['PAGE','12079',jdecode('Oldswinford'),jdecode(''),'/12079.html','true',[],'',''],
	['PAGE','138412',jdecode('Pensnett'),jdecode(''),'/138412.html','true',[],'',''],
	['PAGE','107112',jdecode('Pleck+%26+Bescot'),jdecode(''),'/107112.html','true',[],'',''],
	['PAGE','11701',jdecode('Quarry+Bank'),jdecode(''),'/11701.html','true',[],'',''],
	['PAGE','12105',jdecode('Rowley+Regis'),jdecode(''),'/12105.html','true',[],'',''],
	['PAGE','12427',jdecode('Sedgley'),jdecode(''),'/12427.html','false',[],'',''],
	['PAGE','5401',jdecode('Stourbridge'),jdecode(''),'/5401.html','true',[],'',''],
	['PAGE','12131',jdecode('Tipton'),jdecode(''),'/12131.html','true',[],'',''],
	['PAGE','132764',jdecode('Tividale'),jdecode(''),'/132764.html','true',[],'',''],
	['PAGE','1673',jdecode('Walsall'),jdecode(''),'/1673.html','true',[],'',''],
	['PAGE','35801',jdecode('Wednesbury'),jdecode(''),'/35801.html','true',[],'',''],
	['PAGE','20901',jdecode('Wollaston'),jdecode(''),'/20901.html','false',[],'',''],
	['PAGE','52127',jdecode('Woodside'),jdecode(''),'/52127.html','true',[],'',''],
	['PAGE','123712',jdecode('Wollescote'),jdecode(''),'/123712.html','true',[],'',''],
	['PAGE','12183',jdecode('Wordsley'),jdecode(''),'/12183.html','true',[],'',''],
	['PAGE','1747',jdecode('Email+Form'),jdecode(''),'/1747.html','true',[],'','']];
var siteelementCount=45;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='5C512E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12687';
theSitetree.contentColor='D3A62A';
theSitetree.contentBGColor='484132';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rivet',
				paletteFamily: 	'5C512E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12687',
				contentColor: 	'D3A62A',
				contentBGColor: '484132',
				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:  '3401',
internalId:  '',
customField: '20100221-155409'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1647',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3479',
internalId:  '',
customField: '20100221-160014'
};
webappMappings['7008']=webappMappings['7008-3838']={
webappId:    '7008',
documentId:  '1747',
internalId:  '3838',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1647',
internalId:  '',
customField: '20100504-020737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1673',
internalId:  '',
customField: '20100221-161306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3453',
internalId:  '',
customField: '20100221-155847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100221-161025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3427',
internalId:  '',
customField: '20100221-155623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1747',
internalId:  '',
customField: '20100221-161711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20100221-160917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100221-160531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12183',
internalId:  '',
customField: '20100221-161647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20100221-155818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12053',
internalId:  '',
customField: '20100221-160736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20090228-191250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12131',
internalId:  '',
customField: '20100221-161109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20100221-161455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12027',
internalId:  '',
customField: '20100221-160423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20100221-155652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52101',
internalId:  '',
customField: '20100221-160357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52127',
internalId:  '',
customField: '20100221-161558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61501',
internalId:  '',
customField: '20100221-160052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20100221-155515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12105',
internalId:  '',
customField: '20100221-160950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12157',
internalId:  '',
customField: '20100221-160201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12727',
internalId:  '',
customField: '20090210-214243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72512',
internalId:  '',
customField: '20100221-155936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20100221-160226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72812',
internalId:  '',
customField: '20100221-160600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12079',
internalId:  '',
customField: '20100221-160809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100312',
internalId:  '',
customField: '20100221-160704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107112',
internalId:  '',
customField: '20100221-160857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12427',
internalId:  '',
customField: '20090210-213936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121812',
internalId:  '',
customField: '20100221-155543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121838',
internalId:  '',
customField: '20100221-155746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123712',
internalId:  '',
customField: '20100221-161620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132764',
internalId:  '',
customField: '20100221-161159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132712',
internalId:  '',
customField: '20100221-155432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134112',
internalId:  '',
customField: '20100221-160124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135812',
internalId:  '',
customField: '20100221-160142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136012',
internalId:  '',
customField: '20100221-155713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132738',
internalId:  '',
customField: '20100221-160335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138412',
internalId:  '',
customField: '20100221-160835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145112',
internalId:  '',
customField: '20100221-160624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147012',
internalId:  '',
customField: '20100221-160456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '154912',
internalId:  '',
customField: '20100221-160105'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE8WV';
var companyName   = 'Black+Country+Images+-+Online+Gallery';
var htmlTitle	  = 'Black+Country+Images+-+Online+Gallery';
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();
};

