/* [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','1601',jdecode('Home'),jdecode(''),'/1601.html','true',[],'',''],
	['PAGE','3401',jdecode('Dr.+Kelly+Barclay'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','3422',jdecode('Dr.+Lee+Blackwell'),jdecode(''),'/3422.html','true',[],'',''],
	['PAGE','1652',jdecode('Links'),jdecode(''),'/1652.html','true',[],'',''],
	['PAGE','6101',jdecode('Considering+Divorce%3F'),jdecode(''),'/6101.html','true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Meta';
theSitetree.paletteFamily='72A7D3';
theSitetree.keyvisualId='11305';
theSitetree.keyvisualName='kv_11305.jpg';
theSitetree.fontsetId='31993';
theSitetree.graphicsetId='13826';
theSitetree.contentColor='020202';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Meta',
				paletteFamily: 	'72A7D3',
				keyvisualId: 	'11305',
				keyvisualName: 	'kv_11305.jpg',
				fontsetId: 		'31993',
				graphicsetId: 	'13826',
				contentColor: 	'020202',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20101019-184628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1652',
internalId:  '',
customField: '20100326-141919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20101019-185325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3422',
internalId:  '',
customField: '20090517-155657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20090529-135749'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2VO5';
var companyName   = 'Kelly+Barclay%2C+Psy.D.+%26+Lee+Blackwell%2C+Ph.D.';
var htmlTitle	  = '';
var metaKeywords  = 'women%2C+children%2C+childless%2C+adolescent%2C+adolescents%2C+woman%2C+man%2C+men%2C+child%2C+fertility%2C+sperm+count%2C+addiction%2C+sexual+addiction%2C+psychotherapy%2C+therapy%2C+sex%2C+libido%2C+vagina%2C+penis%2C+pregnant%2C+pregnancy%2C+working%2C+mother%2C+daughter%2C+understanding%2C+depressed%2C+depression%2C+caring%2C+care%2C+anxiety%2C+fear%2C+sadness%2C+rebellion%2C+rebellious%2C+pot%2C+marijuana%2C+video%2C+games%2C+promiscuous%2C+slut%2C+whore%2C+prostitute%2C+porn%2C+pornography%2C+masturbation%2C+anal%2C+vaginismus%2C+painful%2C+intercourse%2C+dyspareunia%2C+erect%2C+erection%2C+erectile%2C+dysfunction%2C+orgasm%2C+meaning%2C+ejaculation%2C+premature%2C+delayed%2C+retarded%2C+desire%2C+low%2C+absent%2C+absentee%2C+absenteeism%2C+molest%2C+molested%2C+molestation%2C+episode%2C+trauma%2C+post%2C+traumatic%2C+stress%2C+disorder%2C+sex+therapy%2C+marital+therapy%2C+marriage+counseling%2C+marriage%2C+birth%2C+miscarriage%2C+phone%2C+caught%2C+police%2C+conviction%2C+convicted%2C+group%2C+group+therapy%2C+mens+group%2C+teen%2C+teens%2C+text%2C+texting%2C+google%2C+yahoo%2C+victim%2C+victims%2C+survivor%2C+survivors%2C+perpetrator%2C+perpetrators%2C+male%2C+female%2C+abuse%2C+abusive%2C+client%2C+patient%2C+adult%2C+individual%2C+psychology%2C+counselor%2C+counseling%2C+treatment%2C+spouse%2C+intimate%2C+gay%2C+straight%2C+bi-sexual%2C+partner%2C+business%2C+right%2C+wrong%2C+fidelity%2C+infidelity%2C+affair%2C+home%2C+wrecker%2C+help%2C+disgust%2C+hurt%2C+anger%2C+painful%2C+lust%2C+love%2C+communication%2C+fornication';
var metaContents  = 'We+are+are+psychologists+with+complimentary+specialties.++Dr.+Barclay+specializes+in+women+and+adolescents%2C+including+women+who+have+chosen+not+to+have+children+or+who+have+not+been+able+to+have+a+child.++Dr.+Blackwell+specializes+in+relationships%2C+especially+sexual+relationships%2C+including+sexual+dysfunctions%2C+sexual+addiction%2C+and+desire+discrepancies.++He+also+runs+a+group+for+men+molested+as+children.';
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();
};

