/* [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','139144',jdecode('Carve+Out+DD+Svcs%21'),jdecode(''), jdecode('%2F139144.html'), 'true',[],'',''],
	['PAGE','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('About+us'),jdecode(''), jdecode('%2F1952%2Findex.html'), 'true',[ 
		['PAGE','7701',jdecode('Staff'),jdecode(''), jdecode('%2F1952%2F7701.html'), 'true',[],'',''],
		['PAGE','7722',jdecode('Board+of+Directors'),jdecode(''), jdecode('%2F1952%2F7722.html'), 'true',[],'','']
	],'',''],
	['PAGE','118933',jdecode('Corporate+Compliance'),jdecode(''), jdecode('%2F118933%2Findex.html'), 'true',[ 
		['PAGE','119233',jdecode('Code+of+Ethics'),jdecode(''), jdecode('%2F118933%2F119233.html'), 'true',[],'',''],
		['PAGE','119254',jdecode('Corp.+Compliance+Plan'),jdecode(''), jdecode('%2F118933%2F119254.html'), 'true',[],'',''],
		['PAGE','119275',jdecode('Privacy+Notice'),jdecode(''), jdecode('%2F118933%2F119275.html'), 'true',[],'',''],
		['PAGE','119296',jdecode('Policy+and+Resolution'),jdecode(''), jdecode('%2F118933%2F119296.html'), 'true',[],'','']
	],'',''],
	['PAGE','2036',jdecode('Services'),jdecode(''), jdecode('%2F2036%2Findex.html'), 'true',[ 
		['PAGE','2057',jdecode('Day+Services'),jdecode(''), jdecode('%2F2036%2F2057.html'), 'true',[],'',''],
		['PAGE','2078',jdecode('Residental+Services'),jdecode(''), jdecode('%2F2036%2F2078.html'), 'true',[],'',''],
		['PAGE','2099',jdecode('Self-Directed+Care'),jdecode(''), jdecode('%2F2036%2F2099.html'), 'true',[],'',''],
		['PAGE','2120',jdecode('Case+Management'),jdecode(''), jdecode('%2F2036%2F2120.html'), 'true',[],'',''],
		['PAGE','48845',jdecode('Transportation'),jdecode(''), jdecode('%2F2036%2F48845.html'), 'true',[],'',''],
		['PAGE','48866',jdecode('Nursing+Services'),jdecode(''), jdecode('%2F2036%2F48866.html'), 'true',[],'','']
	],'',''],
	['PAGE','1973',jdecode('Employment'),jdecode(''), jdecode('%2F1973%2Findex.html'), 'true',[ 
		['PAGE','10201',jdecode('Volunteering'),jdecode(''), jdecode('%2F1973%2F10201.html'), 'true',[],'','']
	],'',''],
	['PAGE','1994',jdecode('News+%26+Calendar'),jdecode(''), jdecode('%2F1994.html'), 'true',[],'',''],
	['PAGE','2015',jdecode('Resources'),jdecode(''), jdecode('%2F2015%2Findex.html'), 'true',[ 
		['PAGE','19201',jdecode('Employees+Only'),jdecode(''), jdecode('%2F2015%2F19201.html'), 'true',[],'','']
	],'',''],
	['PAGE','2401',jdecode('Shredding'),jdecode(''), jdecode('%2F2401.html'), 'true',[],'',''],
	['PAGE','125033',jdecode('Surveys'),jdecode(''), jdecode('%2F125033.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10829';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10829',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119233',
internalId:  '',
customField: '20111020-124106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20120215-090616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48866',
internalId:  '',
customField: '20110901-103452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125033',
internalId:  '',
customField: '20111114-155707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20120130-130012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20110502-143317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20120220-085643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20111021-084654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20120221-172800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2015',
internalId:  '',
customField: '20120118-160653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20110901-103800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2057',
internalId:  '',
customField: '20110901-103736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20110901-103659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2099',
internalId:  '',
customField: '20110901-103605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2120',
internalId:  '',
customField: '20111114-144509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20110901-104436'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '139144',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20110901-104226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20120130-143718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48845',
internalId:  '',
customField: '20110901-103519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118933',
internalId:  '',
customField: '20120118-160726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119254',
internalId:  '',
customField: '20111021-083405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119275',
internalId:  '',
customField: '20111020-124310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119296',
internalId:  '',
customField: '20111021-083550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139144',
internalId:  '',
customField: '20120216-131814'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INLT4I';
var companyName   = 'Flinthills+Services%2C+Inc.';
var htmlTitle	  = 'Flinthills+Services%2C+Inc.';
var metaKeywords  = 'disabledMR%2FDDtargeted+case+managementday+servicesresidential+services';
var metaContents  = 'Disabilty+services+in+Butler+County+Kansas';
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();
};

