/* [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','5552',jdecode('Introduction'),jdecode(''),'/5552/index.html','true',[ 
		['PAGE','5573',jdecode('Pictures+of+Hill+House'),jdecode(''),'/5552/5573.html','true',[],'',''],
		['PAGE','5615',jdecode('Statement+of+Equality'),jdecode(''),'/5552/5615.html','true',[],'','']
	],'',''],
	['PAGE','5636',jdecode('Dining+Experience'),jdecode(''),'/5636.html','true',[],'',''],
	['PAGE','5657',jdecode('Living+Area'),jdecode(''),'/5657.html','true',[],'',''],
	['PAGE','5678',jdecode('Amenities'),jdecode(''),'/5678.html','true',[],'',''],
	['PAGE','5699',jdecode('Affordable+Pricing'),jdecode(''),'/5699.html','true',[],'',''],
	['PAGE','5720',jdecode('Short+Stay+Opportunities'),jdecode(''),'/5720.html','true',[],'',''],
	['PAGE','5741',jdecode('Our+Hill+House+Family'),jdecode(''),'/5741.html','true',[],'',''],
	['PAGE','5762',jdecode('Testimonials'),jdecode(''),'/5762.html','true',[],'',''],
	['PAGE','40101',jdecode('News+Articles'),jdecode(''),'/40101.html','true',[],'',''],
	['PAGE','28901',jdecode('Hill+House+Gift+Shop'),jdecode(''),'/28901.html','true',[],'',''],
	['PAGE','5783',jdecode('Contact+Us'),jdecode(''),'/5783.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='364EB6';
theSitetree.keyvisualId='7103';
theSitetree.keyvisualName='kv_7103.jpg';
theSitetree.fontsetId='16394';
theSitetree.graphicsetId='12129';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'364EB6',
				keyvisualId: 	'7103',
				keyvisualName: 	'kv_7103.jpg',
				fontsetId: 		'16394',
				graphicsetId: 	'12129',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-24156799']={
webappId:    '1501',
documentId:  '5552',
internalId:  '24156799',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-5762aendu0invouk']={
webappId:    '1002',
documentId:  '5762',
internalId:  '5762aendu0invouk',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5573',
internalId:  '',
customField: '20091128-114843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5741',
internalId:  '',
customField: '20100316-161653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5552',
internalId:  '',
customField: '20100823-102843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20091112-213610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5615',
internalId:  '',
customField: '20091101-145143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5636',
internalId:  '',
customField: '20091128-114503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5762',
internalId:  '',
customField: '20091031-142315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5783',
internalId:  '',
customField: '20091108-144222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5657',
internalId:  '',
customField: '20091112-110339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5678',
internalId:  '',
customField: '20091101-174241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5699',
internalId:  '',
customField: '20091112-135827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5720',
internalId:  '',
customField: '20091112-134441'
};
webappMappings['7008']=webappMappings['7008-22671']={
webappId:    '7008',
documentId:  '5783',
internalId:  '22671',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20101222-200137'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INVOUK';
var companyName   = 'Hill+House+Apartments+For+Seniors';
var htmlTitle	  = 'Hill+House+Apartments+for+Seniors';
var metaKeywords  = 'independent+living%3Bretirement%3BArlington%3B+independent+living%3Baffordable+priced%3Bsenior+community%3Barlington+housing+section+8%3Bsenior+apts%3Bnear+dallas%2Cnear+dfw+airport%3Bnear+Fort+Worth';
var metaContents  = 'House+is+an+independent+living+retirement.+The+Hill+House+is+a+24+unit%2C+two-story+complex+with+an+elevator+that+accommodates+the+special+needs+of+older+adults+Meals';
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();
};

