/* [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(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','11501',jdecode('Early+Childhood+'),jdecode(''), jdecode('%2F11501%2Findex.html'), 'true',[ 
		['PAGE','38775',jdecode('Admissions'),jdecode(''), jdecode('%2F11501%2F38775.html'), 'true',[],'',''],
		['PAGE','11522',jdecode('Schedule+%26+Tuition'),jdecode(''), jdecode('%2F11501%2F11522.html'), 'true',[],'',''],
		['PAGE','25401',jdecode('Yearly+Events'),jdecode(''), jdecode('%2F11501%2F25401.html'), 'true',[],'',''],
		['PAGE','29401',jdecode('Lunch+Menu'),jdecode(''), jdecode('%2F11501%2F29401.html'), 'true',[],'',''],
		['PAGE','30901',jdecode('Parent+Handbook'),jdecode(''), jdecode('%2F11501%2F30901.html'), 'true',[],'',''],
		['PAGE','38712',jdecode('Our+Staff'),jdecode(''), jdecode('%2F11501%2F38712.html'), 'true',[],'',''],
		['PAGE','10301',jdecode('Montessori+Philosophy'),jdecode(''), jdecode('%2F11501%2F10301.html'), 'true',[],'',''],
		['PAGE','12001',jdecode('Three-year+Curriculum'),jdecode(''), jdecode('%2F11501%2F12001.html'), 'true',[],'','']
	],'',''],
	['PAGE','30001',jdecode('Calendars+%26+Newsletters'),jdecode(''), jdecode('%2F30001.html'), 'true',[],'',''],
	['PAGE','58912',jdecode('Fundraising'),jdecode(''), jdecode('%2F58912.html'), 'true',[],'',''],
	['PAGE','56312',jdecode('Parent+Ed.+%26+Resources'),jdecode(''), jdecode('%2F56312.html'), 'true',[],'',''],
	['PAGE','13001',jdecode('Teacher+Education'),jdecode(''), jdecode('%2F13001%2Findex.html'), 'true',[ 
		['PAGE','13022',jdecode('Early+Childhood'),jdecode(''), jdecode('%2F13001%2F13022.html'), 'true',[],'',''],
		['PAGE','13043',jdecode('Elementary+I'),jdecode(''), jdecode('%2F13001%2F13043.html'), 'true',[],'',''],
		['PAGE','19601',jdecode('Boise+Additional+Site'),jdecode(''), jdecode('%2F13001%2F19601.html'), 'true',[],'',''],
		['PAGE','40533',jdecode('Our+Teachers'),jdecode(''), jdecode('%2F13001%2F40533.html'), 'true',[],'','']
	],'',''],
	['PAGE','40512',jdecode('Summer+Program'),jdecode(''), jdecode('%2F40512.html'), 'true',[],'',''],
	['PAGE','16601',jdecode('Foundation'),jdecode(''), jdecode('%2F16601.html'), 'true',[],'',''],
	['PAGE','14101',jdecode('Links'),jdecode(''), jdecode('%2F14101.html'), 'true',[],'',''],
	['PAGE','27101',jdecode('Directions'),jdecode(''), jdecode('%2F27101.html'), 'true',[],'',''],
	['PAGE','25301',jdecode('Contact+Us'),jdecode(''), jdecode('%2F25301.html'), 'true',[],'','']];
var siteelementCount=23;
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 prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
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: '20111219-132430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20111219-123201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13022',
internalId:  '',
customField: '20111219-135859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20111219-132419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11522',
internalId:  '',
customField: '20111111-115246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20090408-173814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13043',
internalId:  '',
customField: '20111219-135711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090427-135223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20090408-173846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20111010-124050'
};
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: '20111219-135932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20111010-124848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20120112-114215'
};
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: '20120112-113030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20111010-111747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20111010-112434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38712',
internalId:  '',
customField: '20111010-112152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38775',
internalId:  '',
customField: '20111010-123340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58912',
internalId:  '',
customField: '20120124-141317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40512',
internalId:  '',
customField: '20110928-153315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40533',
internalId:  '',
customField: '20110928-153303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56312',
internalId:  '',
customField: '20111214-151743'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.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();
};

