/* [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','1101',jdecode('Home'),jdecode(''),'/1101.html','true',[],'',''],
	['PAGE','1173',jdecode('Individual%2FCouples'),jdecode(''),'/1173.html','true',[],'',''],
	['PAGE','1215',jdecode('Parenting%2FFamily'),jdecode(''),'/1215.html','true',[],'',''],
	['PAGE','1194',jdecode('Play+Therapy'),jdecode(''),'/1194.html','true',[],'',''],
	['PAGE','1152',jdecode('Meet+Me'),jdecode(''),'/1152.html','true',[],'',''],
	['PAGE','1236',jdecode('Office+%2FDirections'),jdecode(''),'/1236.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Shadows';
theSitetree.paletteFamily='C8D4E7';
theSitetree.keyvisualId='1835';
theSitetree.keyvisualName='generationen.jpg';
theSitetree.fontsetId='313';
theSitetree.graphicsetId='369';
theSitetree.contentColor='555555';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Shadows',
				paletteFamily: 	'C8D4E7',
				keyvisualId: 	'1835',
				keyvisualName: 	'generationen.jpg',
				fontsetId: 		'313',
				graphicsetId: 	'369',
				contentColor: 	'555555',
				contentBGColor: 'FFFFFF',
				a_color: 		'C8D4E7',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20090824-125434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1152',
internalId:  '',
customField: '20090826-112527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1173',
internalId:  '',
customField: '20090826-133618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1194',
internalId:  '',
customField: '20090826-110159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1215',
internalId:  '',
customField: '20090826-104053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1236',
internalId:  '',
customField: '20090824-134621'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INZKIP';
var companyName   = 'Elissa+Crist%2C+LMFT+%28954%29+292-1387';
var htmlTitle	  = 'Elissa+Crist%2C+LMFT%2FMarriage+and+Family+Therapist%2FPlay+Therapist';
var metaKeywords  = 'Therapy%2C+individual+therapy%2C+couples+therapy%2C+family+therapy%2C+play+therapy%2C+teens%2C+holistic%2C+parenting%2C+children%2C+counseling%2C+wellness%2C+healthy+coping+skills%2C+anger+management%2C+infertility%2C+anxiety%2C+stress%2C+depression%2C+codependence%2C+gay+and+lesbian+issues%2C+seperation%2C+divorce%2C+stress+management%2C+tools%2C+techniques%2C+experience%2C+Elissa%2C+Streeter%2C+LMFT%2C+Licensed+marriage+and+family+therapist%2C+Fort+Lauderdale%2C+Oakland+Park%2C+Wilton+Manors%2C+Oakland+Park+Blvd.%2C+Lincoln+Road%2C+Washington+Ave%2C+Andrews+Avenue%2C+adolescents%2C+Miami+Beach%2C+Miami%2C+Washington%2C+therapist+in+miami+beach%2C+licensed+marriage+and+family+therapist+in+miami+beach%2C+child+therapist+in+miami+beach%2Cmind%2C+body%2C+spirit%2C+partnerships%2C+change%2C+trauma%2C+broward+county%2C+the+school+board+of+broward+county%2C+sexual+abuse%2C+juveniles%2C+Elissa+Crist%2C+marriage+counselor+in+miami+beach%2C+counselor+in+miami+beach%2C+play+therapist+in+miami+beach%2C+Wilton+Manors%2C+Family+Counseling%2C+Child+Counselor%2C+Borderline%2C+relationships%2C+life+coach';
var metaContents  = 'Elissa+Crist+is+a+Licensed+Marriage+and+Family+Therapist+with+over+8+years+of+experience+in+treating+children%2C+teens%2C+individuals%2C+couples%2C+and+families.';
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();
};
