/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','103912',jdecode('Next+Performance'),jdecode(''),'/103912.html','true',[],'',''],
	['PAGE','8422',jdecode('Future+Events'),jdecode(''),'/8422.html','true',[],'',''],
	['PAGE','32901',jdecode('Find+and+Contact+Us'),jdecode(''),'/32901.html','true',[],'',''],
	['PAGE','8443',jdecode('Why+Not+Join+Us%3F'),jdecode(''),'/8443/index.html','true',[ 
		['PAGE','11701',jdecode('Membership+Form'),jdecode(''),'/8443/11701.html','true',[],'','']
	],'',''],
	['PAGE','64101',jdecode('Last+Production'),jdecode(''),'/64101.html','true',[],'',''],
	['PAGE','94212',jdecode('Recent+Events'),jdecode(''),'/94212.html','true',[],'',''],
	['PAGE','47601',jdecode('Minack+2008'),jdecode(''),'/47601.html','true',[],'',''],
	['PAGE','27922',jdecode('Gallery'),jdecode(''),'/27922.html','true',[],'',''],
	['PAGE','32601',jdecode('Plays+Performed'),jdecode(''),'/32601.html','true',[],'',''],
	['PAGE','14601',jdecode('Committee+%26+Links'),jdecode(''),'/14601.html','true',[],'',''],
	['PAGE','93612',jdecode('Guestbook'),jdecode(''),'/93612.html','true',[],'',''],
	['PAGE','103938',jdecode('Harold+Pinter+-+The+Dumb+Waiter+and+Party+Time'),jdecode(''),'/103938.html','false',[],'',''],
	['PAGE','109840',jdecode('hidden+downloadable+content'),jdecode(''),'/109840.html','false',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='666699';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='442';
theSitetree.graphicsetId='493';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='a1a1c6';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'666699',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'442',
				graphicsetId: 	'493',
				contentColor: 	'000000',
				contentBGColor: 'a1a1c6',
				a_color: 		'a1a1c6',
				b_color: 		'666699',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-261']={
webappId:    '7008',
documentId:  '11701',
internalId:  '261',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091128-145050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64101',
internalId:  '',
customField: '20091107-122141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8422',
internalId:  '',
customField: '20091107-135226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20091118-234053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27922',
internalId:  '',
customField: '20091107-125121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32601',
internalId:  '',
customField: '20091107-134202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8443',
internalId:  '',
customField: '20091118-234204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20091107-114941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20091107-130225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47601',
internalId:  '',
customField: '20091107-135644'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94212',
internalId:  '',
customField: '20091107-122653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93612',
internalId:  '',
customField: '20091107-130650'
};
webappMappings['1002']=webappMappings['1002-93612anbt10inxl6a']={
webappId:    '1002',
documentId:  '93612',
internalId:  '93612anbt10inxl6a',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103912',
internalId:  '',
customField: '20091107-154927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109840',
internalId:  '',
customField: '20091128-150644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103938',
internalId:  '',
customField: '20091107-155037'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXL6A';
var companyName   = '';
var htmlTitle	  = 'Theatre+in+the+Square-+Highgate%2C+London';
var metaKeywords  = 'Amateur+Theatre%2C+Entertainment%2C+Drama%2C+Acting%2C+Rehearsals%2C+Performance%2C+Auditions%2C+London%2C+Highgate%2C+North+London.+Pond+Square%2C+URC%2C+Minack%2C+Camden%2C+Haringey%2C+United+Reformed+Church%2C+Gatehouse+Theatre';
var metaContents  = 'An+amateur+theatre+group+based+North+London%2C+we+perform+regularly+at+Pond+Square+in+Highgate%2C+and+at+the+Minack+theatre+in+Cornwall.++Our+members+also+enjoy+a+variety+of+social+events.';
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();
};
