/* [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','6001',jdecode('Home'),jdecode(''),'/6001.html','true',[],''],
	['PAGE','6052',jdecode('About+us'),jdecode(''),'/6052.html','true',[],''],
	['PAGE','6073',jdecode('Treatment+Services'),jdecode(''),'/6073.html','true',[],''],
	['PAGE','6094',jdecode('Facilities'),jdecode(''),'/6094.html','true',[],''],
	['PAGE','6115',jdecode('Who+We+Are'),jdecode(''),'/6115.html','true',[],''],
	['PAGE','6136',jdecode('Do+I+Need+Help%3F'),jdecode(''),'/6136.html','true',[],''],
	['PAGE','6157',jdecode('Friends+of+P.A.R.C.'),jdecode(''),'/6157.html','true',[],''],
	['PAGE','6178',jdecode('Make+A+Donation'),jdecode(''),'/6178.html','true',[],''],
	['PAGE','6220',jdecode('From+The+Director'),jdecode(''),'/6220.html','false',[],''],
	['PAGE','13101',jdecode('Testimonials'),jdecode(''),'/13101.html','true',[],''],
	['PAGE','6199',jdecode('Contact+Us'),jdecode(''),'/6199.html','true',[],''],
	['PAGE','12301',jdecode('Employee+Log-In'),jdecode(''),'/12301.html','true',[],''],
	['PAGE','11201',jdecode('FAQ'),jdecode(''),'/11201.html','false',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='C9DFEE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10432';
theSitetree.graphicsetId='10771';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F0F2F4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Borders',
				paletteFamily: 	'C9DFEE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10432',
				graphicsetId: 	'10771',
				contentColor: 	'692643',
				contentBGColor: 'F0F2F4',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20091124-184205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6052',
internalId:  '',
customField: '20090714-212359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6220',
internalId:  '',
customField: '20081225-232328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6094',
internalId:  '',
customField: '20090730-113646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6073',
internalId:  '',
customField: '20090714-212537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6115',
internalId:  '',
customField: '20100301-123705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6136',
internalId:  '',
customField: '20081224-210153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6157',
internalId:  '',
customField: '20090404-102630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6178',
internalId:  '',
customField: '20081227-174019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6199',
internalId:  '',
customField: '20100301-124035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20081225-233759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20091020-190808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20100111-131342'
};
webappMappings['1501']=webappMappings['1501-14445586']={
webappId:    '1501',
documentId:  '6001',
internalId:  '14445586',
customField: '1501'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN240T';
var companyName   = 'Peak+Addiction+Recovery+Center';
var htmlTitle	  = 'Peak+Addiction+Recovery+Center';
var metaKeywords  = 'Addiction%2C+Recovery%2C+Wellness%2C+Cessation%2C+Drug%2C+Alcohol%2C+Addict%2C+Addicted%2C+addiction+help%2C+addiction+recovery%2C+addiction+treatment%2C+addiction+treatment+center%2C+addiction+treatment+centers%2C+addiction+treatment+programs%2C+addiction+treatments%2C+alcohol+abuse+treatment%2C+alcohol+addiction+treatment%2C+alcohol+and+drug+addiction+treatment%2C++alcohol+dependency%2C+alcohol+recovery%2C+alcohol+rehab%2C+alcohol+rehab+center%2C+alcohol+rehab+centers%2C+alcohol+rehab+programs%2C+alcohol+rehab+treatment%2C+alcohol+rehabilitation%2C+alcohol+treatment%2C+alcohol+treatment+center%2C+alcohol+treatment+centers%2C+alcohol+treatment+facilities%2C+alcohol+treatment+facility%2C+alcohol+treatment+program%2C+alcohol+treatment+programs%2C+alcohol+treatments%2C+alcoholic%2C+alcoholic+anonymous%2C+alcoholic+drinks%2C+alcoholic+treatment%2C+alcoholic+treatment+center%2C+alcoholics%2C+alcoholism%2C+alcoholism+detox%2C+alcoholism+help%2C+alcoholism+symptoms%2C+alcoholism+treatment%2C+alcoholism+treatments%2C+christian+drug+rehab%2C+cocaine+addiction%2C+cocaine+rehabilitation%2C+Colorado%2C+colorado+springs+co%2C+colorado+springs+Colorado%2C+counseling%2C+crack+cocaine+addiction%2C+denver+Colorado%2C+depression+symptoms%2C+drug++alcohol+treatment%2C+drug+abuse%2C+drug+abuse+rehab%2C+drug+abuse+rehabilitation%2C+drug+abuse+treatment+centers%2C+drug+addict%2C+drug+addiction%2C+drug+addiction+recovery%2C+drug+addiction+rehab%2C+drug+addiction+treatment%2C+drug+addiction+treatment+center%2C+drug+addiction+treatment+centers%2C+drug+alcohol+treatment%2C+drug+and+alcohol+rehab%2C+drug+and+alcohol+rehabilitation+center%2C+drug+and+alcohol+treatment%2C+drug+and+alcohol+treatment+centers%2C+drug+and+alcohol+treatment+facilities%2C+drug+and+alcohol+treatment+program%2C+drug+detox%2C+drug+recovery%2C+drug+rehab%2C+drug+rehab+center%2C+drug+rehab+centers%2C+drug+rehab+clinics%2C+drug+rehab+facilities%2C+drug+rehab+facility%2C+drug+rehab+program%2C+drug+rehab+programs%2C+drug+rehab+treatment%2C+drug+rehabilitation%2C+drug+rehabilitation+centers%2C+drug+rehabilitation+facility%2C+drug+rehabilitation+program%2C+drug+rehabs%2C+drug+test%2C+drug+testing%2C+drug+treatment%2C+drug+treatment+center%2C+drug+treatment+centers%2C+drug+treatment+program%2C+drug+treatment+programs%2C+drugrehab%2C+drugs%2C+help+with+addiction%2C+heroin+rehab%2C+inpatient+alcohol+rehab%2C+inpatient+alcohol+treatment%2C+inpatient+drug+rehab%2C+inpatient+treatment%2C+living+sober%2C+living+with+an+alcoholic%2C+marijuana+addiction+treatment%2C+meth+treatment%2C+meth+treatment+center%2C+methamphetamine%2C+outpatient+drug+rehab%2C+pikes+peak%2C+pill+addiction%2C+quit+drinking%2C+recovery+services%2C+rehab%2C+rehab+center%2C+rehab+centers%2C+rehab+clinic%2C+rehab+clinics%2C+rehabilitation%2C+rehabilitation%2C+rehabilitation+center%2C+rehabilitation+centers%2C+rehabs%2C+residential%2C+residential+drug+treatment+centers%2C+residential+drug+treatment+program%2C+residential+treatment%2C+residential+treatment+center%2C+residential+treatment+centers%2C+residential+treatment+facility%2C+spring%2C+springs%2C+substance+abuse+clinics%2C+substance+abuse+rehab%2C+substance+abuse+treatment%2C+substance+abuse+treatment+centers%2C+treatment%2C+treatment+center%2C+treatment+centers%2C+treatment+for+alcohol%2C+treatment+for+alcoholism%2C+treatment+for+drug+abuse%2C+treatment+for+drug+addiction%2C+treatments+for+alcoholism%2C+Colorado+drug+rehab%2C+Michael+McKelvey%2C+addiction+rehab%2C+adolescent+drug+treatment%2C+alcohol+addiction+clinics%2C+alcohol+detoxification%2C+alcohol+recovery+programs%2C+alcohol+treatment+centers%2C+alcoholic+help%2C+alcoholism+addiction+treatment%2C+alcoholism+drug+treatment%2C+alcoholism+treatment+center%2C+chemical+addictions+recovery+effort%2C+chemical+dependence+treatment%2C+chemical+dependency+recovery%2C+chemical+dependency+treatment%2C+christian+drug+treatment%2C+clinics+for+alcoholics%2C+drug+abuse+treatment+center%2C+drug+addiction+help%2C+drug+addiction+rehabilitation%2C+drug+alcohol+rehab%2C+drug+and+alcohol%2C+drug+and+alcohol+rehabilitation%2C+drug+dependence+treatment%2C+drug+help%2C+drug+rehab+centre%2C+drug+rehab+treatment+centers%2C+drug+rehabilitation+centre%2C+drug+rehabilitation+programs%2C+drug+rehabilitation+treatment%2C+drug+treatment+centre%2C+drug+treatment+centres%2C+drug+treatment+facilities%2C+drug+treatment+facility%2C+drugs+rehab%2C+heroin+addiction%2C+inpatient+drug+treatment%2C+marijuana+addiction%2C+meth+addiction%2C+outpatient+drug+treatment%2C+peak+addiction+recovery+center%2C+residential+drug+treatment%2C+alcohol+and+drug+abuse+treatment%2C+alcohol+detox%2C+chemical+dependency%2C+cocaine+addiction+treatment%2C+cocaine+rehab%2C+colorado+springs%2C+counseling%2C+heroin+addiction+treatment%2C+';
var metaContents  = 'Peak+Addiction+Recovery+Center+addiction+treatment+Colorado';
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();
};
