/* [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','76',jdecode('Home'),jdecode(''),'/76.html','true',[],'',''],
	['PAGE','97',jdecode('About+us'),jdecode(''),'/97.html','true',[],'',''],
	['PAGE','68437',jdecode('Suicide+and+Depression'),jdecode(''),'/68437.html','true',[],'',''],
	['PAGE','73437',jdecode('Elders+and+Depression'),jdecode(''),'/73437.html','true',[],'',''],
	['PAGE','17706',jdecode('Guestbook'),jdecode(''),'/17706/index.html','true',[ 
		['PAGE','17701',jdecode('Read+Guestbook'),jdecode(''),'/17706/17701.html','true',[],'','']
	],'',''],
	['PAGE','106',jdecode('Client+references'),jdecode(''),'/106.html','true',[],'',''],
	['PAGE','6122',jdecode('Directions'),jdecode(''),'/6122.html','true',[],'',''],
	['PAGE','124',jdecode('Products+BDD+and+Others'),jdecode(''),'/124/index.html','true',[ 
		['PAGE','5731',jdecode('Clothing'),jdecode(''),'/124/5731.html','false',[],'',''],
		['PAGE','5722',jdecode('Posters'),jdecode(''),'/124/5722.html','true',[],'',''],
		['PAGE','5740',jdecode('Books+and+Stuff'),jdecode(''),'/124/5740.html','true',[],'','']
	],'',''],
	['PAGE','25301',jdecode('Contact'),jdecode(''),'/25301.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Astro';
theSitetree.paletteFamily='455B9C';
theSitetree.keyvisualId='3741';
theSitetree.keyvisualName='kv_3741.jpg';
theSitetree.fontsetId='10474';
theSitetree.graphicsetId='10951';
theSitetree.contentColor='455B9C';
theSitetree.contentBGColor='CECF9C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Astro',
				paletteFamily: 	'455B9C',
				keyvisualId: 	'3741',
				keyvisualName: 	'kv_3741.jpg',
				fontsetId: 		'10474',
				graphicsetId: 	'10951',
				contentColor: 	'455B9C',
				contentBGColor: 'CECF9C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'7F7D45',
				e_color: 		'7F7D45',
				f_color: 		'7F7D45',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20090729-112433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76',
internalId:  '',
customField: '20100822-122719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97',
internalId:  '',
customField: '20100514-113558'
};
webappMappings['1501']=webappMappings['1501-116277']={
webappId:    '1501',
documentId:  '76',
internalId:  '116277',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6122',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1002']=webappMappings['1002-17706ahw050inx2xm']={
webappId:    '1002',
documentId:  '17706',
internalId:  '17706ahw050inx2xm',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106',
internalId:  '',
customField: '20100219-112757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124',
internalId:  '',
customField: '20100624-120137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20080501-174221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5731',
internalId:  '',
customField: '20090729-110921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5740',
internalId:  '',
customField: '20091213-142047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6122',
internalId:  '',
customField: '20080323-203144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17706',
internalId:  '',
customField: '20080918-113533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20080918-113533'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '76',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68437',
internalId:  '',
customField: '20100423-100409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73437',
internalId:  '',
customField: '20100424-121514'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2XM';
var companyName   = 'BDD+Training+Associates';
var htmlTitle	  = 'BDD+Training+Associates';
var metaKeywords  = 'community+volunteer+training%2C+Suicide%2C+End+of+life+protocols%2C+non+secure+holding+program%2CSatir+Training%2C+online+Satir%2C+family+maps%2C+process+of+change%2Cpersonal+growth%2C+iceberg%2C+stress%2C+debriefing%2C+holding+facilities%2Cmodel%2C+Mandala%2CSteve+Buckbee%2C+Daniel+Doyle%2CMichael+Dupont%2CEscanaba+Michigan%2C+Satir+training%2C+Satir+therapy%2Ctransformational+psychology%2Cpersonal+growth%2C+family+enrichment%2C+caring+for+the+care+giver%2C+substance+abuse+and+family.';
var metaContents  = 'We+offer+personal+growth+training+and+skill+enrichment+programs.++Much+of+the+work+we+have+done+in+the+last+twenty+one+years+has+been+focused+on+keynote+motivational+speaking+regarding+the+diversity+and+uniqueness+of+humans+and+the+systems+in+which+they+live+and+work.+Our+multiple+day+programs+are+what+we+do+best.+We+have+done+work+in+many+areas+ranging+from+loss+and+trauma%2C+family+communications%2C+addiction%2C+self+care+for+caregivers%2C+programs+that+train+persons+who+work+with+children+in+crisis+usually+in+community+based+holdover+facilities.++This+work+has+lead+to+programs+for+persons+working+as+first+responders+and+stress.+If+you+review+the+bio+of+our+trainers+you+will+see+a+wide+scope+of+experience+and+training.All+programs+are+designed+for+the+unique+needs+of+the+client.';
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();
};
