/* [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','3201',jdecode('Home'),jdecode(''),'/3201.html','true',[],'',''],
	['PAGE','25201',jdecode('What+is+Cognitive+Therapy'),jdecode(''),'/25201.html','true',[],'',''],
	['PAGE','25222',jdecode('Problems+Addressed'),jdecode(''),'/25222.html','true',[],'',''],
	['PAGE','25243',jdecode('Negative+Thinking+Role'),jdecode(''),'/25243.html','true',[],'',''],
	['PAGE','23901',jdecode('Emotional+Thinking+Errors'),jdecode(''),'/23901.html','true',[],'',''],
	['PAGE','9543',jdecode('Messages+From+Childhood'),jdecode(''),'/9543.html','true',[],'',''],
	['PAGE','25401',jdecode('Your+Personality%26%23x27%3Bs+Effect'),jdecode(''),'/25401.html','true',[],'',''],
	['PAGE','27501',jdecode('15+Ways+to+Change'),jdecode(''),'/27501.html','true',[],'',''],
	['PAGE','66401',jdecode('Book+List+to+Help+You'),jdecode(''),'/66401.html','true',[],'',''],
	['PAGE','9501',jdecode('Patient+Information'),jdecode(''),'/9501.html','true',[],'',''],
	['PAGE','48401',jdecode('Insurance+-+Payment'),jdecode(''),'/48401.html','true',[],'',''],
	['PAGE','21801',jdecode('Directions-Parking-Metro'),jdecode(''),'/21801.html','true',[],'',''],
	['PAGE','21822',jdecode('Contact+Us'),jdecode(''),'/21822.html','true',[],'',''],
	['PAGE','59601',jdecode('Submit+an+Email+to+Us'),jdecode(''),'/59601.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6860';
theSitetree.keyvisualName='kv_6860.jpg';
theSitetree.fontsetId='11211';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6860',
				keyvisualName: 	'kv_6860.jpg',
				fontsetId: 		'11211',
				graphicsetId: 	'12030',
				contentColor: 	'FFFFFF',
				contentBGColor: '94AAE1',
				a_color: 		'94AAE1',
				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:  '3201',
internalId:  '',
customField: '20100416-082407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21822',
internalId:  '',
customField: '20100224-170354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66401',
internalId:  '',
customField: '20100305-105942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9543',
internalId:  '',
customField: '20100220-082249'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20100220-082424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20100215-150037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20100528-164657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25243',
internalId:  '',
customField: '20100225-144640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25222',
internalId:  '',
customField: '20100309-081744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20100220-083525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20100225-144940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20100225-144833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59601',
internalId:  '',
customField: '20100224-170424'
};
webappMappings['7008']=webappMappings['7008-6737']={
webappId:    '7008',
documentId:  '59601',
internalId:  '6737',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48401',
internalId:  '',
customField: '20100215-150224'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZWM5';
var companyName   = 'Cognitive+Therapy+Center+of+Maryland';
var htmlTitle	  = 'Cognitive+Therapy+Center+of+Maryland';
var metaKeywords  = 'Location%3A+5530+Wisconsin+Avenue+Chevy+Chase+MD%2C+++Administrative+Location%3A+1730+Rhode+Island+Avenue+Suite+715+Washington+DC+20036-1355%2C++++++Category%3A++Mental+Health+Services%2C+Psychotherapy%2C+Counseling%2C++Psychology.+++++Type+of+Service%3A++Cognitive+Therapy%2C++Cognitive+Behavior+Therapy%2C+++++Awards%3A+Top+Cognitive+Behavioral+Therapist+in+Washington+DC+2009.+++++++++Geographical+Area+Served%3A+++Washington+DC%2C+++Bethesda+MD%2C++Chevy+Chase+MD%2C++Potomac+MD%2C++Rockville+MD%2C+++Silver+Spring+MD%2C++Gaithersburg+MD%2C+++Montgomery+co.+MD%2C++Washington+Metro+area%2C++Mclean+VA%2C+Northern+Virginia%2C+Prince+Georges+County+MD%2C+College+Park+MD%2C++Arlington+VA%2C+Darnstown+MD%2C+Kensington+md%2C++++++++++Services%3A++Treatment+for+Depression%2C++Panic+Attacks%2C+Anxiety+Generalized%2C++Anxiety%2C++Anxiety+Attacks%2C++Panic+Disorder%2C++Agoraphobia%2C+++Social+Anxiety%2C++Social+Phobia%2C++Obsessive-Compulsive+Disorder++Post-Traumatic+Stress+Disorder%2C++Withdrawal+from+Anti-Anxiety+Medications%2C++Somatization+Disorder%2C++Marital+discord%2C++Anger+problems%2C++Personality+Disorders+%2C+Attention+Deficit+Disorder%2C++Low+Self+Esteem%2C+++Relationship+Problems%2C+Performance+Anxiety%2C+++Public+speaking%2C++Low+mood%2C+Hopelessness%2C+Poor+sleep++Loss+of+appetite%2C++Low+energy%2C+++Poor+concentration%2C+Constant+ruminations%2C+Psychologist%2C+Psychiatrist%2C+Psychotherapist';
var metaContents  = 'Dr.+Lawrence+Dalton%2C++named+one+of+the+top+Cognitive+Behavior+therapist++in+Washington+DC%2C+for+2009.+Dr.+Dalton+uses+Cognitive+Therapy+for+treating+Depression%2C++Panic+Attacks%2C+Anxiety+Generalized%2C++Anxiety%2C++Anxiety+Attacks%2C++Panic+Disorder%2C++Agoraphobia%2C+++Social+Anxiety%2C++Social+Phobia%2C++Obsessive-Compulsive+Disorder.+He+is+a+licensed+psychologist%2Cwho+has+provided+Cognitive-Behavioral+Psychotherapy+to+the+Washington%2C+DC+metro+area+since+1986.++Dr.+Dalton+is+fully+certified+by+and+is+one+of+the+original+Founding+Fellows+of+the+Academy+of+Cognitive+Therapy+%28Dr.+Aaron+Becks+Cognitive+Therapist+accrediting+organization%29.++In+a+2009+survey%2C+sent+to+1%2C500+therapist+by+the+Washingtonian+Magazine+asking+them+to+name+the+therapist+they+would+send+a+family+member+to+for+psychotherapy%2C+Dr.+Dalton+was+named+for+the+category+of+best+Cognitive-Behavioral+therapist+in+the+greater+Washington%2C+DC+metro+area.+';
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();
};
