/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('Contact+Us'),jdecode(''),'/452.html','true',[],''],
	['PAGE','473',jdecode('About+Us'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','2743',jdecode('Board+of+Directors'),jdecode(''),'/473/2743.html','true',[],''],
		['PAGE','2764',jdecode('Meetings'),jdecode(''),'/473/2764.html','true',[],''],
		['PAGE','2785',jdecode('Constitution'),jdecode(''),'/473/2785.html','true',[],''],
		['PAGE','2806',jdecode('ByLaws'),jdecode(''),'/473/2806.html','true',[],''],
		['PAGE','2827',jdecode('Your+Area'),jdecode(''),'/473/2827.html','true',[],'']
	],''],
	['PAGE','494',jdecode('Join+MNA'),jdecode(''),'/494/index.html','true',[ 
		['PAGE','2848',jdecode('Get+Involved'),jdecode(''),'/494/2848.html','true',[],'']
	],''],
	['PAGE','515',jdecode('Neighborhood+Info'),jdecode(''),'/515/index.html','true',[ 
		['PAGE','2911',jdecode('What%26%23x27%3Bs+Happening+Now'),jdecode(''),'/515/2911.html','true',[],''],
		['PAGE','2953',jdecode('Voting+Information'),jdecode(''),'/515/2953.html','true',[],''],
		['PAGE','2974',jdecode('Public+Safety+Info'),jdecode(''),'/515/2974.html','true',[],''],
		['PAGE','2995',jdecode('Our+Elected+Officials'),jdecode(''),'/515/2995.html','true',[],'']
	],''],
	['PAGE','536',jdecode('Events'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','3016',jdecode('Membership+Drive'),jdecode(''),'/536/3016.html','true',[],''],
		['PAGE','3058',jdecode('Annual+Events'),jdecode(''),'/536/3058.html','true',[],'']
	],''],
	['PAGE','557',jdecode('Meadoword'),jdecode(''),'/557/index.html','true',[ 
		['PAGE','3121',jdecode('Archives'),jdecode(''),'/557/3121.html','true',[],'']
	],''],
	['PAGE','578',jdecode('Links'),jdecode(''),'/578.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Common';
theSitetree.paletteFamily='5AA435';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26635';
theSitetree.graphicsetId='13447';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Common',
				paletteFamily: 	'5AA435',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26635',
				graphicsetId: 	'13447',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091115-191116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20090913-084710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20071210-201313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2764',
internalId:  '',
customField: '20090614-110323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20091115-191147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2743',
internalId:  '',
customField: '20091115-191312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2785',
internalId:  '',
customField: '20081117-224953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2806',
internalId:  '',
customField: '20081117-224925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2827',
internalId:  '',
customField: '20091115-191558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2848',
internalId:  '',
customField: '20091115-191652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20090913-085304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2911',
internalId:  '',
customField: '20091115-191739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2953',
internalId:  '',
customField: '20090103-191204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2974',
internalId:  '',
customField: '20090913-084550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2995',
internalId:  '',
customField: '20090103-170512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20091013-220707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3016',
internalId:  '',
customField: '20090913-083820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3058',
internalId:  '',
customField: '20090913-085134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090913-083354'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3121',
internalId:  '',
customField: '20090913-083558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20090913-093818'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INXXEY';
var companyName   = 'Meadowood+Neighborhood+Association';
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();
};
