/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','38057',jdecode('NEWS+and+EVENTS'),jdecode(''),'/38057.html','true',[],'',''],
	['PAGE','652',jdecode('A+Northstate+Treasure'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','673',jdecode('Driving+Directions+'),jdecode(''),'/673.html','true',[],'',''],
	['PAGE','694',jdecode('The+Schmidt%26%23x27%3Bs+Gift'),jdecode(''),'/694.html','true',[],'',''],
	['PAGE','715',jdecode('Our+Caring+Team'),jdecode(''),'/715.html','true',[],'',''],
	['PAGE','2101',jdecode('Living+Options'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','8522',jdecode('Costs'),jdecode(''),'/8522.html','true',[],'',''],
	['PAGE','2122',jdecode('Long+Term+Care'),jdecode(''),'/2122.html','true',[],'',''],
	['PAGE','2143',jdecode('Short+Term+Care'),jdecode(''),'/2143.html','true',[],'',''],
	['PAGE','3601',jdecode('Levels+of+Care'),jdecode(''),'/3601.html','true',[],'',''],
	['PAGE','2164',jdecode('Memory+Care'),jdecode(''),'/2164.html','true',[],'',''],
	['PAGE','8543',jdecode('Join+Us+for+Lunch'),jdecode(''),'/8543.html','true',[],'',''],
	['PAGE','3622',jdecode('Daily+Living+Support'),jdecode(''),'/3622.html','true',[],'',''],
	['PAGE','3643',jdecode('Continence+Care'),jdecode(''),'/3643.html','true',[],'',''],
	['PAGE','3664',jdecode('Memory+Care'),jdecode(''),'/3664.html','true',[],'',''],
	['PAGE','18101',jdecode('Download+Forms'),jdecode(''),'/18101.html','true',[],'',''],
	['PAGE','736',jdecode('Family+Resources'),jdecode(''),'/736.html','true',[],'',''],
	['PAGE','757',jdecode('Links'),jdecode(''),'/757.html','true',[],'',''],
	['PAGE','8564',jdecode('Employment+'),jdecode(''),'/8564.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Column';
theSitetree.paletteFamily='45724E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10400';
theSitetree.graphicsetId='10617';
theSitetree.contentColor='121447';
theSitetree.contentBGColor='F8FBF9';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Column',
				paletteFamily: 	'45724E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10400',
				graphicsetId: 	'10617',
				contentColor: 	'121447',
				contentBGColor: 'F8FBF9',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'45724E',
				e_color: 		'25542E',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-124389']={
webappId:    '1501',
documentId:  '601',
internalId:  '124389',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100401-155210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20100401-165047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20100401-165435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20100401-160119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20100401-164415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20091130-184142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20100401-172956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2122',
internalId:  '',
customField: '20100401-173138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2143',
internalId:  '',
customField: '20091130-184458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2164',
internalId:  '',
customField: '20100401-174037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8543',
internalId:  '',
customField: '20100331-191525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20100401-173617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20091130-184928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3643',
internalId:  '',
customField: '20090302-184113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3664',
internalId:  '',
customField: '20091130-185019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20100331-193226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20091130-185135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20090828-184221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38057',
internalId:  '',
customField: '20100409-202100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8564',
internalId:  '',
customField: '20091130-190714'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2NW';
var companyName   = 'WestHaven+Assisted+Living';
var htmlTitle	  = 'WestHaven+Assisted+Living+In+Orland';
var metaKeywords  = 'assisted+living%2C+Orland+assisted+living%2C+Orland+elder+care%2C+elder+care%2C++dementia%2C+Alzheimers+Disease%2C+Alzheimers%2C+senior+housing%2C+nursing+home%2C+Orland%2C+Glenn+County%2C+Northern+California%2C+church+owned+elder+care%2C+Christian+nursing+home%2C+church+elder+care%2C+';
var metaContents  = 'Quality+Residential+Elder+Care+Community+in+Orland%2C+CA';
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();
};
