/* [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','901',jdecode('Welcome'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','16401',jdecode('Our+Services'),jdecode(''),'/16401.html','true',[],'',''],
	['PAGE','16422',jdecode('Our+Practitioners'),jdecode(''),'/16422/index.html','true',[ 
		['PAGE','16464',jdecode('Allen+Melvin%2C+M.D.'),jdecode(''),'/16422/16464.html','true',[],'',''],
		['PAGE','16485',jdecode('Laura+A.+Bass%2C+MSW%2C+LCSW'),jdecode(''),'/16422/16485.html','true',[],'',''],
		['PAGE','16443',jdecode('Melanie+Crawford%2C+LCSW'),jdecode(''),'/16422/16443.html','true',[],'',''],
		['PAGE','16506',jdecode('Hayne+McMeekin%2C+M.D.'),jdecode(''),'/16422/16506.html','true',[],'',''],
		['PAGE','16527',jdecode('Christine+F.+Simpson%2C+MSW%2C+LCSW'),jdecode(''),'/16422/16527.html','true',[],'',''],
		['PAGE','16548',jdecode('Helene+Laurenti%2C+Ph.D.%2C+HSP-P'),jdecode(''),'/16422/16548.html','true',[],'',''],
		['PAGE','68401',jdecode('Brenda+M.+Alloway%2C+Ph.D.%2C+JD'),jdecode(''),'/16422/68401.html','true',[],'','']
	],'',''],
	['PAGE','16569',jdecode('Contact+Us'),jdecode(''),'/16569.html','true',[],'',''],
	['PAGE','70186',jdecode('How+To+Find+Us'),jdecode(''),'/70186.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Nurseries';
theSitetree.paletteFamily='FFE57B';
theSitetree.keyvisualId='7904';
theSitetree.keyvisualName='kv_7904.jpg';
theSitetree.fontsetId='16879';
theSitetree.graphicsetId='12313';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFE57B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Nurseries',
				paletteFamily: 	'FFE57B',
				keyvisualId: 	'7904',
				keyvisualName: 	'kv_7904.jpg',
				fontsetId: 		'16879',
				graphicsetId: 	'12313',
				contentColor: 	'000000',
				contentBGColor: 'FFE57B',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16422',
internalId:  '',
customField: '20100605-194458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68401',
internalId:  '',
customField: '20100605-211637'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100605-205453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16464',
internalId:  '',
customField: '20100609-060810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16527',
internalId:  '',
customField: '20100608-204149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16548',
internalId:  '',
customField: '20100605-211900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20100605-191414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16485',
internalId:  '',
customField: '20100605-211729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16443',
internalId:  '',
customField: '20100605-212359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16506',
internalId:  '',
customField: '20100609-060911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16569',
internalId:  '',
customField: '20100605-212720'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '70186',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70186',
internalId:  '',
customField: '20100608-212718'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INE9VU';
var companyName   = 'Arboretum+Behavioral+Health+Associates';
var htmlTitle	  = 'Arboretum+Behavioral+Health+Associates';
var metaKeywords  = 'behavioral%2C+health%2C+psychology%2C+psychiatrist%2C+psychologist%2C+arboretum%2C+charlotte%2C+therapy%2C+therapist%2C+social+worker%2C+counseling%2C+counselor%2C+bass%2C+melvin%2C+simpson%2C+crawford%2C+laurenti%2C+mcmeekin';
var metaContents  = '';
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();
};
