/* [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','36101',jdecode('EVALUATIONS'),jdecode(''),'/36101/index.html','true',[ 
		['PAGE','29201',jdecode('Evaluations+Fees'),jdecode(''),'/36101/29201.html','true',[],'',''],
		['PAGE','37601',jdecode('You+will+need...'),jdecode(''),'/36101/37601.html','true',[],'','']
	],'',''],
	['PAGE','38901',jdecode('MINIMAL+RISK+DUI'),jdecode(''),'/38901.html','true',[],'',''],
	['PAGE','39101',jdecode('MODERATE+RISK+DUI'),jdecode(''),'/39101.html','true',[],'',''],
	['PAGE','43701',jdecode('SIGNIFICANT+RISK+DUI'),jdecode(''),'/43701.html','true',[],'',''],
	['PAGE','43722',jdecode('HIGH+RISK+DUI'),jdecode(''),'/43722.html','true',[],'',''],
	['PAGE','43785',jdecode('DUI+PROGRAMS'),jdecode(''),'/43785/index.html','true',[ 
		['PAGE','39501',jdecode('Risk+Education'),jdecode(''),'/43785/39501.html','true',[],'',''],
		['PAGE','43806',jdecode('Early+Intervention'),jdecode(''),'/43785/43806.html','true',[],'',''],
		['PAGE','43827',jdecode('Outpatient+Treatment'),jdecode(''),'/43785/43827.html','true',[],'',''],
		['PAGE','43848',jdecode('Continuing+Care'),jdecode(''),'/43785/43848.html','true',[],'','']
	],'',''],
	['PAGE','67312',jdecode('DMS+PROGRAMS'),jdecode(''),'/67312.html','false',[],'',''],
	['PAGE','43743',jdecode('ANGER+MANAGEMENT'),jdecode(''),'/43743/index.html','true',[ 
		['PAGE','93312',jdecode('About+Anger'),jdecode(''),'/43743/93312.html','true',[],'',''],
		['PAGE','93512',jdecode('Program+Description'),jdecode(''),'/43743/93512.html','true',[],'',''],
		['PAGE','93012',jdecode('Curriculum'),jdecode(''),'/43743/93012.html','false',[],'','']
	],'',''],
	['PAGE','43764',jdecode('DOMESTIC+VIOLENCE'),jdecode(''),'/43764.html','true',[],'',''],
	['PAGE','2036',jdecode('ADMISSIONS'),jdecode(''),'/2036.html','true',[],'',''],
	['PAGE','2078',jdecode('FAQs'),jdecode(''),'/2078.html','true',[],'',''],
	['PAGE','42501',jdecode('ABOUT+US'),jdecode(''),'/42501.html','true',[],'',''],
	['PAGE','11901',jdecode('LINKS'),jdecode(''),'/11901.html','true',[],'',''],
	['PAGE','47001',jdecode('CONTACT+US'),jdecode(''),'/47001.html','true',[],'',''],
	['PAGE','21801',jdecode('WEATHER'),jdecode(''),'/21801.html','true',[],'',''],
	['PAGE','2099',jdecode('JOB+OPPORTUNITIES'),jdecode(''),'/2099.html','true',[],'',''],
	['PAGE','62101',jdecode('test'),jdecode(''),'/62101.html','false',[],'',''],
	['PAGE','62122',jdecode('test+1'),jdecode(''),'/62122.html','false',[],'',''],
	['PAGE','66312',jdecode('DUI+Services'),jdecode(''),'/66312.html','false',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Clean';
theSitetree.paletteFamily='B55555';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33270';
theSitetree.graphicsetId='14154';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clean',
				paletteFamily: 	'B55555',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33270',
				graphicsetId: 	'14154',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'7D4343',
				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:  '43785',
internalId:  '',
customField: '20100629-154050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100629-151810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20100629-152349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20100629-155518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20090731-121555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20090731-140835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20100629-153329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66312',
internalId:  '',
customField: '20090911-130007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20090731-124639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2099',
internalId:  '',
customField: '20090731-141831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39501',
internalId:  '',
customField: '20100629-154231'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['7080']=webappMappings['7080-331']={
webappId:    '7080',
documentId:  '21801',
internalId:  '331',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20090715-203250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93012',
internalId:  '',
customField: '20100813-124429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20100629-152007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39101',
internalId:  '',
customField: '20100629-153422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20100629-151853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43701',
internalId:  '',
customField: '20100629-153854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43827',
internalId:  '',
customField: '20100629-154913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43806',
internalId:  '',
customField: '20100629-154353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43722',
internalId:  '',
customField: '20100629-154003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43848',
internalId:  '',
customField: '20100629-154504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43743',
internalId:  '',
customField: '20100813-152915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43764',
internalId:  '',
customField: '20090730-140125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47001',
internalId:  '',
customField: '20100813-140700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62101',
internalId:  '',
customField: '20090826-121429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62122',
internalId:  '',
customField: '20090817-141836'
};
webappMappings['7050']=webappMappings['7050-2735']={
webappId:    '7050',
documentId:  '62101',
internalId:  '2735',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-910dab9fbf23012073ed0ce5c65e8d1d']={
webappId:    '7060',
documentId:  '62122',
internalId:  '910dab9fbf23012073ed0ce5c65e8d1d',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '67312',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67312',
internalId:  '',
customField: '20090921-140119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93312',
internalId:  '',
customField: '20100813-114355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93512',
internalId:  '',
customField: '20100813-124711'
};
webappMappings['7008']=webappMappings['7008-19090']={
webappId:    '7008',
documentId:  '47001',
internalId:  '19090',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-19091']={
webappId:    '7008',
documentId:  '43743',
internalId:  '19091',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHAZ7';
var companyName   = 'DUI-METROPOLITAN+SERVICES';
var htmlTitle	  = 'Driving+Under+the+Influence+of+Alcohol+or+Drugs%2C+Alcohol+and+Drugs+Evaluations%2C+Risk+Education+Program%2C+Substance+Abuse+treatment.+Intensive+and+Outpatient+Treatment+';
var metaKeywords  = '';
var metaContents  = '';
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();
};

