/* [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','445112',jdecode('Whats+on+next+'),jdecode(''), jdecode('%2F445112.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('HOME'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','6201',jdecode('ENGAGEMENTS'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','9901',jdecode('BAND+MEMBERS'),jdecode(''), jdecode('%2F9901.html'), 'true',[],'',''],
	['PAGE','31501',jdecode('PLAYER+PROFILES'),jdecode(''), jdecode('%2F31501.html'), 'true',[],'',''],
	['PAGE','6627',jdecode('VACANCIES'),jdecode(''), jdecode('%2F6627.html'), 'true',[],'',''],
	['PAGE','8701',jdecode('TRAINING+GROUP'),jdecode(''), jdecode('%2F8701.html'), 'true',[],'',''],
	['PAGE','6601',jdecode('EVENT+REPORTS++'),jdecode(''), jdecode('%2F6601.html'), 'true',[],'',''],
	['PAGE','7501',jdecode('ADJUDICATORS+NOTES'),jdecode(''), jdecode('%2F7501.html'), 'true',[],'',''],
	['PAGE','209012',jdecode('TROPHY+ROOM+'),jdecode(''), jdecode('%2F209012.html'), 'true',[],'',''],
	['PAGE','29501',jdecode('PLAYER+AWARDS+'),jdecode(''), jdecode('%2F29501.html'), 'true',[],'',''],
	['PAGE','18201',jdecode('GUESTBOOK'),jdecode(''), jdecode('%2F18201.html'), 'true',[],'',''],
	['PAGE','268912',jdecode('VARIOUS+IMAGES+'),jdecode(''), jdecode('%2F268912.html'), 'true',[],'',''],
	['PAGE','230012',jdecode('MAN++AT+THE+HELM'),jdecode(''), jdecode('%2F230012.html'), 'true',[],'',''],
	['PAGE','152512',jdecode('TEXAS+TOUR+2006'),jdecode(''), jdecode('%2F152512.html'), 'true',[],'',''],
	['PAGE','32501',jdecode('CHILDREN+IN+NEED+++'),jdecode(''), jdecode('%2F32501.html'), 'true',[],'',''],
	['PAGE','24101',jdecode('REPORTS'),jdecode(''), jdecode('%2F24101.html'), 'false',[],'',''],
	['PAGE','175312',jdecode('HOW+TO+FIND+US++'),jdecode(''), jdecode('%2F175312.html'), 'true',[],'',''],
	['PAGE','42601',jdecode('CONTACTS%2F+EMAIL'),jdecode(''), jdecode('%2F42601.html'), 'true',[],'',''],
	['PAGE','150012',jdecode('HUMOUR'),jdecode(''), jdecode('%2F150012.html'), 'true',[],'',''],
	['PAGE','28201',jdecode('SPONSORSHIP'),jdecode(''), jdecode('%2F28201.html'), 'true',[],'',''],
	['PAGE','34001',jdecode('%26%23x27%3BON++OUR+BIKES%26%23x27%3B++'),jdecode(''), jdecode('%2F34001.html'), 'true',[],'',''],
	['PAGE','6679',jdecode('LINKS'),jdecode(''), jdecode('%2F6679.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Riga';
theSitetree.paletteFamily='6C7BD4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11222';
theSitetree.graphicsetId='12043';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6C7BD4';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Riga',
				paletteFamily: 	'6C7BD4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11222',
				graphicsetId: 	'12043',
				contentColor: 	'FFFFFF',
				contentBGColor: '6C7BD4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20120101-144056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20120115-184559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20120101-191352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6627',
internalId:  '',
customField: '20111230-183100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152512',
internalId:  '',
customField: '20111125-170947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6679',
internalId:  '',
customField: '20111125-172718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20111125-162955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20111220-133620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20111125-172523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20120101-164000'
};
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: '20111125-170607'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '445112',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150012',
internalId:  '',
customField: '20111125-171948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '268912',
internalId:  '',
customField: '20110818-095138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20110328-032651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20111125-170403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31501',
internalId:  '',
customField: '20120101-163818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20111125-171040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34001',
internalId:  '',
customField: '20111016-220452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42601',
internalId:  '',
customField: '20120115-184120'
};
webappMappings['7008']=webappMappings['7008-5053']={
webappId:    '7008',
documentId:  '42601',
internalId:  '5053',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175312',
internalId:  '',
customField: '20110315-211824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '445112',
internalId:  '',
customField: '20120101-143824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '209012',
internalId:  '',
customField: '20120102-133824'
};
webappMappings['7060']=webappMappings['7060-d6f714c1f33d2fb3ce4c34e673807a3f']={
webappId:    '7060',
documentId:  '268912',
internalId:  'd6f714c1f33d2fb3ce4c34e673807a3f',
customField: 'language:en;country:GB;'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN31WI';
var companyName   = 'TIVERTON+TOWN+BAND++';
var htmlTitle	  = 'PROBABLY+DEVON%27S+BUSIEST+BAND+';
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();
};

