/* [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','27612',jdecode('Change+of+plan%21'),jdecode(''),'/27612.html','true',[],'',''],
	['PAGE','1411',jdecode('Home'),jdecode(''),'/1411.html','true',[],'',''],
	['PAGE','1432',jdecode('Why+sing%3F'),jdecode(''),'/1432.html','true',[],'',''],
	['PAGE','1453',jdecode('Where%2C+when+and+how%3F'),jdecode(''),'/1453.html','true',[],'',''],
	['PAGE','22012',jdecode('Axminster+%26+District+Choral+Society'),jdecode(''),'/22012.html','true',[],'',''],
	['PAGE','17601',jdecode('Festival+Chorus'),jdecode(''),'/17601.html','true',[],'',''],
	['PAGE','1474',jdecode('MusicLines'),jdecode(''),'/1474.html','true',[],'',''],
	['PAGE','1516',jdecode('Contact'),jdecode(''),'/1516.html','true',[],'',''],
	['PAGE','6301',jdecode('Links'),jdecode(''),'/6301.html','true',[],'',''],
	['PAGE','7301',jdecode('News%2C+Archive%2C+Interest'),jdecode(''),'/7301/index.html','true',[ 
		['PAGE','23712',jdecode('Gallery'),jdecode(''),'/7301/23712.html','true',[],'','']
	],'',''],
	['PAGE','18501',jdecode('Guestbook'),jdecode(''),'/18501.html','true',[],'',''],
	['PAGE','20112',jdecode('Quantock+Excelsior+Concerts'),jdecode(''),'/20112.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='ABC600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32125';
theSitetree.graphicsetId='13925';
theSitetree.contentColor='6e6e6d';
theSitetree.contentBGColor='fbfae8';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Plainly',
				paletteFamily: 	'ABC600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32125',
				graphicsetId: 	'13925',
				contentColor: 	'6e6e6d',
				contentBGColor: 'fbfae8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1411',
internalId:  '',
customField: '20080625-234208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1474',
internalId:  '',
customField: '20081204-144728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1516',
internalId:  '',
customField: '20080913-163314'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '27612',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1432',
internalId:  '',
customField: '20100506-101957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1453',
internalId:  '',
customField: '20100506-102124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20110216-145703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20100506-102327'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '27612',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20110512-113237'
};
webappMappings['7002']=webappMappings['7002-1416']={
webappId:    '7002',
documentId:  '18501',
internalId:  '1416',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20100506-104751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20112',
internalId:  '',
customField: '20100228-115454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22012',
internalId:  '',
customField: '20110420-173601'
};
webappMappings['7060']=webappMappings['7060-3bd8981db930ebbe5700aa93e167bf45']={
webappId:    '7060',
documentId:  '23712',
internalId:  '3bd8981db930ebbe5700aa93e167bf45',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23712',
internalId:  '',
customField: '20110506-105430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27612',
internalId:  '',
customField: '20110512-173529'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2FWT';
var companyName   = 'ReactiviSING';
var htmlTitle	  = 'ReactiviSING+-+MusicLines+encouraging+singers+of+all+ages';
var metaKeywords  = 'Music%2C+musician%2C+sing%2C+singing%2C+voice%2C+teaching%2C+teacher%2C+choir%2C+choral%2C+conductor%2C+conducting%2C+piano%2C+flute%2C+accompanist%2C+MusicLines';
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();
};

