/* [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','9601',jdecode('Civic+Club+Dues'),jdecode(''), jdecode('%2F9601.html'), 'true',[],'',''],
	['PAGE','38250',jdecode('Memorial+Park+News'),jdecode(''), jdecode('%2F38250%2Findex.html'), 'true',[ 
		['PAGE','38722',jdecode('Memorial+Park+Conservancy'),jdecode(''), jdecode('%2F38250%2F38722.html'), 'true',[],'','']
	],'',''],
	['PAGE','552',jdecode('Deed+Restrictions'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','15901',jdecode('Architecture+Committee'),jdecode(''), jdecode('%2F552%2F15901.html'), 'true',[],'','']
	],'',''],
	['PAGE','573',jdecode('Security+Info+%26+Dues'),jdecode(''), jdecode('%2F573.html'), 'true',[],'',''],
	['PAGE','26201',jdecode('Improvement+Projects'),jdecode(''), jdecode('%2F26201%2Findex.html'), 'true',[ 
		['PAGE','26222',jdecode('Tree+Planting'),jdecode(''), jdecode('%2F26201%2F26222.html'), 'true',[],'',''],
		['PAGE','26243',jdecode('Decorative+Street+Lamps'),jdecode(''), jdecode('%2F26201%2F26243.html'), 'true',[],'',''],
		['PAGE','38953',jdecode('Super+Neighborhood+22++Project'),jdecode(''), jdecode('%2F26201%2F38953.html'), 'true',[],'','']
	],'',''],
	['PAGE','2601',jdecode('Community+Forum'),jdecode(''), jdecode('%2F2601.html'), 'true',[],'',''],
	['PAGE','38192',jdecode('Calendar+of+Events'),jdecode(''), jdecode('%2F38192.html'), 'true',[],'',''],
	['PAGE','615',jdecode('Newsletters'),jdecode(''), jdecode('%2F615.html'), 'true',[],'',''],
	['PAGE','678',jdecode('Contact+Civic+Club'),jdecode(''), jdecode('%2F678.html'), 'true',[],'',''],
	['PAGE','39083',jdecode('Blockheads'),jdecode(''), jdecode('%2F39083.html'), 'true',[],'',''],
	['PAGE','636',jdecode('Community+Links'),jdecode(''), jdecode('%2F636.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('Trash+and+Recycling'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','2006',jdecode('Guestbook'),jdecode(''), jdecode('%2F2006%2Findex.html'), 'true',[ 
		['PAGE','2001',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F2006%2F2001.html'), 'false',[],'','']
	],'',''],
	['PAGE','34901',jdecode('Tree+Planting+Photo+Album'),jdecode(''), jdecode('%2F34901.html'), 'true',[],'',''],
	['PAGE','70134',jdecode('Google+Checkout'),jdecode(''), jdecode('%2F70134.html'), 'false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Kalkutta';
theSitetree.paletteFamily='83A763';
theSitetree.keyvisualId='6205';
theSitetree.keyvisualName='kv_6205.jpg';
theSitetree.fontsetId='11142';
theSitetree.graphicsetId='11946';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='ADC895';
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: 			'Kalkutta',
				paletteFamily: 	'83A763',
				keyvisualId: 	'6205',
				keyvisualName: 	'kv_6205.jpg',
				fontsetId: 		'11142',
				graphicsetId: 	'11946',
				contentColor: 	'000000',
				contentBGColor: 'ADC895',
				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: '20111021-034258'
};
webappMappings['1002']=webappMappings['1002-2006AHW050INX2RP']={
webappId:    '1002',
documentId:  '2006',
internalId:  '2006AHW050INX2RP',
customField: 'icq=false'
};
webappMappings['7005']=webappMappings['7005-161']={
webappId:    '7005',
documentId:  '573',
internalId:  '161',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-ahw050inx2rp11aa7e1e81e']={
webappId:    '1003',
documentId:  '2601',
internalId:  'ahw050inx2rp11aa7e1e81e',
customField: 'en:US:'
};
webappMappings['7005']=webappMappings['7005-162']={
webappId:    '7005',
documentId:  '552',
internalId:  '162',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7005']=webappMappings['7005-163']={
webappId:    '7005',
documentId:  '26243',
internalId:  '163',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-dff86cf6ff9330b24d586f21143e346f']={
webappId:    '7060',
documentId:  '34901',
internalId:  'dff86cf6ff9330b24d586f21143e346f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20110526-114146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20111024-231659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20080410-145929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20120107-022623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26201',
internalId:  '',
customField: '20100522-194239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26222',
internalId:  '',
customField: '20090328-151205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26243',
internalId:  '',
customField: '20080410-153334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20090204-142042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38192',
internalId:  '',
customField: '20110407-201431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20111005-205711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20110407-144534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20101106-194425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20110906-115218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2006',
internalId:  '',
customField: '20090408-133049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20070630-142847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20080523-141358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38250',
internalId:  '',
customField: '20111021-035152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38953',
internalId:  '',
customField: '20101020-211630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70134',
internalId:  '',
customField: '20111119-160224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38722',
internalId:  '',
customField: '20110408-111930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39083',
internalId:  '',
customField: '20111017-120837'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2RP';
var companyName   = 'Crestwood%2FGlen+Cove+Neighborhoods';
var htmlTitle	  = 'Crestwood%2FGlen+Cove';
var metaKeywords  = 'Memorial%2C+CrestwoodGlenCove%2C+Inner-Loop%2C+Houston%2C+Inner+Loop%2C+Memorial+Park%2C+Memorial+Drive%2C+Crestwood%2C+GlenCove%2C+Camp+Logan%2C+Westcott';
var metaContents  = 'Residents+of+Crestwood+and+Glen+Cove+enjoy+a+world-class+1508-acre+public+park+next+door+that+features+Houstons+first+golf+course%2C+a+soft+jogging+trail+along+with+hiking+and+biking+trails%2C+picnic+grounds%2C+ball+fields%2C+tennis+courts%2C+multiple+childrens+playgrounds%2C+a+public+swimming+pool%2C+an+arboretum+and+more.++Our+neighborhood+is+in+a+great+location%2C+only+a+few+miles+from+downtown+Houston+and+has+easy+access+to+major+thoroughfares.';
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();
};

