/* [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','5901',jdecode('HOME'),jdecode(''),'/5901.html','true',[],''],
	['PAGE','26712',jdecode('NOTICES'),jdecode(''),'/26712.html','true',[],''],
	['PAGE','7001',jdecode('CALENDER'),jdecode(''),'/7001.html','true',[],''],
	['PAGE','7022',jdecode('DEPARTMENTS'),jdecode(''),'/7022.html','true',[],''],
	['PAGE','21012',jdecode('Administration'),jdecode(''),'/21012/index.html','false',[ 
		['PAGE','26912',jdecode('Fees'),jdecode(''),'/21012/26912.html','false',[],'']
	],''],
	['PAGE','19812',jdecode('Central+Maine+Regional+Airport'),jdecode(''),'/19812/index.html','false',[ 
		['PAGE','28412',jdecode('About+Us'),jdecode(''),'/19812/28412.html','false',[],''],
		['PAGE','28433',jdecode('Services'),jdecode(''),'/19812/28433.html','false',[],''],
		['PAGE','28454',jdecode('Contact+Us'),jdecode(''),'/19812/28454.html','false',[],''],
		['PAGE','28475',jdecode('Projects'),jdecode(''),'/19812/28475.html','false',[],''],
		['PAGE','28496',jdecode('Links'),jdecode(''),'/19812/28496.html','false',[],''],
		['PAGE','44379',jdecode('Airport+Photos'),jdecode(''),'/19812/44379.html','false',[],''],
		['PAGE','54590',jdecode('What%26%23x27%3Bs+Happening+at+CMRA'),jdecode(''),'/19812/54590.html','false',[],'']
	],''],
	['PAGE','21412',jdecode('Animal+Control'),jdecode(''),'/21412.html','false',[],''],
	['PAGE','36212',jdecode('Assessing'),jdecode(''),'/36212.html','false',[],''],
	['PAGE','21433',jdecode('Codes+Enforcement'),jdecode(''),'/21433.html','false',[],''],
	['PAGE','19833',jdecode('Fire+Department'),jdecode(''),'/19833.html','false',[],''],
	['PAGE','47179',jdecode('Members+'),jdecode(''),'/47179.html','false',[],''],
	['PAGE','60690',jdecode('History'),jdecode(''),'/60690.html','false',[],''],
	['PAGE','58890',jdecode('Links'),jdecode(''),'/58890.html','false',[],''],
	['PAGE','58911',jdecode('News'),jdecode(''),'/58911.html','false',[],''],
	['PAGE','60711',jdecode('Fire+Calls'),jdecode(''),'/60711.html','false',[],''],
	['PAGE','60732',jdecode('File+of+Life+Forms'),jdecode(''),'/60732.html','false',[],''],
	['PAGE','46779',jdecode('Fire+Permit+Information'),jdecode(''),'/46779.html','false',[],''],
	['PAGE','22912',jdecode('General+Assistance'),jdecode(''),'/22912.html','false',[],''],
	['PAGE','19854',jdecode('Library'),jdecode(''),'/19854.html','false',[],''],
	['PAGE','19875',jdecode('Public+Works+Department'),jdecode(''),'/19875.html','false',[],''],
	['PAGE','19896',jdecode('Recreation+Department'),jdecode(''),'/19896.html','false',[],''],
	['PAGE','19917',jdecode('Sewer+Department'),jdecode(''),'/19917.html','false',[],''],
	['PAGE','7043',jdecode('BOARDS+AND+COMMITTEES'),jdecode(''),'/7043/index.html','true',[ 
		['PAGE','19938',jdecode('Assessing'),jdecode(''),'/7043/19938.html','false',[],''],
		['PAGE','20212',jdecode('Budget+Committee'),jdecode(''),'/7043/20212.html','false',[],''],
		['PAGE','20233',jdecode('Planning+Board'),jdecode(''),'/7043/20233.html','false',[],''],
		['PAGE','19959',jdecode('Selectmen'),jdecode(''),'/7043/19959.html','false',[],''],
		['PAGE','32612',jdecode('Agenda%26%23x27%3Bs'),jdecode(''),'/7043/32612.html','false',[],''],
		['PAGE','32633',jdecode('Minutes'),jdecode(''),'/7043/32633.html','false',[],'']
	],''],
	['PAGE','13001',jdecode('LINKS'),jdecode(''),'/13001.html','true',[],''],
	['PAGE','16701',jdecode('SPECIAL+EVENTS'),jdecode(''),'/16701.html','true',[],''],
	['PAGE','31812',jdecode('PHOTOS'),jdecode(''),'/31812.html','true',[],''],
	['PAGE','74090',jdecode('Town+Election+2010'),jdecode(''),'/74090.html','false',[],'']];
var siteelementCount=41;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100303-125326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100225-164514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20091113-170059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20091020-140250'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20091228-140700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20091228-160711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19812',
internalId:  '',
customField: '20100126-124946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19833',
internalId:  '',
customField: '20100307-202844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19854',
internalId:  '',
customField: '20100212-161540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19875',
internalId:  '',
customField: '20090915-225017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19896',
internalId:  '',
customField: '20090911-152037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19917',
internalId:  '',
customField: '20090915-230017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19938',
internalId:  '',
customField: '20090916-175207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19959',
internalId:  '',
customField: '20091021-174258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20212',
internalId:  '',
customField: '20090911-153018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20233',
internalId:  '',
customField: '20090911-153018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21012',
internalId:  '',
customField: '20091228-100102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21412',
internalId:  '',
customField: '20100210-154734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21433',
internalId:  '',
customField: '20090915-161132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22912',
internalId:  '',
customField: '20090915-230809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26712',
internalId:  '',
customField: '20100219-122056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26912',
internalId:  '',
customField: '20091007-165523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28412',
internalId:  '',
customField: '20091113-113822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28433',
internalId:  '',
customField: '20091020-103007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28454',
internalId:  '',
customField: '20091113-113957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28475',
internalId:  '',
customField: '20091020-103007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28496',
internalId:  '',
customField: '20091113-121446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31812',
internalId:  '',
customField: '20100119-131301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32612',
internalId:  '',
customField: '20100301-164841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32633',
internalId:  '',
customField: '20100305-121120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74090',
internalId:  '',
customField: '20100305-135350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36212',
internalId:  '',
customField: '20091029-172656'
};
webappMappings['7060']=webappMappings['7060-5d6353019c2085c371de896341264b2b']={
webappId:    '7060',
documentId:  '31812',
internalId:  '5d6353019c2085c371de896341264b2b',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-55a9e671e6dd2e9e9fa8b175222d0125']={
webappId:    '7060',
documentId:  '44379',
internalId:  '55a9e671e6dd2e9e9fa8b175222d0125',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44379',
internalId:  '',
customField: '20091113-102831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46779',
internalId:  '',
customField: '20091226-140600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47179',
internalId:  '',
customField: '20100116-215712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54590',
internalId:  '',
customField: '20100108-142453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58911',
internalId:  '',
customField: '20100307-210151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58890',
internalId:  '',
customField: '20091227-170552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60690',
internalId:  '',
customField: '20091228-185911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60711',
internalId:  '',
customField: '20100307-211043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60732',
internalId:  '',
customField: '20091228-190345'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3BOS';
var companyName   = 'Town+of+Norridgewock';
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();
};
