/* [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 theSitetree=[ 
	['PAGE','9801',jdecode('Home'),jdecode(''),'/9801.html','true',[],''],
	['PAGE','9852',jdecode('Do+I+need+a+Doula'),jdecode(''),'/9852.html','true',[],''],
	['PAGE','9873',jdecode('Interventions'),jdecode(''),'/9873.html','true',[],''],
	['PAGE','9894',jdecode('Testimonials'),jdecode(''),'/9894.html','true',[],''],
	['PAGE','9915',jdecode('FAQ'),jdecode(''),'/9915.html','true',[],''],
	['PAGE','9936',jdecode('Photo+Gallery'),jdecode(''),'/9936.html','true',[],''],
	['PAGE','9957',jdecode('Resources'),jdecode(''),'/9957.html','true',[],''],
	['PAGE','9978',jdecode('Services'),jdecode(''),'/9978.html','true',[],''],
	['PAGE','9999',jdecode('About+Me'),jdecode(''),'/9999.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='CAB996';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11061';
theSitetree.graphicsetId='11834';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Antique',
				paletteFamily: 	'CAB996',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11061',
				graphicsetId: 	'11834',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'664F23',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20100610-082642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9852',
internalId:  '',
customField: '20100512-163017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9873',
internalId:  '',
customField: '20100428-065759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9894',
internalId:  '',
customField: '20090610-131658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9915',
internalId:  '',
customField: '20100518-151628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9936',
internalId:  '',
customField: '20090610-140852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9957',
internalId:  '',
customField: '20100512-075054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9978',
internalId:  '',
customField: '20100513-071856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9999',
internalId:  '',
customField: '20100511-134528'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9801',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INESSD';
var companyName   = 'The+Blessed+Event+Birth+Doula+Services';
var htmlTitle	  = 'The+Blessed+Event+Birth+Doula+Services';
var metaKeywords  = 'Birth+doula+services%2CUnmedicated+natural+childbirth%2CConnecticut%2C+CT%2Clabor+support%2Cbreastfeeding%2Cpost+partum+care%2CTolland+County%2Cprenatal+support';
var metaContents  = 'Birth+your+baby+in+a+relaxed%2C+calm+setting.+Find+your+natural%2C+inner+strength+to+peacefully+welcome+your+newborn.+You+are+invited+to+learn+how+I+can+help+you+have+a+better+birth.+Contact+me+today%21+Shannon+Kent%2C+certified+labor+birth+doula%2C+serving+in+Tolland+and+Hartford+Counties.';
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();
};
