/* [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 theSitetree=[ 
	['PAGE','2401',jdecode('Home'),jdecode(''),'/2401.html','true',[],''],
	['PAGE','3415',jdecode('Cassie%26%23x27%3Bs+Resume'),jdecode(''),'/3415.html','true',[],''],
	['PAGE','3715',jdecode('Mark+Lutton%26%23x27%3Bs+Resume'),jdecode(''),'/3715.html','true',[],''],
	['PAGE','4415',jdecode('Performances+in+2007'),jdecode(''),'/4415.html','true',[],''],
	['PAGE','4815',jdecode('Programs+for+2008'),jdecode(''),'/4815.html','true',[],''],
	['PAGE','7615',jdecode('South+Church+Concert'),jdecode(''),'/7615.html','true',[],''],
	['PAGE','14715',jdecode('Program+for+Weill+Hall'),jdecode(''),'/14715.html','true',[],''],
	['PAGE','21115',jdecode('Nashua+Flute+Choir'),jdecode(''),'/21115.html','true',[],''],
	['PAGE','21315',jdecode('Brattleboro+Concert'),jdecode(''),'/21315.html','true',[],''],
	['PAGE','21336',jdecode('Goethe+Institut+Concert'),jdecode(''),'/21336.html','true',[],''],
	['PAGE','23315',jdecode('Weill+Hall+Concert'),jdecode(''),'/23315.html','true',[],''],
	['PAGE','24715',jdecode('Weill+Hall+Pictures'),jdecode(''),'/24715.html','true',[],''],
	['PAGE','36171',jdecode('Invitation+to+Play+in+NY'),jdecode(''),'/36171.html','true',[],''],
	['PAGE','24215',jdecode('Order+a+CD'),jdecode(''),'/24215.html','true',[],''],
	['PAGE','5015',jdecode('Pictures+of+Interest'),jdecode(''),'/5015.html','true',[],''],
	['PAGE','5815',jdecode('Contacts'),jdecode(''),'/5815.html','true',[],''],
	['PAGE','19515',jdecode('Critic%26%23x27%3Bs+Corner'),jdecode(''),'/19515.html','true',[],''],
	['PAGE','20015',jdecode('Guest+Book'),jdecode(''),'/20015.html','true',[],''],
	['PAGE','24415',jdecode('Future+Plans'),jdecode(''),'/24415.html','true',[],''],
	['PAGE','36871',jdecode('Flootissimo+-+A+Link'),jdecode(''),'/36871.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='80B3EC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32049';
theSitetree.graphicsetId='13871';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Grace',
				paletteFamily: 	'80B3EC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32049',
				graphicsetId: 	'13871',
				contentColor: 	'484848',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:  '2401',
internalId:  '',
customField: '20081216-130459'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3415',
internalId:  '',
customField: '20080428-094942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3715',
internalId:  '',
customField: '20080428-095104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4415',
internalId:  '',
customField: '20080427-074119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4815',
internalId:  '',
customField: '20080726-112838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5015',
internalId:  '',
customField: '20080405-125744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5815',
internalId:  '',
customField: '20090207-133323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7615',
internalId:  '',
customField: '20080426-161242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14715',
internalId:  '',
customField: '20080406-152538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19515',
internalId:  '',
customField: '20090207-133527'
};
webappMappings['1002']=webappMappings['1002-20015aendu0inxh27']={
webappId:    '1002',
documentId:  '20015',
internalId:  '20015aendu0inxh27',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20015',
internalId:  '',
customField: '20080428-062607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21115',
internalId:  '',
customField: '20080605-140727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21315',
internalId:  '',
customField: '20080605-141100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21336',
internalId:  '',
customField: '20080726-112510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23315',
internalId:  '',
customField: '20080804-104019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24215',
internalId:  '',
customField: '20090207-133625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24415',
internalId:  '',
customField: '20080915-145239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24715',
internalId:  '',
customField: '20080804-103625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36171',
internalId:  '',
customField: '20090405-151511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36871',
internalId:  '',
customField: '20090412-162709'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INXH27';
var companyName   = 'The+Sterbrooke+Ensemble%E2%84%A2';
var htmlTitle	  = '';
var metaKeywords  = '';
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();
};
