/* [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','5401',jdecode('Home'),jdecode(''),'/5401.html','true',[],'',''],
	['PAGE','5452',jdecode('About+Us'),jdecode(''),'/5452.html','true',[],'',''],
	['PAGE','5473',jdecode('Statement+of+Faith'),jdecode(''),'/5473.html','true',[],'',''],
	['PAGE','5515',jdecode('Our+Staff'),jdecode(''),'/5515.html','true',[],'',''],
	['PAGE','5494',jdecode('Services+and+Fees'),jdecode(''),'/5494.html','true',[],'',''],
	['PAGE','5620',jdecode('The+Counseling+Process'),jdecode(''),'/5620.html','true',[],'',''],
	['PAGE','5641',jdecode('Locations'),jdecode(''),'/5641.html','true',[],'',''],
	['PAGE','5662',jdecode('History'),jdecode(''),'/5662.html','true',[],'',''],
	['PAGE','5683',jdecode('Stories+of+Hope'),jdecode(''),'/5683.html','true',[],'',''],
	['PAGE','5536',jdecode('Lay+Counselor+Training'),jdecode(''),'/5536.html','true',[],'',''],
	['PAGE','5557',jdecode('Seminars'),jdecode(''),'/5557.html','true',[],'',''],
	['PAGE','5704',jdecode('Contact+Us'),jdecode(''),'/5704.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='2962B0';
theSitetree.keyvisualId='5837';
theSitetree.keyvisualName='kv_5837.jpg';
theSitetree.fontsetId='11097';
theSitetree.graphicsetId='11871';
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: 			'Easylife',
				paletteFamily: 	'2962B0',
				keyvisualId: 	'5837',
				keyvisualName: 	'kv_5837.jpg',
				fontsetId: 		'11097',
				graphicsetId: 	'11871',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:  '5401',
internalId:  '',
customField: '20090918-160519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5452',
internalId:  '',
customField: '20090918-165508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5473',
internalId:  '',
customField: '20090918-165741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5494',
internalId:  '',
customField: '20090918-171133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5515',
internalId:  '',
customField: '20090921-154613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5620',
internalId:  '',
customField: '20090918-165142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5536',
internalId:  '',
customField: '20090819-170158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5557',
internalId:  '',
customField: '20090918-145720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5641',
internalId:  '',
customField: '20090918-172358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5662',
internalId:  '',
customField: '20090918-162602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5683',
internalId:  '',
customField: '20090918-163001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5704',
internalId:  '',
customField: '20090918-163902'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INLTFE';
var companyName   = 'Genesis+Counseling+Service';
var htmlTitle	  = 'Genesis+Counseling+Service+-+Christian+Counseling+in+a+Professional+Therapeutic+Setting';
var metaKeywords  = 'Genesis%2C+Genesis+counseling%2C+counseling%2C+Christian%2C+Christian+counseling%2C+counseling+service%2C+biblical%2C+biblical+counseling%2C+Dobson%2C+lay+counseling%2C+depression%2C+depression+counseling%2C+anxiety%2C+marriage%2C+marriage+counseling%2C+Christ%2C+apostle+%2C+holy+spirit%2C+church%2C+church+counseling%2C+pastor%2C+pastoral+counseling%2C+teaching%2C+Christian%2C+teaching%2C+coaching%2C+personal+coaching%2C+executive+coaching%2C+couples%2C+couples+counseling%2C+parenting%2C+parent+teaching%2C+parent+counseling%2C+help%2C+help+fro+problems%2C+professional%2C+professional+counseling%2C+professional+Christian+counseling%2C+pre-marital+counseling%2C+child+counseling%2C+adolescent+problems%2C+teen+counseling%2C+parenting+skills%2C+personal+enhancement%2C+women%E2%80%99s+problems%2C+men%E2%80%99s+problems%2C+addiction%2C+sexual+addiction%2C+loneliness%2C+loss%2C+physical+abuse%2C+sexual+abuse%2C+suicide%2C+suicide+counseling%2C+adult+children+of+alcoholics%2C+codependency%2C+incest%2C+molestation%2C+anger+management%2C+clergy%2C+clergy+counseling%2C+team+building%2C+biblical+truth%2C+tragedy%2C+grief%2C+grief+counseling%2C+committed+Christians%2C+social+workers%2C+psychology%2C+psychologists%2C+therapists%2C+family+therapists%2C+family+therapy%2C+faith%2C+hope%2C+love%2C+Spirit%2C+change%2C+scripture%2C+spiritual+values%2C+prayer%2C+forgiveness%2C+God%2C+bad+habits%2C+stress%2C+pressure%2C+recovery%2C+restoration%2C+adultery%2C+angry+thoughts%2C+dissolution%2C';
var metaContents  = 'Genesis+Counseling+Service+professional+counseling+in+a+chrisistian+environment%2C+professional+counseling%2C+Christian+counseling%2Cmarital+counseling%2C+family+counseling%2C+lay+counseling%2C+lay+counselor+training%2C+therapy%2C+christian+therapy%2C+Genesis%2C+Genesis+counseling%2C+counseling%2C+Christian%2C+Christian+counseling%2C+counseling+service%2C+biblical%2C+biblical+counseling%2C+Dobson%2C+lay+counseling%2C+depression%2C+depression+counseling%2C+anxiety%2C+marriage%2C+marriage+counseling%2C+Christ%2C+apostle+%2C+holy+spirit%2C+church%2C+church+counseling%2C+pastor%2C+pastoral+counseling%2C+teaching%2C+Christian%2C+teaching%2C+coaching%2C+personal+coaching%2C+executive+coaching%2C+couples%2C+couples+counseling%2C+parenting%2C+parent+teaching%2C+parent+counseling%2C+help%2C+help+fro+problems%2C+professional%2C+professional+counseling%2C+professional+Christian+counseling%2C+pre-marital+counseling%2C+child+counseling%2C+adolescent+problems%2C+teen+counseling%2C+parenting+skills%2C+personal+enhancement%2C+women%E2%80%99s+problems%2C+men%E2%80%99s+problems%2C+addiction%2C+sexual+addiction%2C+loneliness%2C+loss%2C+physical+abuse%2C+sexual+abuse%2C+suicide%2C+suicide+counseling%2C+adult+children+of+alcoholics%2C+codependency%2C+incest%2C+molestation%2C+anger+management%2C+clergy%2C+clergy+counseling%2C+team+building%2C+biblical+truth%2C+tragedy%2C+grief%2C+grief+counseling%2C+committed+Christians%2C+social+workers%2C+psychology%2C+psychologists%2C+therapists%2C+family+therapists%2C+family+therapy%2C+faith%2C+hope%2C+love%2C+Spirit%2C+change%2C+scripture%2C+spiritual+values%2C+prayer%2C+forgiveness%2C+God%2C+bad+habits%2C+stress%2C+pressure%2C+recovery%2C+restoration%2C+adultery%2C+angry+thoughts%2C+dissolution%2C';
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();
};
