/* [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','7801',jdecode('Home'),jdecode(''),'/7801.html','true',[],'',''],
	['PAGE','34401',jdecode('Weekly+Rates'),jdecode(''),'/34401.html','true',[],'',''],
	['PAGE','8443',jdecode('Financial+Planning'),jdecode(''),'/8443.html','true',[],'',''],
	['PAGE','30201',jdecode('Income+Protection'),jdecode(''),'/30201.html','true',[],'',''],
	['PAGE','25501',jdecode('Green+Tip'),jdecode(''),'/25501.html','true',[],'',''],
	['PAGE','13701',jdecode('Retirement+Annuities'),jdecode(''),'/13701.html','true',[],'',''],
	['PAGE','13901',jdecode('Wills+%26+Testaments'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','15401',jdecode('Product+Enhancements'),jdecode(''),'/15401.html','true',[],'',''],
	['PAGE','12901',jdecode('Our+Services+To+You'),jdecode(''),'/12901.html','true',[],'',''],
	['PAGE','19301',jdecode('Freebies'),jdecode(''),'/19301.html','true',[],'',''],
	['PAGE','21501',jdecode('Investment'),jdecode(''),'/21501.html','true',[],'',''],
	['PAGE','22501',jdecode('Property+Valuation'),jdecode(''),'/22501.html','true',[],'',''],
	['PAGE','12922',jdecode('Legacy+Plan'),jdecode(''),'/12922.html','true',[],'',''],
	['PAGE','18901',jdecode('Employ+Me'),jdecode(''),'/18901.html','true',[],'',''],
	['PAGE','8485',jdecode('Links'),jdecode(''),'/8485.html','true',[],'',''],
	['PAGE','8464',jdecode('Tips+%26+Hints'),jdecode(''),'/8464.html','true',[],'',''],
	['PAGE','33901',jdecode('Local+Map'),jdecode(''),'/33901.html','true',[],'',''],
	['PAGE','7852',jdecode('Contact+Us'),jdecode(''),'/7852.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Handout';
theSitetree.paletteFamily='8AAB35';
theSitetree.keyvisualId='11664';
theSitetree.keyvisualName='kv_11664.jpg';
theSitetree.fontsetId='32943';
theSitetree.graphicsetId='13990';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8AAB35';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Handout',
				paletteFamily: 	'8AAB35',
				keyvisualId: 	'11664',
				keyvisualName: 	'kv_11664.jpg',
				fontsetId: 		'32943',
				graphicsetId: 	'13990',
				contentColor: 	'FFFFFF',
				contentBGColor: '8AAB35',
				a_color: 		'FFFFFF',
				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:  '13701',
internalId:  '',
customField: '20091027-111336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20100715-132056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8443',
internalId:  '',
customField: '20091029-124906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20091021-105207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20100212-101518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7852',
internalId:  '',
customField: '20091104-092236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8464',
internalId:  '',
customField: '20100531-133422'
};
webappMappings['7008']=webappMappings['7008-261']={
webappId:    '7008',
documentId:  '7852',
internalId:  '261',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8485',
internalId:  '',
customField: '20091029-135423'
};
webappMappings['1501']=webappMappings['1501-640186']={
webappId:    '1501',
documentId:  '7801',
internalId:  '640186',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20091016-145010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20091021-101434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20091029-120301'
};
webappMappings['7008']=webappMappings['7008-271']={
webappId:    '7008',
documentId:  '18901',
internalId:  '271',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20091030-125913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20100723-152802'
};
webappMappings['7008']=webappMappings['7008-273']={
webappId:    '7008',
documentId:  '21501',
internalId:  '273',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20091030-121806'
};
webappMappings['7008']=webappMappings['7008-274']={
webappId:    '7008',
documentId:  '22501',
internalId:  '274',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20100604-113000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20091217-082205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20100422-111238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34401',
internalId:  '',
customField: '20100719-141351'
};
var canonHostname = 'sitebuilder1.nur4.host-h.net';
var accountId     = 'AHZGE0INXXOJ';
var companyName   = 'FINANCIAL+PLANNERS';
var htmlTitle	  = 'The+Home+of+Trusted+Advice+and+Trusted+Advisors';
var metaKeywords  = '';
var metaContents  = '';
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();
};
