/* [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(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','24309',jdecode('Works'),jdecode(''), jdecode('%2F24309%2Findex.html'), 'true',[ 
		['PAGE','24361',jdecode('Spirit+of+Disco'),jdecode(''), jdecode('%2F24309%2F24361.html'), 'true',[],'',''],
		['PAGE','24387',jdecode('Check+Mate'),jdecode(''), jdecode('%2F24309%2F24387.html'), 'true',[],'',''],
		['PAGE','24413',jdecode('The+Way+To+Do+It+-+1'),jdecode(''), jdecode('%2F24309%2F24413.html'), 'true',[],'',''],
		['PAGE','24439',jdecode('The+Way+To+Do+It+-+2'),jdecode(''), jdecode('%2F24309%2F24439.html'), 'true',[],'',''],
		['PAGE','24465',jdecode('Melony+Titmuss'),jdecode(''), jdecode('%2F24309%2F24465.html'), 'true',[],'',''],
		['ITEM','26709',jdecode('Handraulic+%28lvideo+link%29'),jdecode(''), jdecode('http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiIsadXQls74'), 'true',[],'','_blank'],
		['ITEM','26710',jdecode('Anthem+%28video+link%29'),jdecode(''), jdecode('http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dn4OBaH3ooOs%26feature%3Drelated'), 'true',[],'','_blank'],
		['ITEM','26711',jdecode('Once+Upon+a+Crime+%28video+Link%29'),jdecode(''), jdecode('http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyTDTW93rDwY'), 'true',[],'','_blank'],
		['PAGE','24595',jdecode('Ship+Shape'),jdecode(''), jdecode('%2F24309%2F24595.html'), 'true',[],'',''],
		['PAGE','26909',jdecode('Extended+Title'),jdecode(''), jdecode('%2F24309%2F26909.html'), 'true',[],'',''],
		['PAGE','24647',jdecode('Together+Again'),jdecode(''), jdecode('%2F24309%2F24647.html'), 'true',[],'',''],
		['PAGE','24569',jdecode('Enid+Blaenau'),jdecode(''), jdecode('%2F24309%2F24569.html'), 'true',[],'',''],
		['PAGE','24673',jdecode('Walk+The+Line'),jdecode(''), jdecode('%2F24309%2F24673.html'), 'true',[],'',''],
		['PAGE','24621',jdecode('Panto+Cabaret'),jdecode(''), jdecode('%2F24309%2F24621.html'), 'true',[],'',''],
		['PAGE','27709',jdecode('Guidelines+%28Ffaf%29'),jdecode(''), jdecode('%2F24309%2F27709.html'), 'true',[],'',''],
		['PAGE','27735',jdecode('Stars+In+Thier+Stars+In+Thier+Eyes'),jdecode(''), jdecode('%2F24309%2F27735.html'), 'true',[],'',''],
		['PAGE','24699',jdecode('Older+works'),jdecode(''), jdecode('%2F24309%2F24699.html'), 'true',[],'',''],
		['PAGE','24725',jdecode('Paintings'),jdecode(''), jdecode('%2F24309%2F24725.html'), 'true',[],'','']
	],'',''],
	['PAGE','1852',jdecode('Artist+Statement'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['PAGE','1904',jdecode('CV'),jdecode(''), jdecode('%2F1904.html'), 'true',[],'',''],
	['PAGE','24751',jdecode('Community+Projects'),jdecode(''), jdecode('%2F24751.html'), 'true',[],'',''],
	['PAGE','2461',jdecode('Contact'),jdecode(''), jdecode('%2F2461.html'), 'true',[],'',''],
	['PAGE','2409',jdecode('Theatr+Cynefin'),jdecode(''), jdecode('%2F2409.html'), 'true',[],'','']];
var siteelementCount=25;
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 prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
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:  '24699',
internalId:  '',
customField: '20120120-143740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20120120-135511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20120120-135347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24673',
internalId:  '',
customField: '20120120-162052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1904',
internalId:  '',
customField: '20120120-172245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26909',
internalId:  '',
customField: '20120120-155706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24621',
internalId:  '',
customField: '20120120-143740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24647',
internalId:  '',
customField: '20120120-161129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24569',
internalId:  '',
customField: '20120120-163218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24387',
internalId:  '',
customField: '20120120-152427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24413',
internalId:  '',
customField: '20120120-153203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24309',
internalId:  '',
customField: '20120120-144304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24361',
internalId:  '',
customField: '20120120-160517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27709',
internalId:  '',
customField: '20120120-162435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2409',
internalId:  '',
customField: '20110522-223420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2461',
internalId:  '',
customField: '20100519-032731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24439',
internalId:  '',
customField: '20120120-162931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24465',
internalId:  '',
customField: '20120120-153712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24595',
internalId:  '',
customField: '20120120-154737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24725',
internalId:  '',
customField: '20120120-171601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24751',
internalId:  '',
customField: '20120120-172638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27735',
internalId:  '',
customField: '20120120-161558'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN388J';
var companyName   = 'Megan+Broadmeadow';
var htmlTitle	  = 'megan+broadmeadow+%2C+artist%2C+sculpture%2C+sculptor%2C+%2C+performance+%2C+installation%2C+conceptualartist+%2Cwales%2C+welsh+performer%2C+visual+art%2C+art%2C+painting%2C+residency%2C++mix%2C+installation';
var metaKeywords  = 'megan+broadmeadow%2C+artist%2C+sculpture%2Cperformance%2C++sculptor%2C+conceptual%2C+wales%2C+welsh+performer%2C+visual+art%2C+art%2C+painting%2C+residency%2C++mix%2C+installation%2C++performance+artist%2C+site+specific%2C+folk%2C+contemporary%2C+historical+wales%2C+mixed+media+wales%2C++Welsh+artists%2C+female+artist%2C+Hackney+wick%2C+artist%2C+peanut+factory%2C+welsh+artist+of+the+year%2C%0A';
var metaContents  = 'Artworks+and+Performances+by+Megan+Broadmeadow';
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();
};

