/* [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','5601',jdecode('HOME'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','214012',jdecode('NEW+BAND+'),jdecode(''),'/214012.html','true',[],'',''],
	['PAGE','6201',jdecode('ENGAGEMENTS'),jdecode(''),'/6201.html','true',[],'',''],
	['PAGE','9901',jdecode('BAND+MEMBERS'),jdecode(''),'/9901.html','true',[],'',''],
	['PAGE','31501',jdecode('PLAYER+PROFILES'),jdecode(''),'/31501.html','true',[],'',''],
	['PAGE','230012',jdecode('25+YRS++AT+THE+HELM'),jdecode(''),'/230012.html','true',[],'',''],
	['PAGE','175312',jdecode('HOW+TO+FIND+US++'),jdecode(''),'/175312.html','true',[],'',''],
	['PAGE','6627',jdecode('VACANCIES'),jdecode(''),'/6627.html','true',[],'',''],
	['PAGE','8701',jdecode('TRAINING+GROUP'),jdecode(''),'/8701.html','true',[],'',''],
	['PAGE','42601',jdecode('CONTACTS%2F+EMAIL'),jdecode(''),'/42601.html','true',[],'',''],
	['PAGE','29501',jdecode('PLAYER+AWARDS+'),jdecode(''),'/29501.html','true',[],'',''],
	['PAGE','209012',jdecode('TROPHY+ROOM+'),jdecode(''),'/209012.html','true',[],'',''],
	['PAGE','6601',jdecode('NEWS--RECENT+EVENTS+'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','152512',jdecode('TEXAS+TOUR+2006'),jdecode(''),'/152512.html','true',[],'',''],
	['PAGE','18201',jdecode('GUESTBOOK'),jdecode(''),'/18201.html','true',[],'',''],
	['PAGE','32501',jdecode('CHILDREN+IN+NEED+++'),jdecode(''),'/32501.html','true',[],'',''],
	['PAGE','150012',jdecode('HUMOUR'),jdecode(''),'/150012.html','true',[],'',''],
	['PAGE','24101',jdecode('REPORTS'),jdecode(''),'/24101.html','true',[],'',''],
	['PAGE','7501',jdecode('ADJUDICATORS+NOTES'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','28201',jdecode('SPONSORSHIP'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','34001',jdecode('%26%23x27%3BIN+TUNE+WITH+OUR+BIKES%26%23x27%3B++'),jdecode(''),'/34001.html','true',[],'',''],
	['PAGE','6679',jdecode('LINKS'),jdecode(''),'/6679.html','true',[],'',''],
	['PAGE','229712',jdecode('GALLERY+'),jdecode(''),'/229712.html','false',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Theater';
theSitetree.paletteFamily='000004';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10503';
theSitetree.graphicsetId='11141';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Theater',
				paletteFamily: 	'000004',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10503',
				graphicsetId: 	'11141',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'680C0C',
				e_color: 		'680C0C',
				f_color: 		'680C0C',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20100908-024812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20100908-005246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100908-034922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6627',
internalId:  '',
customField: '20100908-020022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152512',
internalId:  '',
customField: '20100908-040341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6679',
internalId:  '',
customField: '20100908-052914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100908-043525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20100908-020729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20100908-043813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100908-012533'
};
webappMappings['1002']=webappMappings['1002-18201anbt10in31wi']={
webappId:    '1002',
documentId:  '18201',
internalId:  '18201anbt10in31wi',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20090607-171643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '230012',
internalId:  '',
customField: '20100909-035928'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150012',
internalId:  '',
customField: '20100908-041147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20100908-041738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '214012',
internalId:  '',
customField: '20100907-174649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20100908-025407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31501',
internalId:  '',
customField: '20100908-015223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20100908-041115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34001',
internalId:  '',
customField: '20100908-052734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42601',
internalId:  '',
customField: '20100908-021028'
};
webappMappings['7008']=webappMappings['7008-5053']={
webappId:    '7008',
documentId:  '42601',
internalId:  '5053',
customField: 'language:en;country:GB;'
};
webappMappings['7060']=webappMappings['7060-62959eed99326441c2613e221a9bcdcc']={
webappId:    '7060',
documentId:  '229712',
internalId:  '62959eed99326441c2613e221a9bcdcc',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175312',
internalId:  '',
customField: '20100908-015415'
};
webappMappings['1501']=webappMappings['1501-9780491']={
webappId:    '1501',
documentId:  '5601',
internalId:  '9780491',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '209012',
internalId:  '',
customField: '20100908-030414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '229712',
internalId:  '',
customField: '20100909-032509'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN31WI';
var companyName   = 'TIVERTON+TOWN+BAND';
var htmlTitle	  = '';
var metaKeywords  = 'Tiverton%2C+Brass+Band%2C+Music%2C+Devon%2C+Musicians%2C+vacancies%2C+Cornet%2C+BBb+bass%2C+Concerts%2C+Fete%2C+Event%2C+Parade%2C+Carnival%2C+Marching%2C+Exmouth+Festival%2C+Superact%2C+Minehead%2C+';
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();
};
