/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1852',jdecode('Artist+Statement'),jdecode(''),'/1852.html','true',[],'',''],
	['PAGE','1878',jdecode('News'),jdecode(''),'/1878.html','true',[],'',''],
	['PAGE','1956',jdecode('Sculptures+%2F+Installations'),jdecode(''),'/1956/index.html','true',[ 
		['PAGE','1982',jdecode('Recent+Work'),jdecode(''),'/1956/1982.html','true',[],'',''],
		['PAGE','2008',jdecode('2007%2F08'),jdecode(''),'/1956/2008.html','true',[],'',''],
		['PAGE','2201',jdecode('2005%2F06'),jdecode(''),'/1956/2201.html','true',[],'',''],
		['PAGE','2227',jdecode('Earlier+work'),jdecode(''),'/1956/2227.html','true',[],'','']
	],'',''],
	['PAGE','2253',jdecode('+Performance'),jdecode(''),'/2253/index.html','true',[ 
		['PAGE','2279',jdecode('Recent+Work'),jdecode(''),'/2253/2279.html','true',[],'',''],
		['PAGE','2305',jdecode('2007%2F08'),jdecode(''),'/2253/2305.html','true',[],'',''],
		['PAGE','2331',jdecode('2005%2F06'),jdecode(''),'/2253/2331.html','true',[],'',''],
		['PAGE','2357',jdecode('Earlier+work'),jdecode(''),'/2253/2357.html','true',[],'','']
	],'',''],
	['PAGE','4391',jdecode('Video'),jdecode(''),'/4391/index.html','true',[ 
		['PAGE','4443',jdecode('Earlier+videos'),jdecode(''),'/4391/4443.html','true',[],'','']
	],'',''],
	['PAGE','16609',jdecode('paintings'),jdecode(''),'/16609.html','true',[],'',''],
	['PAGE','2409',jdecode('Theatr+Cynefin'),jdecode(''),'/2409.html','true',[],'',''],
	['PAGE','2435',jdecode('Ffaf'),jdecode(''),'/2435.html','true',[],'',''],
	['PAGE','1904',jdecode('cv'),jdecode(''),'/1904.html','true',[],'',''],
	['PAGE','2383',jdecode('Press+%2F+Publication'),jdecode(''),'/2383.html','true',[],'',''],
	['PAGE','2461',jdecode('contact'),jdecode(''),'/2461.html','true',[],'',''],
	['PAGE','14449',jdecode('Links'),jdecode(''),'/14449.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Concise';
theSitetree.paletteFamily='B1AFAF';
theSitetree.keyvisualId='7267';
theSitetree.keyvisualName='kv_7267.jpg';
theSitetree.fontsetId='16437';
theSitetree.graphicsetId='12141';
theSitetree.contentColor='B1AFAF';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Concise',
				paletteFamily: 	'B1AFAF',
				keyvisualId: 	'7267',
				keyvisualName: 	'kv_7267.jpg',
				fontsetId: 		'16437',
				graphicsetId: 	'12141',
				contentColor: 	'B1AFAF',
				contentBGColor: 'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2008',
internalId:  '',
customField: '20100520-120816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100731-002204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20100519-032813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20100519-155407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1904',
internalId:  '',
customField: '20100519-033244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1956',
internalId:  '',
customField: '20100520-175413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1982',
internalId:  '',
customField: '20100520-010818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100519-115414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2227',
internalId:  '',
customField: '20100520-181117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2253',
internalId:  '',
customField: '20100520-174615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2279',
internalId:  '',
customField: '20100520-115305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2305',
internalId:  '',
customField: '20100520-014109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2331',
internalId:  '',
customField: '20100519-113627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20100519-015220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2383',
internalId:  '',
customField: '20100519-032207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2409',
internalId:  '',
customField: '20100519-032621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2435',
internalId:  '',
customField: '20100520-174407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2461',
internalId:  '',
customField: '20100519-032731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4391',
internalId:  '',
customField: '20100520-003630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14449',
internalId:  '',
customField: '20100520-014811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4443',
internalId:  '',
customField: '20100519-025107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16609',
internalId:  '',
customField: '20100731-002014'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN388J';
var companyName   = 'Megan+Broadmeadow';
var htmlTitle	  = '';
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();
};
