/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','473',jdecode('Services'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','27001',jdecode('Individual+Sessions'),jdecode(''),'/473/27001.html','true',[],'',''],
		['PAGE','27043',jdecode('Music+Therapy+Groups'),jdecode(''),'/473/27043.html','true',[],'',''],
		['PAGE','34453',jdecode('Sprouting+Melodies'),jdecode(''),'/473/34453.html','true',[],'',''],
		['PAGE','22201',jdecode('Early+Intervention'),jdecode(''),'/473/22201.html','true',[],'',''],
		['PAGE','22222',jdecode('Afterschool+Groups'),jdecode(''),'/473/22222.html','true',[],'',''],
		['PAGE','27022',jdecode('MT+Assisted+Childbirth'),jdecode(''),'/473/27022.html','true',[],'',''],
		['PAGE','33999',jdecode('Presentations'),jdecode(''),'/473/33999.html','true',[],'',''],
		['PAGE','34382',jdecode('Children%26%23x27%3Bs+Concerts'),jdecode(''),'/473/34382.html','true',[],'',''],
		['PAGE','27085',jdecode('Birthday+Parties+'),jdecode(''),'/473/27085.html','true',[],'','']
	],'',''],
	['PAGE','22901',jdecode('Newsletter+Articles'),jdecode(''),'/22901/index.html','true',[ 
		['PAGE','22922',jdecode('Using+Music+at+Home'),jdecode(''),'/22901/22922.html','true',[],'',''],
		['PAGE','22943',jdecode('MT+and+the+IEP'),jdecode(''),'/22901/22943.html','true',[],'',''],
		['PAGE','34794',jdecode('Is+My+Baby+Bored%3F'),jdecode(''),'/22901/34794.html','true',[],'','']
	],'',''],
	['PAGE','34160',jdecode('MT+in+Action'),jdecode(''),'/34160.html','true',[],'',''],
	['PAGE','34169',jdecode('Upcoming+Events'),jdecode(''),'/34169.html','true',[],'',''],
	['PAGE','19801',jdecode('Testimonials'),jdecode(''),'/19801.html','true',[],'',''],
	['PAGE','5901',jdecode('Music+Therapy+Links'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','8901',jdecode('FAQ%26%23x27%3Bs'),jdecode(''),'/8901.html','true',[],'',''],
	['PAGE','515',jdecode('About+Us'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','536',jdecode('Contact+Us'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','14401',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/536/14401.html','false',[],'','']
	],'',''],
	['PAGE','34482',jdecode('Newsletter+Sign+Up'),jdecode(''),'/34482.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='C9DFEE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10571';
theSitetree.graphicsetId='10771';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F0F2F4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Borders',
				paletteFamily: 	'C9DFEE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10571',
				graphicsetId: 	'10771',
				contentColor: 	'692643',
				contentBGColor: 'F0F2F4',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-148090']={
webappId:    '1501',
documentId:  '401',
internalId:  '148090',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34794',
internalId:  '',
customField: '20090701-144419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100403-224346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20100403-223628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20090701-144859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090722-115047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20090810-064216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22222',
internalId:  '',
customField: '20100120-120010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20090610-213537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27022',
internalId:  '',
customField: '20090810-065759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33999',
internalId:  '',
customField: '20090722-114957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27043',
internalId:  '',
customField: '20090204-112522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20090530-221439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27085',
internalId:  '',
customField: '20080415-175954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22922',
internalId:  '',
customField: '20080317-210351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22943',
internalId:  '',
customField: '20080430-160252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20090415-093949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20100403-223122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20091104-123740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20070316-152738'
};
webappMappings['7008']=webappMappings['7008-7969']={
webappId:    '7008',
documentId:  '536',
internalId:  '7969',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34482',
internalId:  '',
customField: '20090415-094128'
};
webappMappings['7060']=webappMappings['7060-1d6892537fc8d28477edd40a25719620']={
webappId:    '7060',
documentId:  '34160',
internalId:  '1d6892537fc8d28477edd40a25719620',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34169',
internalId:  '',
customField: '20091218-154108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34160',
internalId:  '',
customField: '20100403-223949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34382',
internalId:  '',
customField: '20090311-093351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34453',
internalId:  '',
customField: '20100505-080429'
};
webappMappings['7008']=webappMappings['7008-2902']={
webappId:    '7008',
documentId:  '34482',
internalId:  '2902',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2XN';
var companyName   = 'Roman+Music+Therapy+Services';
var htmlTitle	  = 'Roman+Music+Therapy+Services';
var metaKeywords  = 'music+therapy+school+library+program+group+social+skills+boston+language+communication+development+professional+boston+malden+massachusetts+lessons+class+classes+piano+guitar+drums+maracas+special+education+early+childhood+intervention+adults+teens+teenager+teenagers+elderly+melrose+wakefield+saugus+revere+lynn+reading+north+reading+north+shore+greater+boston+medford+arlington+natick+charlestown+everett+andover+methuen+haverhill+lawrence+';
var metaContents  = 'Roman+Music+Therapy+Services+provides+music+therapy+services+to+groups+and+individuals+in+the+Greater+Boston%2C+MA+area.++';
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();
};

