/* [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','1001',jdecode('Home'),jdecode(''),'/1001.html','true',[],''],
	['PAGE','58401',jdecode('Community+Update'),jdecode(''),'/58401.html','true',[],''],
	['PAGE','5401',jdecode('Administrative+Office'),jdecode(''),'/5401.html','true',[],''],
	['PAGE','110061',jdecode('+Contractors+Notice'),jdecode(''),'/110061.html','true',[],''],
	['PAGE','5422',jdecode('Special+Police'),jdecode(''),'/5422.html','true',[],''],
	['PAGE','5443',jdecode('Maintenance'),jdecode(''),'/5443.html','true',[],''],
	['PAGE','5485',jdecode('Recreation%2F+Events'),jdecode(''),'/5485.html','true',[],''],
	['PAGE','90061',jdecode('Calendar+of+Events'),jdecode(''),'/90061.html','true',[],''],
	['PAGE','5801',jdecode('Pictures'),jdecode(''),'/5801.html','false',[],''],
	['PAGE','116261',jdecode('Community+Pictures'),jdecode(''),'/116261.html','true',[],''],
	['PAGE','118161',jdecode('Tree+Cutting+Project'),jdecode(''),'/118161.html','true',[],''],
	['PAGE','57701',jdecode('Dam+Information%2FUpdates'),jdecode(''),'/57701.html','true',[],''],
	['PAGE','5464',jdecode('Board+Of+Directors'),jdecode(''),'/5464.html','true',[],''],
	['PAGE','112361',jdecode('BOD+Minutes+2009'),jdecode(''),'/112361.html','true',[],''],
	['PAGE','59001',jdecode('Meeting+Dates'),jdecode(''),'/59001.html','true',[],''],
	['PAGE','22201',jdecode('+By-Laws'),jdecode(''),'/22201.html','true',[],''],
	['PAGE','16922',jdecode('Rules+%26+Regulations'),jdecode(''),'/16922.html','true',[],''],
	['PAGE','60001',jdecode('WALPOA+Map%2FDirections'),jdecode(''),'/60001.html','true',[],''],
	['PAGE','79001',jdecode('Telephone+Numbers'),jdecode(''),'/79001.html','true',[],''],
	['PAGE','63901',jdecode('Advertisements'),jdecode(''),'/63901.html','true',[],''],
	['PAGE','60122',jdecode('Links'),jdecode(''),'/60122.html','true',[],''],
	['PAGE','115461',jdecode('Forms'),jdecode(''),'/115461.html','true',[],''],
	['PAGE','126772',jdecode('Wild+Acres+World+Info.'),jdecode(''),'/126772.html','true',[],''],
	['PAGE','132072',jdecode('Census+Information'),jdecode(''),'/132072.html','true',[],''],
	['PAGE','135572',jdecode('Pennsylvania+American+Water'),jdecode(''),'/135572.html','true',[],''],
	['PAGE','135972',jdecode('Wild+Acres+World'),jdecode(''),'/135972.html','true',[],'']];
var siteelementCount=26;
theSitetree.topTemplateName='Meadow';
theSitetree.paletteFamily='0000BB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10704';
theSitetree.graphicsetId='10949';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='9FD796';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Meadow',
				paletteFamily: 	'0000BB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10704',
				graphicsetId: 	'10949',
				contentColor: 	'000000',
				contentBGColor: '9FD796',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'6EC262',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-476708e38c81daa60610238456b20984']={
webappId:    '7060',
documentId:  '116261',
internalId:  '476708e38c81daa60610238456b20984',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20091119-163851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20091111-125700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5485',
internalId:  '',
customField: '20100304-114218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100127-121017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20100213-114852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20090903-140330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5464',
internalId:  '',
customField: '20100226-075026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20091026-110103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16922',
internalId:  '',
customField: '20091215-115227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115461',
internalId:  '',
customField: '20091112-121443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57701',
internalId:  '',
customField: '20100121-110822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58401',
internalId:  '',
customField: '20100226-080204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59001',
internalId:  '',
customField: '20100301-085316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60001',
internalId:  '',
customField: '20100121-111039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79001',
internalId:  '',
customField: '20090903-130557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60122',
internalId:  '',
customField: '20081201-140915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63901',
internalId:  '',
customField: '20090625-112040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90061',
internalId:  '',
customField: '20100203-140834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110061',
internalId:  '',
customField: '20091109-154044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112361',
internalId:  '',
customField: '20091111-162755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116261',
internalId:  '',
customField: '20091111-142125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118161',
internalId:  '',
customField: '20091111-142437'
};
webappMappings['1501']=webappMappings['1501-1945661']={
webappId:    '1501',
documentId:  '1001',
internalId:  '1945661',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126772',
internalId:  '',
customField: '20091210-102935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132072',
internalId:  '',
customField: '20100301-085844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135572',
internalId:  '',
customField: '20100308-142912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135972',
internalId:  '',
customField: '20100309-133108'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INXLE7';
var companyName   = 'Wild+Acres+Lakes+Property+%26+Homeowners+Association%2C+Inc.';
var htmlTitle	  = 'Wild+Acres+Lakes+POA';
var metaKeywords  = '';
var metaContents  = 'Private+CommunityWALPOAWild+AcresDingmans+Ferry';
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();
};
