/* [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(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','86881',jdecode('FAQs+%26+Referrals'),jdecode(''), jdecode('%2F86881.html'), 'true',[],'',''],
	['PAGE','2101',jdecode('Assisted+Living+'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','8522',jdecode('Costs'),jdecode(''), jdecode('%2F8522.html'), 'true',[],'',''],
	['PAGE','75081',jdecode('Mission+Statement'),jdecode(''), jdecode('%2F75081.html'), 'true',[],'',''],
	['PAGE','63681',jdecode('Special+Events'),jdecode(''), jdecode('%2F63681.html'), 'true',[],'',''],
	['PAGE','652',jdecode('About+Us'),jdecode(''), jdecode('%2F652.html'), 'true',[],'',''],
	['PAGE','8564',jdecode('Employment+'),jdecode(''), jdecode('%2F8564.html'), 'true',[],'',''],
	['PAGE','3601',jdecode('Levels+of+Care'),jdecode(''), jdecode('%2F3601.html'), 'true',[],'',''],
	['PAGE','3643',jdecode('Continence+Care'),jdecode(''), jdecode('%2F3643.html'), 'true',[],'',''],
	['PAGE','2122',jdecode('Long+Term+Care'),jdecode(''), jdecode('%2F2122.html'), 'true',[],'',''],
	['PAGE','2143',jdecode('Day+%26+Respite+Care'),jdecode(''), jdecode('%2F2143.html'), 'true',[],'',''],
	['PAGE','3664',jdecode('Memory+Care'),jdecode(''), jdecode('%2F3664.html'), 'true',[],'',''],
	['PAGE','3622',jdecode('Daily+Living+Support'),jdecode(''), jdecode('%2F3622.html'), 'true',[],'',''],
	['PAGE','64181',jdecode('Independent+Living+'),jdecode(''), jdecode('%2F64181.html'), 'true',[],'',''],
	['PAGE','673',jdecode('Driving+Directions+'),jdecode(''), jdecode('%2F673.html'), 'true',[],'',''],
	['PAGE','715',jdecode('Our+Caring+Team'),jdecode(''), jdecode('%2F715.html'), 'true',[],'',''],
	['PAGE','694',jdecode('The+Schmidt%26%23x27%3Bs+Gift'),jdecode(''), jdecode('%2F694.html'), 'true',[],'',''],
	['PAGE','38057',jdecode('Our+Newsletter'),jdecode(''), jdecode('%2F38057.html'), 'true',[],'',''],
	['PAGE','757',jdecode('TV+Ads+and+Links'),jdecode(''), jdecode('%2F757.html'), 'true',[],'',''],
	['PAGE','8543',jdecode('Join+Us+for+Lunch'),jdecode(''), jdecode('%2F8543.html'), 'true',[],'',''],
	['PAGE','736',jdecode('Family+Resources'),jdecode(''), jdecode('%2F736.html'), 'true',[],'',''],
	['PAGE','18101',jdecode('Download+Forms'),jdecode(''), jdecode('%2F18101.html'), 'true',[],'',''],
	['PAGE','90781',jdecode('Volunteering'),jdecode(''), jdecode('%2F90781.html'), 'true',[],'','']];
var siteelementCount=24;
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 prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75081',
internalId:  '',
customField: '20111204-171141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86881',
internalId:  '',
customField: '20111204-171032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90781',
internalId:  '',
customField: '20111204-165702'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20111204-171011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20111204-172031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20111204-172008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20111204-171346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20111204-171949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20111204-171058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20120115-174256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2122',
internalId:  '',
customField: '20111204-171554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2143',
internalId:  '',
customField: '20111204-171621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63681',
internalId:  '',
customField: '20120115-173758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8543',
internalId:  '',
customField: '20111204-173310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20111204-171435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20111204-171811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3643',
internalId:  '',
customField: '20111204-171536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3664',
internalId:  '',
customField: '20111204-171754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20111204-173405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20111204-173344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20111204-173251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38057',
internalId:  '',
customField: '20111204-172120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8564',
internalId:  '',
customField: '20120115-174136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64181',
internalId:  '',
customField: '20111204-171853'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2NW';
var companyName   = 'WestHaven+Senior+Living';
var htmlTitle	  = 'WestHaven+Christian+Senior+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+senile%2C+respite%2C+day+care%2C+Chico+assisted+living%2C+Corning+Assisted+Living%2C+Willows+assisted+living%2C+senior+care%2C+Independent+Living%2C+The+Village+at+Fairview%2C+WestHaven%2C+The+Neighborhoods+at+WestHaven%2C+Glenn+County%2C+Butte+County%2C+Thehema+County%2C+Shasta+County%2C+Sacramento+County%2C+North+Valley%2C+Parkinson%27s+Disease%2C+Parkinson%27s+Dementia%2C+Care+Giver%2C+Care+Giver+Support+Group%2C+Memory+Care%2C+Hospice%2C+Capay%2C';
var metaContents  = 'Christian+Senior+Living+and+Care+Communities';
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();
};

