/* [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','22',jdecode('Home'),jdecode(''), jdecode('%2F22.html'), 'true',[],'',''],
	['PAGE','43',jdecode('About+us'),jdecode(''), jdecode('%2F43%2Findex.html'), 'true',[ 
		['PAGE','52',jdecode('The+team'),jdecode(''), jdecode('%2F43%2F52.html'), 'true',[],'','']
	],'',''],
	['PAGE','61',jdecode('Services'),jdecode(''), jdecode('%2F61%2Findex.html'), 'true',[ 
		['PAGE','70',jdecode('Individual+Therapy'),jdecode(''), jdecode('%2F61%2F70.html'), 'true',[],'',''],
		['PAGE','79',jdecode('Marriage+Counseling'),jdecode(''), jdecode('%2F61%2F79.html'), 'true',[],'',''],
		['PAGE','88',jdecode('Group+Therapy'),jdecode(''), jdecode('%2F61%2F88.html'), 'true',[],'','']
	],'',''],
	['PAGE','97',jdecode('Contact'),jdecode(''), jdecode('%2F97.html'), 'true',[],'',''],
	['PAGE','2437',jdecode('Heart%26Soul+Institute'),jdecode(''), jdecode('%2F2437%2Findex.html'), 'true',[ 
		['PAGE','2446',jdecode('Educational+Articles'),jdecode(''), jdecode('%2F2437%2F2446.html'), 'true',[],'','']
	],'',''],
	['PAGE','639',jdecode('Guestbook'),jdecode(''), jdecode('%2F639%2Findex.html'), 'true',[ 
		['PAGE','638',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F639%2F638.html'), 'false',[],'','']
	],'',''],
	['PAGE','481',jdecode('Directions'),jdecode(''), jdecode('%2F481.html'), 'true',[],'',''],
	['PAGE','682',jdecode('Insurance'),jdecode(''), jdecode('%2F682.html'), 'true',[],'',''],
	['PAGE','816',jdecode('Community'),jdecode(''), jdecode('%2F816%2Findex.html'), 'true',[ 
		['PAGE','942',jdecode('Calendar+of+Events'),jdecode(''), jdecode('%2F816%2F942.html'), 'true',[],'','']
	],'',''],
	['PAGE','1006',jdecode('Links'),jdecode(''), jdecode('%2F1006.html'), 'true',[],'',''],
	['PAGE','1397',jdecode('Publications'),jdecode(''), jdecode('%2F1397%2Findex.html'), 'true',[ 
		['PAGE','2329',jdecode('Topics%3A+Relationships%2C+Ethics+'),jdecode(''), jdecode('%2F1397%2F2329.html'), 'true',[],'',''],
		['PAGE','2338',jdecode('Terrorism%2C+Homophobia'),jdecode(''), jdecode('%2F1397%2F2338.html'), 'true',[],'','']
	],'',''],
	['PAGE','1753',jdecode('+++++Childrens+Stories'),jdecode(''), jdecode('%2F1753.html'), 'true',[],'',''],
	['PAGE','1452',jdecode('Photos+and+Fun'),jdecode(''), jdecode('%2F1452.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='AD73CE';
theSitetree.keyvisualId='6862';
theSitetree.keyvisualName='kv_6862.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12033';
theSitetree.contentColor='662F85';
theSitetree.contentBGColor='BD8ADB';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'AD73CE',
				keyvisualId: 	'6862',
				keyvisualName: 	'kv_6862.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12033',
				contentColor: 	'662F85',
				contentBGColor: 'BD8ADB',
				a_color: 		'BD8ADB',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '481',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43',
internalId:  '',
customField: '20061016-183922'
};
webappMappings['1002']=webappMappings['1002-639AHW050INX3WC']={
webappId:    '1002',
documentId:  '639',
internalId:  '639AHW050INX3WC',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '22',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22',
internalId:  '',
customField: '20120104-120357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1006',
internalId:  '',
customField: '20101020-132526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1397',
internalId:  '',
customField: '20110821-154753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1753',
internalId:  '',
customField: '20110404-153549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1452',
internalId:  '',
customField: '20100303-112329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61',
internalId:  '',
customField: '20100505-121255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '816',
internalId:  '',
customField: '20100505-121611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '942',
internalId:  '',
customField: '20100505-121640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '682',
internalId:  '',
customField: '20110330-124926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '639',
internalId:  '',
customField: '20061013-210514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2437',
internalId:  '',
customField: '20100505-121439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97',
internalId:  '',
customField: '20100505-121409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52',
internalId:  '',
customField: '20120203-083800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70',
internalId:  '',
customField: '20070120-215113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79',
internalId:  '',
customField: '20070120-221104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88',
internalId:  '',
customField: '20070120-201253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2446',
internalId:  '',
customField: '20080115-143527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '638',
internalId:  '',
customField: '20061013-210514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '481',
internalId:  '',
customField: '20061013-211446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2329',
internalId:  '',
customField: '20070130-142345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2338',
internalId:  '',
customField: '20070130-142345'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3WC';
var companyName   = 'Heart+%26+Soul+Counseling%2C+LCSW%2C+PC+';
var htmlTitle	  = 'Heart+and+Soul+Counseling';
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();
};

