/* [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','33452',jdecode('HOME'),jdecode(''),'/33452.html','true',[],''],
	['PAGE','32835',jdecode('About+us'),jdecode(''),'/32835/index.html','true',[ 
		['PAGE','32844',jdecode('The+team'),jdecode(''),'/32835/32844.html','true',[],'']
	],''],
	['PAGE','32853',jdecode('Classrooms'),jdecode(''),'/32853/index.html','true',[ 
		['PAGE','32862',jdecode('Parent+Particpation'),jdecode(''),'/32853/32862.html','true',[],''],
		['PAGE','32871',jdecode('Goals+for+our+Children'),jdecode(''),'/32853/32871.html','true',[],''],
		['PAGE','32880',jdecode('Typical+daily+schedule'),jdecode(''),'/32853/32880.html','true',[],'']
	],''],
	['PAGE','32889',jdecode('Offers'),jdecode(''),'/32889.html','true',[],''],
	['PAGE','32898',jdecode('The+Curriculum'),jdecode(''),'/32898.html','true',[],''],
	['PAGE','32907',jdecode('Contact'),jdecode(''),'/32907/index.html','true',[ 
		['PAGE','32925',jdecode('How+to+find+us'),jdecode(''),'/32907/32925.html','true',[],'']
	],''],
	['PAGE','32934',jdecode('Tips+%26+Tricks'),jdecode(''),'/32934.html','true',[],''],
	['PAGE','32943',jdecode('Snack+Families'),jdecode(''),'/32943.html','true',[],''],
	['PAGE','32952',jdecode('Important+Dates+for+the+Month'),jdecode(''),'/32952.html','true',[],''],
	['PAGE','32961',jdecode('School+closures'),jdecode(''),'/32961.html','true',[],''],
	['PAGE','32970',jdecode('Extra+Curricular+Activities'),jdecode(''),'/32970.html','true',[],''],
	['PAGE','33558',jdecode('Guestbook'),jdecode(''),'/33558/index.html','true',[ 
		['PAGE','33557',jdecode('Read+Guestbook'),jdecode(''),'/33558/33557.html','false',[],'']
	],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Sonnemond';
theSitetree.paletteFamily='F9FBBF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10759';
theSitetree.graphicsetId='10816';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F9FBBF';
var theTemplate={
				name: 			'Sonnemond',
				paletteFamily: 	'F9FBBF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10759',
				graphicsetId: 	'10816',
				contentColor: 	'000000',
				contentBGColor: 'F9FBBF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5C5898',
				e_color: 		'ED4747',
				f_color: 		'437D3B',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32907',
internalId:  '',
customField: '20091021-165246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32889',
internalId:  '',
customField: '20091021-164810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33452',
internalId:  '',
customField: '20091021-183011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32835',
internalId:  '',
customField: '20091021-174220'
};
webappMappings['1002']=webappMappings['1002-33558ahw050ine39m']={
webappId:    '1002',
documentId:  '33558',
internalId:  '33558ahw050ine39m',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32844',
internalId:  '',
customField: '20091021-162833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32853',
internalId:  '',
customField: '20091021-163041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32862',
internalId:  '',
customField: '20091021-183133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32871',
internalId:  '',
customField: '20091021-163643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32934',
internalId:  '',
customField: '20080829-161056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32943',
internalId:  '',
customField: '20091104-170833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32952',
internalId:  '',
customField: '20100104-121610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33558',
internalId:  '',
customField: '20080829-181445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32880',
internalId:  '',
customField: '20091119-171815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32898',
internalId:  '',
customField: '20091021-165030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32925',
internalId:  '',
customField: '20091021-165422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32961',
internalId:  '',
customField: '20091119-171619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32970',
internalId:  '',
customField: '20091021-171824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33557',
internalId:  '',
customField: '20080829-181445'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INE39M';
var companyName   = 'A+World+Discovery+Montessori+School';
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();
};
