/* [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','10001',jdecode('About+the+Counselor'),jdecode(''), jdecode('%2F10001%2Findex.html'), 'true',[ 
		['PAGE','31401',jdecode('Curriculum+Vitae'),jdecode(''), jdecode('%2F10001%2F31401.html'), 'true',[],'',''],
		['PAGE','31801',jdecode('Charity+Work'),jdecode(''), jdecode('%2F10001%2F31801.html'), 'false',[],'','']
	],'',''],
	['PAGE','18501',jdecode('Individual+Counseling'),jdecode(''), jdecode('%2F18501.html'), 'true',[],'',''],
	['PAGE','16101',jdecode('Play+Therapy'),jdecode(''), jdecode('%2F16101%2Findex.html'), 'true',[ 
		['PAGE','16122',jdecode('What+is+Play+Therapy%3F'),jdecode(''), jdecode('%2F16101%2F16122.html'), 'true',[],'',''],
		['PAGE','16143',jdecode('How+Does+It+Work%3F'),jdecode(''), jdecode('%2F16101%2F16143.html'), 'true',[],'',''],
		['PAGE','15801',jdecode('It%26%23x27%3Bs+Benefits'),jdecode(''), jdecode('%2F16101%2F15801.html'), 'true',[],'',''],
		['PAGE','16164',jdecode('Is+It+For+Your+Child%3F'),jdecode(''), jdecode('%2F16101%2F16164.html'), 'true',[],'','']
	],'',''],
	['PAGE','55043',jdecode('Filial+Therapy'),jdecode(''), jdecode('%2F55043.html'), 'true',[],'',''],
	['PAGE','13101',jdecode('Fees+for+Services'),jdecode(''), jdecode('%2F13101.html'), 'true',[],'',''],
	['PAGE','33001',jdecode('Hours+of+Operation'),jdecode(''), jdecode('%2F33001.html'), 'true',[],'',''],
	['PAGE','13122',jdecode('Contact+Information'),jdecode(''), jdecode('%2F13122.html'), 'true',[],'',''],
	['PAGE','35901',jdecode('Paperwork'),jdecode(''), jdecode('%2F35901.html'), 'true',[],'',''],
	['PAGE','31422',jdecode('Resources'),jdecode(''), jdecode('%2F31422%2Findex.html'), 'true',[ 
		['PAGE','31443',jdecode('ADHD'),jdecode(''), jdecode('%2F31422%2F31443.html'), 'true',[],'',''],
		['PAGE','31464',jdecode('Anxiety'),jdecode(''), jdecode('%2F31422%2F31464.html'), 'true',[],'',''],
		['PAGE','33501',jdecode('Bipolar'),jdecode(''), jdecode('%2F31422%2F33501.html'), 'true',[],'',''],
		['PAGE','31485',jdecode('Child+Abuse'),jdecode(''), jdecode('%2F31422%2F31485.html'), 'true',[],'',''],
		['PAGE','31527',jdecode('Depression'),jdecode(''), jdecode('%2F31422%2F31527.html'), 'true',[],'',''],
		['PAGE','34301',jdecode('Domestic+Violence'),jdecode(''), jdecode('%2F31422%2F34301.html'), 'true',[],'',''],
		['PAGE','44701',jdecode('Mental+Illness'),jdecode(''), jdecode('%2F31422%2F44701.html'), 'true',[],'',''],
		['PAGE','43201',jdecode('Obsessive+Compulsive+Disorder'),jdecode(''), jdecode('%2F31422%2F43201.html'), 'true',[],'',''],
		['PAGE','34701',jdecode('Play+Therapy'),jdecode(''), jdecode('%2F31422%2F34701.html'), 'true',[],'','']
	],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Bombay';
theSitetree.paletteFamily='395987';
theSitetree.keyvisualId='7537';
theSitetree.keyvisualName='kv_7537.jpg';
theSitetree.fontsetId='16582';
theSitetree.graphicsetId='12202';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C0B89D';
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: 			'Bombay',
				paletteFamily: 	'395987',
				keyvisualId: 	'7537',
				keyvisualName: 	'kv_7537.jpg',
				fontsetId: 		'16582',
				graphicsetId: 	'12202',
				contentColor: 	'000000',
				contentBGColor: 'C0B89D',
				a_color: 		'395987',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20090204-221652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100408-192955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20120110-225839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20120110-230439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13122',
internalId:  '',
customField: '20120110-230716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16122',
internalId:  '',
customField: '20090204-221717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16143',
internalId:  '',
customField: '20090202-172219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16164',
internalId:  '',
customField: '20090204-221802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20110221-013044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20120110-224534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20090117-214109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31422',
internalId:  '',
customField: '20090208-010230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31443',
internalId:  '',
customField: '20090429-191514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31464',
internalId:  '',
customField: '20090429-191535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31485',
internalId:  '',
customField: '20090429-191456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34301',
internalId:  '',
customField: '20090429-191624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31527',
internalId:  '',
customField: '20090429-191605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20120110-225922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20090429-191425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20090429-191735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35901',
internalId:  '',
customField: '20101023-181323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55043',
internalId:  '',
customField: '20110308-011115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20090429-191719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20090429-190419'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE936';
var companyName   = 'Heather+N.+Smith%2C+M.Ed.%2C+LPC';
var htmlTitle	  = 'Counselilng+With+Heather';
var metaKeywords  = 'counseling+play+therapy+therapy+therapist+psychologist+psychology+psychiatry+denton+lewisville+texas+flower+mound+keller+adolescents+adults+group+therapy';
var metaContents  = 'Offering+counseling+for+children%2C+adolescents%2C+and+adults+on+a+sliding+scale+basis+in+Denton%2C+TX.';
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();
};

