/* [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(''), jdecode('%2F1312.html'), 'true',[],'',''],
	['PAGE','1343',jdecode('Introduction'),jdecode(''), jdecode('%2F1343.html'), 'true',[],'',''],
	['PAGE','11201',jdecode('Musical+Director'),jdecode(''), jdecode('%2F11201.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('Main+Band+Members'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','59901',jdecode('Band+Vacancies'),jdecode(''), jdecode('%2F59901.html'), 'true',[],'',''],
	['PAGE','12801',jdecode('TCB+Engagements'),jdecode(''), jdecode('%2F12801%2Findex.html'), 'true',[ 
		['PAGE','12822',jdecode('Practice+Dates'),jdecode(''), jdecode('%2F12801%2F12822.html'), 'true',[],'',''],
		['PAGE','20701',jdecode('Trailer+Teams'),jdecode(''), jdecode('%2F12801%2F20701.html'), 'true',[],'','']
	],'',''],
	['PAGE','5222',jdecode('Training+Band'),jdecode(''), jdecode('%2F5222%2Findex.html'), 'true',[ 
		['PAGE','28001',jdecode('Training+Band+Members'),jdecode(''), jdecode('%2F5222%2F28001.html'), 'true',[],'',''],
		['PAGE','12843',jdecode('Practice+dates'),jdecode(''), jdecode('%2F5222%2F12843.html'), 'true',[],'',''],
		['PAGE','20722',jdecode('Information+Area'),jdecode(''), jdecode('%2F5222%2F20722.html'), 'true',[],'','']
	],'',''],
	['PAGE','60501',jdecode('Location'),jdecode(''), jdecode('%2F60501.html'), 'true',[],'',''],
	['PAGE','61101',jdecode('Directions+to+ABC'),jdecode(''), jdecode('%2F61101.html'), 'true',[],'',''],
	['PAGE','8201',jdecode('Three+Towers+CD'),jdecode(''), jdecode('%2F8201.html'), 'true',[],'',''],
	['PAGE','1364',jdecode('Band+Photos'),jdecode(''), jdecode('%2F1364.html'), 'true',[],'',''],
	['PAGE','54301',jdecode('Prague+Photo%26%23x27%3Bs'),jdecode(''), jdecode('%2F54301.html'), 'true',[],'',''],
	['PAGE','1396',jdecode('Guestbook'),jdecode(''), jdecode('%2F1396.html'), 'true',[],'',''],
	['PAGE','1417',jdecode('Contact'),jdecode(''), jdecode('%2F1417.html'), 'true',[],'',''],
	['PAGE','42501',jdecode('Links+Pages'),jdecode(''), jdecode('%2F42501.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Occasions';
theSitetree.paletteFamily='962727';
theSitetree.keyvisualId='6659';
theSitetree.keyvisualName='kv_6659.jpg';
theSitetree.fontsetId='11194';
theSitetree.graphicsetId='12003';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='962727';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk_ce',
  product: 'WSCSYSSSSLY0XKQS'
};
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: 	'FFFFFF',
				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:  '59901',
internalId:  '',
customField: '20110901-173954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20101230-214847'
};
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: '20110628-005703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1343',
internalId:  '',
customField: '20101230-214652'
};
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:  '60501',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20722',
internalId:  '',
customField: '20100706-194950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20101021-215625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12843',
internalId:  '',
customField: '20111231-005828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100628-232901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20111231-010640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12822',
internalId:  '',
customField: '20111231-005203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20110328-002127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20090914-201921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60501',
internalId:  '',
customField: '20101021-214133'
};
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['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'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '61101',
internalId:  'routing',
customField: 'en_GB'
};
var webAppHostname = 'cgi.easily.co.uk:80';
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%2CTacchi-Morris+Centre.';
var metaContents  = 'Taunton+Concert+Band%2C+Symphonic+Wind+Band%2C+Woodwind%2C+Vivary+Park+Taunton%2C+Martin+Wills%2C+TAPA%2CTaunton+School%2C+Music%2C+Bands.+Tacchi-Morris+Centre.';
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();
};

