/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','11501',jdecode('Early+Childhood+'),jdecode(''),'/11501/index.html','true',[ 
		['PAGE','38775',jdecode('Admissions'),jdecode(''),'/11501/38775.html','true',[],'',''],
		['PAGE','11522',jdecode('Schedule+%26+Tuition'),jdecode(''),'/11501/11522.html','true',[],'',''],
		['PAGE','25401',jdecode('Yearly+Events'),jdecode(''),'/11501/25401.html','true',[],'',''],
		['PAGE','29401',jdecode('Lunch+Menu'),jdecode(''),'/11501/29401.html','true',[],'',''],
		['PAGE','30901',jdecode('Parent+Handbook'),jdecode(''),'/11501/30901.html','true',[],'',''],
		['PAGE','38712',jdecode('Our+Staff'),jdecode(''),'/11501/38712.html','true',[],'',''],
		['PAGE','38733',jdecode('Our+History'),jdecode(''),'/11501/38733.html','true',[],'',''],
		['PAGE','10301',jdecode('Montessori+Philosophy'),jdecode(''),'/11501/10301.html','true',[],'',''],
		['PAGE','12001',jdecode('Three-year+Curriculum'),jdecode(''),'/11501/12001.html','true',[],'',''],
		['PAGE','38754',jdecode('The+School'),jdecode(''),'/11501/38754.html','true',[],'',''],
		['PAGE','41312',jdecode('FAQ%26%23x27%3Bs'),jdecode(''),'/11501/41312.html','true',[],'','']
	],'',''],
	['PAGE','40512',jdecode('Summer+Program'),jdecode(''),'/40512.html','true',[],'',''],
	['PAGE','13001',jdecode('Teacher+Education'),jdecode(''),'/13001/index.html','true',[ 
		['PAGE','13022',jdecode('Early+Childhood'),jdecode(''),'/13001/13022.html','true',[],'',''],
		['PAGE','13043',jdecode('Elementary+I'),jdecode(''),'/13001/13043.html','true',[],'',''],
		['PAGE','19601',jdecode('Boise+Additional+Site'),jdecode(''),'/13001/19601.html','true',[],'',''],
		['PAGE','40533',jdecode('Our+Teachers'),jdecode(''),'/13001/40533.html','true',[],'','']
	],'',''],
	['PAGE','30001',jdecode('Calendars+%26+Newsletters'),jdecode(''),'/30001.html','true',[],'',''],
	['PAGE','16601',jdecode('Foundation'),jdecode(''),'/16601.html','true',[],'',''],
	['PAGE','14101',jdecode('Links'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','27101',jdecode('Directions'),jdecode(''),'/27101.html','true',[],'',''],
	['PAGE','38796',jdecode('Employment+Opportunities'),jdecode(''),'/38796.html','true',[],'',''],
	['PAGE','25301',jdecode('Contact+Us'),jdecode(''),'/25301.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='7179A3';
theSitetree.keyvisualId='7078';
theSitetree.keyvisualName='kv_7078.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12122';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7179A3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'7179A3',
				keyvisualId: 	'7078',
				keyvisualName: 	'kv_7078.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12122',
				contentColor: 	'FFFFFF',
				contentBGColor: '7179A3',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100120-111915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20100121-142250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13022',
internalId:  '',
customField: '20100121-145538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100223-154710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11522',
internalId:  '',
customField: '20100222-165656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20090408-183814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13043',
internalId:  '',
customField: '20100121-150818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090427-135223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20090408-183846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100201-162005'
};
webappMappings['7008']=webappMappings['7008-2814']={
webappId:    '7008',
documentId:  '25301',
internalId:  '2814',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20100223-154857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20100125-170449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20100812-112909'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '27101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20100120-114300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20100813-120445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20100813-115530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20100811-174558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38712',
internalId:  '',
customField: '20100208-133801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38775',
internalId:  '',
customField: '20100222-170038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38796',
internalId:  '',
customField: '20100608-115306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38733',
internalId:  '',
customField: '20100222-180829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38754',
internalId:  '',
customField: '20100222-170239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40512',
internalId:  '',
customField: '20100608-121412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40533',
internalId:  '',
customField: '20100209-180944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41312',
internalId:  '',
customField: '20100222-180923'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVJ4X';
var companyName   = 'Woodland+Montessori+School';
var htmlTitle	  = 'Woodland+Montessori+School+';
var metaKeywords  = 'Kalispell+Montessori%2C+Woodland+Montessori%2C+Montana+Montessori+Teacher+Education%2C+Montana+Montessori%2C+Montessori+Teacher+Education%2C+Early+Childhood+Montessori%2C+Kindergarten%2C+Kalispell+Pre-School%2C+Flathead+Valley+Montessori%2C+Flathead+Valley+Pre-School%2C+Flathead+Valley+Private+School%2C+Flathead+Valley+Kindergarten%2C+Kalispell+Private+School%2C+Woodland+Montessori+Kalispell';
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();
};
