/* [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','6901',jdecode('Home'),jdecode(''),'/6901.html','true',[],'',''],
	['PAGE','6952',jdecode('Getting+Help'),jdecode(''),'/6952/index.html','true',[ 
		['PAGE','15817',jdecode('Free+Assessment'),jdecode(''),'/6952/15817.html','true',[],'',''],
		['PAGE','6973',jdecode('Evaluation+w%2FReport'),jdecode(''),'/6952/6973.html','true',[],'',''],
		['PAGE','6994',jdecode('Orientation'),jdecode(''),'/6952/6994.html','true',[],'',''],
		['PAGE','7015',jdecode('Confidentiality'),jdecode(''),'/6952/7015.html','true',[],'','']
	],'',''],
	['PAGE','9812',jdecode('A%26D+Treatment'),jdecode(''),'/9812.html','true',[],'',''],
	['PAGE','10112',jdecode('A%26D+Education'),jdecode(''),'/10112.html','true',[],'',''],
	['PAGE','10133',jdecode('Anger+Management'),jdecode(''),'/10133.html','true',[],'',''],
	['PAGE','10154',jdecode('Domestic+Violence'),jdecode(''),'/10154.html','true',[],'',''],
	['PAGE','5301',jdecode('About+us'),jdecode(''),'/5301/index.html','true',[ 
		['PAGE','8112',jdecode('Executive+Director'),jdecode(''),'/5301/8112.html','true',[],'',''],
		['PAGE','8133',jdecode('Director+of+Clinical+Svcs'),jdecode(''),'/5301/8133.html','true',[],'',''],
		['PAGE','8175',jdecode('Addictions+Counselors'),jdecode(''),'/5301/8175.html','true',[],'',''],
		['PAGE','8196',jdecode('Office+Staff'),jdecode(''),'/5301/8196.html','true',[],'','']
	],'',''],
	['PAGE','5001',jdecode('Locations'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','12012',jdecode('Maps'),jdecode(''),'/12012.html','true',[],'',''],
	['PAGE','9912',jdecode('Email+us'),jdecode(''),'/9912.html','true',[],'',''],
	['PAGE','9512',jdecode('Testimonials'),jdecode(''),'/9512.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100403-114915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20090421-100803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6973',
internalId:  '',
customField: '20090421-173235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6994',
internalId:  '',
customField: '20090413-202054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7015',
internalId:  '',
customField: '20090413-203010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6952',
internalId:  '',
customField: '20090421-093104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20090421-095044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8112',
internalId:  '',
customField: '20090421-101421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8133',
internalId:  '',
customField: '20090413-221649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8175',
internalId:  '',
customField: '20100403-115502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8196',
internalId:  '',
customField: '20100403-114456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9512',
internalId:  '',
customField: '20090422-140059'
};
webappMappings['7008']=webappMappings['7008-2896']={
webappId:    '7008',
documentId:  '9912',
internalId:  '2896',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9912',
internalId:  '',
customField: '20090420-172255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9812',
internalId:  '',
customField: '20090421-173759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10112',
internalId:  '',
customField: '20090422-140816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10133',
internalId:  '',
customField: '20090415-154731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10154',
internalId:  '',
customField: '20090421-100610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15817',
internalId:  '',
customField: '20090421-093958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12012',
internalId:  '',
customField: '20090420-171615'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6901',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INL4NT';
var companyName   = 'PRO-ACTIVE+RESOURCES';
var htmlTitle	  = 'Pro-Active+Resources+-+Drug%2FAlcohol+Treatment%2FEducation+and+Individual+Counseling+Center';
var metaKeywords  = 'Drug+and+alcohol+abuse%2C+counseling%2C+PRI%2C+EOP%2C+individual+counseling%2C+domestic+violence%2C+anger+management%2C+drug+counseling%2C+alcohol+education%2C+drug+abuse%2C+alcohol+abuse%2C+alcohol';
var metaContents  = 'Pro-Active+Resources+Private+Counseling+Center';
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();
};

