/* [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','4701',jdecode('Home'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','4752',jdecode('About'),jdecode(''),'/4752.html','true',[],'',''],
	['PAGE','4794',jdecode('Tax+Prep+Fees'),jdecode(''),'/4794.html','true',[],'',''],
	['PAGE','4815',jdecode('Life+%26+LTC+Insurance'),jdecode(''),'/4815.html','true',[],'',''],
	['PAGE','18001',jdecode('Divorcing%3F'),jdecode(''),'/18001.html','true',[],'',''],
	['PAGE','4857',jdecode('FAQs'),jdecode(''),'/4857.html','true',[],'',''],
	['PAGE','4899',jdecode('Saving+Money+Blog'),jdecode(''),'/4899.html','true',[],'',''],
	['PAGE','15801',jdecode('%22Plain+English%22+Tax+Tips'),jdecode(''),'/15801.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='006666';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='51';
theSitetree.graphicsetId='53';
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: 			'Easy',
				paletteFamily: 	'006666',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'51',
				graphicsetId: 	'53',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'006666',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-20563']={
webappId:    '7008',
documentId:  '15801',
internalId:  '20563',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-18116']={
webappId:    '7008',
documentId:  '4857',
internalId:  '18116',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100707-130848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4752',
internalId:  '',
customField: '20100614-095401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20100614-095335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4794',
internalId:  '',
customField: '20100721-125930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4815',
internalId:  '',
customField: '20100614-095317'
};
webappMappings['7008']=webappMappings['7008-22565']={
webappId:    '7008',
documentId:  '4701',
internalId:  '22565',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4857',
internalId:  '',
customField: '20100721-130805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20100707-125339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4899',
internalId:  '',
customField: '20091028-140541'
};
webappMappings['7050']=webappMappings['7050-11876']={
webappId:    '7050',
documentId:  '4899',
internalId:  '11876',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-22571']={
webappId:    '7008',
documentId:  '18001',
internalId:  '22571',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-22569']={
webappId:    '7008',
documentId:  '4794',
internalId:  '22569',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-22570']={
webappId:    '7008',
documentId:  '4815',
internalId:  '22570',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4701',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4752',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4794',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4815',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '18001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4857',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4899',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15801',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3XY6';
var companyName   = 'Delfau+Tax+%26+Financial+Services';
var htmlTitle	  = 'Delfau+Tax+%26+Financial+Services%2C+Danbury%2C+CT%2C+Insurance%2C+Tax%2C+Financial+Planning%2C+Flat+Fee%2C+10-Minute+Review%2C+Fairfield+County%2C+women%2C+saving+money';
var metaKeywords  = 'danbury%2C+ridgefield%2C+danbury+ct%2C+ridgefield+ct%2C+life+insurance%2C+life+insurance+review%2C+taxes%2C+tax+preparation%2C+flat+fee%2C+1040%2C+multi-state%2C+CPA%2C++planning%2C+inheritance%2C+tax+preparer%2C+personal+taxes%2C+fairfield+county%2C+whole+life%2C+women%2C+saving+money%2C+turbo-mom%2C+author%2C+fairfield+county%2C+tax+planning%2C+planning%2C+divorce%2C+women%2C+kristin+delfau%2C+kristin%2C+delfau%2C+insurance%2C+permanent+insurance%2C+life+insurance+rescue%2C+beneficiary+assistance%2C+enrolled+agent%2C+insurance+assistance%2C+what+to+do%2C+tax+help%2C+tax+problem';
var metaContents  = 'Delfau+Tax++Financial+Services+-+Danbury++Ridgefield+Flat+Fee+Tax+Preparation+and+Planning+and+Life+Insurance+Review+Solutions';
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();
};
