/* [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','5301',jdecode('Home'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','31601',jdecode('Annual+Meeting'),jdecode(''), jdecode('%2F31601.html'), 'true',[],'',''],
	['PAGE','13401',jdecode('Condo+Documents'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'',''],
	['PAGE','5352',jdecode('Minutes'),jdecode(''), jdecode('%2F5352.html'), 'true',[],'',''],
	['PAGE','5373',jdecode('Past+Minutes'),jdecode(''), jdecode('%2F5373.html'), 'true',[],'',''],
	['PAGE','17201',jdecode('Financials'),jdecode(''), jdecode('%2F17201.html'), 'true',[],'',''],
	['PAGE','27401',jdecode('Neighborhood'),jdecode(''), jdecode('%2F27401.html'), 'true',[],'',''],
	['PAGE','35401',jdecode('Rentals+%26+Sales'),jdecode(''), jdecode('%2F35401.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Vignette';
theSitetree.paletteFamily='E79E6E';
theSitetree.keyvisualId='3561';
theSitetree.keyvisualName='kv_3561.jpg';
theSitetree.fontsetId='10783';
theSitetree.graphicsetId='10833';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vignette',
				paletteFamily: 	'E79E6E',
				keyvisualId: 	'3561',
				keyvisualName: 	'kv_3561.jpg',
				fontsetId: 		'10783',
				graphicsetId: 	'10833',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'E79E6E',
				e_color: 		'886146',
				f_color: 		'C97556',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20120116-200544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5352',
internalId:  '',
customField: '20111113-184125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5373',
internalId:  '',
customField: '20111113-184351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27401',
internalId:  '',
customField: '20110913-205636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20110913-205420'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20111113-160254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20110913-205353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20120117-224823'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEPLU';
var companyName   = 'Zia+Vista+Condominium+Assoc.';
var htmlTitle	  = 'Zia+Vista+Condominium+Association';
var metaKeywords  = 'Zia+Vista+Condominium+Association%2C+condominium%2C+Zia+Vista%2C+nonprofit+corporation%2C+Santa+Fe%2C+New+Mexico%2C+condominium+association%2C+homes+for+sale%2C+condos+for+rent%2C+Declaration%2C+Bylaws%2C+Rules+and+Regulations%2C+Policies+and+Procedures%2C+Board+of+Directors%2C+rentals%2C+sales%2C+annual+meeting%2C+neighborhood.';
var metaContents  = 'Zia+Vista+Condominium+Association%2C+a+New+Mexico+nonprofit+corporation%2C+is+located+in+Santa+Fe%2C+NM.+The+gated+Territorial+style+complex%2C+built+in+1987%2C+contains+11+buildings+with+a+total+of+199+one-+and+two-bedroom+units+and+a+clubhouse+with+offices%2C+an+entertainment+room%2C+laundry%2C+fitness+center%2C+sauna%2C+and+outdoor+hot+tub+and+pool.+The+grounds+contain+lawns+and+mature+trees+and+plants.+The+developers+transferred+ownership+of+the+Association+in+2005.+All+units+are+privately+owned%2C+and+the+Association+does+not+sell+or+rent+units+although+individual+owners+do+rent+their+units.+The+Board+consists+of+five+Directors%2C+a+president%2C+vice+president%2C+treasurer%2C+secretary%2C+and+member+at+large.+The+staff+consists+of+an+association+manager%2C+maintenance+supervisor%2C+and+maintenance+assistant.+There+are+four+committees%3A+finance%2C+governance%2C+building+and+grounds%2C+and+communication.+The+Association+is+governed+by+a+Declaration+and+Bylaws%2C+Roberts+Rules+of+Order%2C+a+Policies+and+Procedures+Handbook%2C+and+Rules+and+Regulations.+The+Board+meets+monthly%2C+and+the+annual+meeting+is+in+the+fall.+Each+owner+pays+a+monthly+condo+fee.+Funds+are+kept+in+local+banks+with+the+reserve+distributed+among+CDs.';
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();
};

