/* [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','119',jdecode('Home'),jdecode(''),'/119.html','true',[],'',''],
	['PAGE','13001',jdecode('Concert+Dates'),jdecode(''),'/13001.html','true',[],'',''],
	['PAGE','527',jdecode('Ensembles+and+Classes'),jdecode(''),'/527/index.html','true',[ 
		['PAGE','7201',jdecode('Accidentals'),jdecode(''),'/527/7201.html','true',[],'',''],
		['PAGE','7222',jdecode('Cantori'),jdecode(''),'/527/7222.html','true',[],'',''],
		['PAGE','7243',jdecode('Concert+Band'),jdecode(''),'/527/7243.html','true',[],'',''],
		['PAGE','7264',jdecode('Jazz+Ensemble'),jdecode(''),'/527/7264.html','true',[],'',''],
		['PAGE','7285',jdecode('La+Cappella'),jdecode(''),'/527/7285.html','true',[],'',''],
		['PAGE','7306',jdecode('Lyrics'),jdecode(''),'/527/7306.html','true',[],'',''],
		['PAGE','7327',jdecode('Men%26%23x27%3Bs+Chorus'),jdecode(''),'/527/7327.html','true',[],'',''],
		['PAGE','8001',jdecode('Music+Lab'),jdecode(''),'/527/8001.html','true',[],'',''],
		['PAGE','8022',jdecode('Music+Theory'),jdecode(''),'/527/8022.html','true',[],'',''],
		['PAGE','7348',jdecode('Orchestra'),jdecode(''),'/527/7348.html','true',[],'',''],
		['PAGE','7369',jdecode('Wind+Ensemble'),jdecode(''),'/527/7369.html','true',[],'',''],
		['PAGE','7390',jdecode('Women%26%23x27%3Bs+Chorus'),jdecode(''),'/527/7390.html','true',[],'','']
	],'',''],
	['PAGE','36117',jdecode('Choral+Music+Grading+Policy'),jdecode(''),'/36117.html','true',[],'',''],
	['PAGE','545',jdecode('Music+Educators'),jdecode(''),'/545.html','true',[],'',''],
	['PAGE','554',jdecode('Concert+Recordings'),jdecode(''),'/554.html','true',[],'',''],
	['PAGE','14801',jdecode('Rehearsal+Calendar'),jdecode(''),'/14801.html','true',[],'',''],
	['PAGE','12701',jdecode('Instrumental+Music+Info'),jdecode(''),'/12701.html','true',[],'',''],
	['PAGE','6101',jdecode('Map'),jdecode(''),'/6101.html','true',[],'',''],
	['PAGE','37017',jdecode('Middle+Schools'),jdecode(''),'/37017.html','true',[],'',''],
	['PAGE','37038',jdecode('Elementary+Schools'),jdecode(''),'/37038.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='479';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Card',
				paletteFamily: 	'990000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'479',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '119',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-2293516']={
webappId:    '1501',
documentId:  '119',
internalId:  '2293516',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119',
internalId:  '',
customField: '20100228-223407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20100831-074354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '527',
internalId:  '',
customField: '20080820-215510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20100902-211540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7222',
internalId:  '',
customField: '20080820-215609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7243',
internalId:  '',
customField: '20090117-210254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7264',
internalId:  '',
customField: '20090810-095453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7285',
internalId:  '',
customField: '20100520-065719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7306',
internalId:  '',
customField: '20100902-105422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7327',
internalId:  '',
customField: '20100831-215703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20100831-215726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20100831-215747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7348',
internalId:  '',
customField: '20100228-223732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7369',
internalId:  '',
customField: '20090426-194442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7390',
internalId:  '',
customField: '20100520-070151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '545',
internalId:  '',
customField: '20080820-201031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '554',
internalId:  '',
customField: '20100818-091744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20100831-214949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20080830-082806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20080820-210801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37017',
internalId:  '',
customField: '20100902-113632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37038',
internalId:  '',
customField: '20100902-074706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36117',
internalId:  '',
customField: '20090827-223901'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3QRS';
var companyName   = 'Longmeadow+Music';
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();
};
