/* [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','1901',jdecode('Home'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','2301',jdecode('EMDR+%26+CBT+%28Cognitive+Behavioral%29'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2322',jdecode('Transpersonal'),jdecode(''),'/2322.html','true',[],'',''],
	['PAGE','2364',jdecode('Life+Coaching'),jdecode(''),'/2364.html','true',[],'',''],
	['PAGE','2343',jdecode('Eating+Disorders'),jdecode(''),'/2343.html','true',[],'',''],
	['PAGE','2385',jdecode('Addiction'),jdecode(''),'/2385.html','true',[],'',''],
	['PAGE','2406',jdecode('Depression+%26+Anxiety'),jdecode(''),'/2406.html','true',[],'',''],
	['PAGE','2427',jdecode('Trauma+%26+PTSD'),jdecode(''),'/2427.html','true',[],'',''],
	['PAGE','2448',jdecode('About+Me'),jdecode(''),'/2448.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='61926E';
theSitetree.keyvisualId='6902';
theSitetree.keyvisualName='kv_6902.jpg';
theSitetree.fontsetId='11214';
theSitetree.graphicsetId='12037';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='80AF8C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'61926E',
				keyvisualId: 	'6902',
				keyvisualName: 	'kv_6902.jpg',
				fontsetId: 		'11214',
				graphicsetId: 	'12037',
				contentColor: 	'FFFFFF',
				contentBGColor: '80AF8C',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100725-160429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100729-232915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2322',
internalId:  '',
customField: '20100715-200801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2343',
internalId:  '',
customField: '20100715-200855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2364',
internalId:  '',
customField: '20100715-200831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2385',
internalId:  '',
customField: '20100715-200923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2406',
internalId:  '',
customField: '20100729-232935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2427',
internalId:  '',
customField: '20100729-232955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2448',
internalId:  '',
customField: '20100715-201108'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN35DW';
var companyName   = 'Yaji+Tramontini%2C+LMFT+-+Counseling+%26+Therapy';
var htmlTitle	  = 'Yaji+Therapy%3A+EMDR%2C+Eating+Disorders%2C+Addiction%2C+Depression%2C+Anxiety.+Transpersonal+Counseling%2C+Cognitive-Behavioral+%26+Life+Coaching+in+San+Francisco';
var metaKeywords  = 'San+Francisco%2C+counseling%2C+transpersonal%2C+therapy%2C+psychotherapist%2C+MFT%2C+couples%2C+marriage+and++family+therapist%2C+psychotherapy%2C+depression%2C+anxiety%2C+marriage+counselor%2C+adolescent+counselor%2C+addiction%2C+mindfulness%2C+yoga%2C+meditation%2C+Four+Agreements%2C+Power+of+Now%2C+self-esteem%2C+spiritual%2C+psychology%2C+counselor%2C+EMDR%2C+eating+disorders%2C+journeywork%2C+self-esteem%2C+self-confidence%2C+aa%2C+abuse%2C+acoa%2C+addiction%2C+addictions%2C+alcohol%2C+alcoholics%2C+alcoholism%2C+Alcohol+Treatment%2C+angeles%2C+axonal%2C+brain%2C+community%2C+depression%2C+disease%2C+drinking%2C+drug%2C+drug-treatment%2C+drugs%2C+education%2C+genetics%2C+government%2C+health%2C+intervention%2C+medical%2C+medicine%2C+mental%2C+mental+health%2C+mesa%2C+neurology%2C+niaaa%2C+psychology%2C+ptsd%2C+recovery%2C+reference%2C+rehab%2C+research%2C+science%2C+self-help%2C+social+statistics%2C+substance+abuse%2C+therapy%2C+treatment%2C+san+francisco+help%2C+COUNSELING%2C+Psychotherapists';
var metaContents  = 'Counseling++Therapy+in+San+Francisco+-+Addictions+and+Eating+Disorders+Transpersonal++Holistic%2C+EMDR%2C+Cognitive-Behavioral';
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();
};
