/* [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 theSitetree=[ 
	['PAGE','6201',jdecode('Home+page'),jdecode(''),'/6201.html','true',[],''],
	['PAGE','6252',jdecode('Mental+Health+%2F+Illness'),jdecode(''),'/6252.html','true',[],''],
	['PAGE','7201',jdecode('The+Bio-Medical+Model'),jdecode(''),'/7201.html','true',[],''],
	['PAGE','7243',jdecode('Peer+Services+%26+Treatments'),jdecode(''),'/7243/index.html','true',[ 
		['PAGE','15501',jdecode('Recovery+101'),jdecode(''),'/7243/15501.html','true',[],''],
		['PAGE','15522',jdecode('Anger'),jdecode(''),'/7243/15522.html','true',[],''],
		['PAGE','15543',jdecode('Peer+to+Peer'),jdecode(''),'/7243/15543.html','true',[],''],
		['PAGE','15564',jdecode('WRAP'),jdecode(''),'/7243/15564.html','true',[],''],
		['PAGE','15585',jdecode('Forgiveness'),jdecode(''),'/7243/15585.html','true',[],'']
	],''],
	['PAGE','7222',jdecode('The+Alternative+Views'),jdecode(''),'/7222/index.html','true',[ 
		['PAGE','15606',jdecode('Buddhism+%26+Mental+Health'),jdecode(''),'/7222/15606.html','true',[],''],
		['PAGE','40201',jdecode('Hair+Tissue+Mineral+Analysis'),jdecode(''),'/7222/40201.html','true',[],''],
		['PAGE','15627',jdecode('Energy+Therapies'),jdecode(''),'/7222/15627.html','true',[],''],
		['PAGE','16401',jdecode('Sound+Therapy'),jdecode(''),'/7222/16401.html','true',[],''],
		['PAGE','18401',jdecode('Body+Based'),jdecode(''),'/7222/18401.html','true',[],''],
		['PAGE','18422',jdecode('Diets'),jdecode(''),'/7222/18422.html','true',[],''],
		['PAGE','24101',jdecode('Anorexia'),jdecode(''),'/7222/24101.html','true',[],'']
	],''],
	['PAGE','15711',jdecode(''),jdecode(''),'/15711.html','true',[],''],
	['PAGE','7264',jdecode('The+Future'),jdecode(''),'/7264/index.html','true',[ 
		['PAGE','18443',jdecode('+MHI+Strategic+Plan'),jdecode(''),'/7264/18443.html','true',[],'']
	],''],
	['PAGE','7285',jdecode('Suggested+Readings'),jdecode(''),'/7285.html','true',[],''],
	['PAGE','7306',jdecode('Contact+Us'),jdecode(''),'/7306.html','true',[],''],
	['PAGE','7327',jdecode('Links'),jdecode(''),'/7327.html','true',[],'']];
var siteelementCount=23;
theSitetree.topTemplateName='Dynamic';
theSitetree.paletteFamily='951B1B';
theSitetree.keyvisualId='7583';
theSitetree.keyvisualName='kv_7583.jpg';
theSitetree.fontsetId='16689';
theSitetree.graphicsetId='12232';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Dynamic',
				paletteFamily: 	'951B1B',
				keyvisualId: 	'7583',
				keyvisualName: 	'kv_7583.jpg',
				fontsetId: 		'16689',
				graphicsetId: 	'12232',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20090704-091042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090721-222420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6252',
internalId:  '',
customField: '20090704-095459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7222',
internalId:  '',
customField: '20090613-230847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7243',
internalId:  '',
customField: '20090704-190147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7264',
internalId:  '',
customField: '20090520-023253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7327',
internalId:  '',
customField: '20090708-194928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7285',
internalId:  '',
customField: '20090628-194642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7306',
internalId:  '',
customField: '20090424-075656'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20090704-191315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15522',
internalId:  '',
customField: '20080927-230006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20090628-195359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15585',
internalId:  '',
customField: '20090704-191758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15543',
internalId:  '',
customField: '20090327-141024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15564',
internalId:  '',
customField: '20080415-214623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15606',
internalId:  '',
customField: '20090221-113955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15627',
internalId:  '',
customField: '20090708-194403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18422',
internalId:  '',
customField: '20090531-192955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18443',
internalId:  '',
customField: '20090628-052126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20090708-194612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15711',
internalId:  '',
customField: '20080415-214623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20090531-192513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40201',
internalId:  '',
customField: '20090703-180305'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2N6V';
var companyName   = 'Approach+to+Balance';
var htmlTitle	  = 'APPROACH+TO+BALANCE+-+Journey+to+Wellness';
var metaKeywords  = 'Mental+health%2C+mental+illness%2C+recovery%2C+sound+therapy%2C+tuning+forks%2C+alternatives%2C+alternative+medicine%2C+Buddhism+and+mental+health%2C+the+future+in+mental+health%2C+Mental+Illness+A+Guide+to+Recovery%2C+Recovery+guide%2C+the+brain%2C+grief%2C+nami+peer+to+peer%2C+peer+to+peer%2C+mental+health+advocacy%2C+Presidents+New+Freedom+Comission%2C+neurotransmitters%2C+shamanic%2C+transforming+mental+health%2C+criminal+justice%2C+recovery+101%2C+anger+transformation%2C+Recovery%3A+A+Path+for+Difficult+people%2C+drug+addiction%2C+vibrational+medicine%2C+holistic+medicine%2C+PTSD%2C+BIPOLAR%2C+SCHIZOPHRENIA%2C+DEPRESSION%2C+PERSONALITY+DISORDERS%2C+SCHEMAS%2C+ABANDONMENT%2C+deprivation%2C+subjagation%2C+mistrust%2C+unloveability%2C+exclusion%2C+vulnerability%2C+failure%2C+perfectionism%2C+entitlement%2C+anger%2C+anger+transformation%2C+L.E.A.P.%2C+energy+therapies%2C+herbal+medicine%2C+complementary+treatments%2C+suicide%2C+temporal+lobe%2C+cortex%2C+limbic+area%2C+parietal+lobes%2C+occipital+lobes%2C+hippocampus%2C+amygdala%2C+hypothalamus%2C+thalamus%2C+brain+stem%2C+basal+ganglia%2C+reticular+formation%2C+stress%2C+shock%2C+denial%2C+anger%2C+bargaining%2C+guilt%2C+acceptance%2C+radical+forgiveness%2C+New+Freedom+Comission%2C+Consensus+statement+on+recovery%2C+coping+with+mental+illness%2C+voice%2C+tapes%2C+nightmares%2C+WATSU%2C+meditations%2C+electro+magnetic+field+balancing%2C+reiki%2C+aromatherapy%2C+bach+flower+remedies%2C+diet%2C+marijuania%2C+herbal+medicine%2C+acupuncture%2C+accupressure%2C+chiropratic%2C+newtwork+spinal+analysis%2C+emdr%2C+lymph+drainage+therapy%2Cmassage%2C+reflexology%2C+watsu%2C+yoga%2Ccellular+memory+release%2C+CMR%2C+anorexia%2C+anorexia+treatment%2C+wetsuit+therapy%2C+bipolar%2C+schizophrenia%2Canxiety%2C+peer+mentoring%2C+depression%2C+suicide%2C+alternatives+Convention%2C+Enhancing+Whats+Right%2C+Buddhism+and+mental+health%2C+National+Commission+on+Criminal+Justice%2C+Recovery+101%2C+Anger%2C+Alternative+and+complementary+treatments%2C+alternative+complementary+medicine%2C+energy+therapies%2C+biologically+based+practices%2C+Manipulative+and+body-based+practices%2C+Energy+medicine%2C+Whole+medical+systems+%2C+Hair+tissue+mineral+analysis%2C+HTMA%2C+mercury%2C+calcium%2C+potassium%2Cthyroid%2C+adrenals+++';
var metaContents  = 'Mental+Health%2C+Mental+Illness%2C+Recovery%2C+Alternatives%2C+Alternative+Medicine%2C+Sound+Therapy%2C+Approach+to+Balance%2C+Approach2balance%2C+Alternative+Mental+Health%2C+The+Future+of+Mental+Health%2C+The+Brain%2C+Mental+health+Treatments%2C+Buddhism+and+Mental+Health%2C+anorexia%2C+bipolar%2C+schizophrenia%2Canxiety%2C+peer+mentoring%2C+depression%2C+suicide%2C+Alternatives+convention%2C+Enhancing+Whats+Right%2C+alternative+complementary+medicine%2C+energy+therapies%2C+biologically+based+practices%2C+Manipulative+and+body-based+practices%2C+Energy+medicine%2C+Whole+medical+systems%2C+Hair+tissue+mineral+analysis%2C+HTMA%2C+mercury%2C+calcium%2C+potassium%2Cthyroid%2C+adrenals++';
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();
};
