/* [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','1312',jdecode('Home'),jdecode(''),'/1312.html','true',[],'',''],
	['PAGE','1343',jdecode('Introduction'),jdecode(''),'/1343.html','true',[],'',''],
	['PAGE','11201',jdecode('Musical+Director'),jdecode(''),'/11201.html','true',[],'',''],
	['PAGE','5201',jdecode('Main+Band+Members'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','12801',jdecode('TCB+Engagements'),jdecode(''),'/12801/index.html','true',[ 
		['PAGE','12822',jdecode('Practice+Dates'),jdecode(''),'/12801/12822.html','true',[],'',''],
		['PAGE','20701',jdecode('Trailer+Teams'),jdecode(''),'/12801/20701.html','true',[],'','']
	],'',''],
	['PAGE','5222',jdecode('Training+Band'),jdecode(''),'/5222/index.html','true',[ 
		['PAGE','28001',jdecode('Training+Band+Members'),jdecode(''),'/5222/28001.html','true',[],'',''],
		['PAGE','12843',jdecode('Practice+dates'),jdecode(''),'/5222/12843.html','true',[],'',''],
		['PAGE','20722',jdecode('Information+Area'),jdecode(''),'/5222/20722.html','true',[],'','']
	],'',''],
	['PAGE','5243',jdecode('Where++to+find+us'),jdecode(''),'/5243.html','true',[],'',''],
	['PAGE','17401',jdecode('TCB+Poll'),jdecode(''),'/17401.html','true',[],'',''],
	['PAGE','8201',jdecode('Three+Towers+CD'),jdecode(''),'/8201.html','true',[],'',''],
	['PAGE','1364',jdecode('Band+Photos'),jdecode(''),'/1364.html','true',[],'',''],
	['PAGE','1396',jdecode('Guestbook'),jdecode(''),'/1396.html','true',[],'',''],
	['PAGE','1417',jdecode('Contact'),jdecode(''),'/1417.html','true',[],'',''],
	['PAGE','15101',jdecode('Driving+to++Taunton+School'),jdecode(''),'/15101.html','true',[],'',''],
	['PAGE','46701',jdecode('Music+for+2010'),jdecode(''),'/46701.html','true',[],'',''],
	['PAGE','42501',jdecode('Links+Pages'),jdecode(''),'/42501.html','true',[],'',''],
	['PAGE','54301',jdecode('Prague+Photo%26%23x27%3Bs'),jdecode(''),'/54301.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Occasions';
theSitetree.paletteFamily='962727';
theSitetree.keyvisualId='6659';
theSitetree.keyvisualName='kv_6659.jpg';
theSitetree.fontsetId='11194';
theSitetree.graphicsetId='12003';
theSitetree.contentColor='2E0505';
theSitetree.contentBGColor='962727';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Occasions',
				paletteFamily: 	'962727',
				keyvisualId: 	'6659',
				keyvisualName: 	'kv_6659.jpg',
				fontsetId: 		'11194',
				graphicsetId: 	'12003',
				contentColor: 	'2E0505',
				contentBGColor: '962727',
				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['7060']=webappMappings['7060-3bfcefef273513d839056ef5cad8185b']={
webappId:    '7060',
documentId:  '1364',
internalId:  '3bfcefef273513d839056ef5cad8185b',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20080224-212535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20100818-171516'
};
webappMappings['7008']=webappMappings['7008-145']={
webappId:    '7008',
documentId:  '1417',
internalId:  '145',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1312',
internalId:  '',
customField: '20100810-223712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1343',
internalId:  '',
customField: '20080226-223302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1364',
internalId:  '',
customField: '20080820-150806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20080224-232835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1396',
internalId:  '',
customField: '20080226-233741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1417',
internalId:  '',
customField: '20080226-005135'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5243',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['7005']=webappMappings['7005-2']={
webappId:    '7005',
documentId:  '17401',
internalId:  '2',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20722',
internalId:  '',
customField: '20100706-194950'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '15101',
internalId:  'routing',
customField: 'en_GB'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12843',
internalId:  '',
customField: '20100907-232058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100628-232901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20100907-231446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12822',
internalId:  '',
customField: '20100907-231539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100818-120902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20090914-201921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5243',
internalId:  '',
customField: '20100101-001259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20100101-220232'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1312',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4875505']={
webappId:    '1501',
documentId:  '1312',
internalId:  '4875505',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-bf912abd79e476074d3fd55832b5a57a']={
webappId:    '7060',
documentId:  '8201',
internalId:  'bf912abd79e476074d3fd55832b5a57a',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20080306-000117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28001',
internalId:  '',
customField: '20100101-144456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46701',
internalId:  '',
customField: '20100101-145443'
};
webappMappings['7002']=webappMappings['7002-2631']={
webappId:    '7002',
documentId:  '1396',
internalId:  '2631',
customField: 'language:en;country:GB;'
};
webappMappings['7060']=webappMappings['7060-d2929a96ad5ddc82ae751b988344d5cc']={
webappId:    '7060',
documentId:  '54301',
internalId:  'd2929a96ad5ddc82ae751b988344d5cc',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54301',
internalId:  '',
customField: '20100810-204155'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2GR7';
var companyName   = 'TAUNTON+CONCERT+BAND';
var htmlTitle	  = '+TAUNTON+CONCERT+BAND';
var metaKeywords  = 'Taunton+Concert+Band%2C+Martin+Wills%2C+Vivary+Park+Taunton%2CWellington+Park%2C+Tacchi-Morris+Arts+Centre%2C+TAPA%2CTaunton+School%2C+Music%2C+Band.';
var metaContents  = 'Taunton+Concert+Band%2C+Symphonic+Wind+Band+Woodwind%2C+Vivary+Park+Taunton%2C+Martin+Wills%2C+TAPA%2CTaaunton+School%2C+Music%2C+Bands.';
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();
};
