/* [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','3901',jdecode('Home'),jdecode(''),'/3901.html','true',[],''],
	['PAGE','14801',jdecode('About+us'),jdecode(''),'/14801.html','true',[],''],
	['PAGE','53315',jdecode('Edith+Newman'),jdecode(''),'/53315.html','true',[],''],
	['PAGE','28701',jdecode('The+Path+to+Volunteerism'),jdecode(''),'/28701.html','true',[],''],
	['PAGE','33815',jdecode('The+Dogs+of+War+%26+Just+Go+Along'),jdecode(''),'/33815.html','true',[],''],
	['PAGE','29715',jdecode('For+the+Love+of+Family+%26+Job'),jdecode(''),'/29715.html','true',[],''],
	['PAGE','59815',jdecode('A+History+Lover'),jdecode(''),'/59815.html','true',[],''],
	['PAGE','57215',jdecode('For+the+Benefit+of+Others'),jdecode(''),'/57215.html','true',[],''],
	['PAGE','29736',jdecode('A+Life+of+Service'),jdecode(''),'/29736.html','true',[],''],
	['PAGE','53715',jdecode('Babes+in+Toyland...'),jdecode(''),'/53715.html','true',[],''],
	['PAGE','23501',jdecode('Our+Advertisers'),jdecode(''),'/23501.html','true',[],''],
	['PAGE','56015',jdecode('The+%22Greeters%22'),jdecode(''),'/56015.html','true',[],''],
	['PAGE','56615',jdecode('The+%22Red+Hatters%22'),jdecode(''),'/56615.html','true',[],''],
	['PAGE','58915',jdecode('50+years+fo+Fighting+Fires'),jdecode(''),'/58915.html','true',[],''],
	['PAGE','39315',jdecode('Our+Advertisers2'),jdecode(''),'/39315.html','true',[],''],
	['PAGE','59515',jdecode('Everyone+Knows+the+House'),jdecode(''),'/59515.html','true',[],''],
	['PAGE','37415',jdecode('Links+to+our+friends'),jdecode(''),'/37415.html','true',[],''],
	['PAGE','42115',jdecode('Subscribe+'),jdecode(''),'/42115.html','true',[],''],
	['PAGE','20001',jdecode('Contact'),jdecode(''),'/20001.html','true',[],''],
	['PAGE','22701',jdecode('Testimonials'),jdecode(''),'/22701.html','true',[],''],
	['PAGE','31715',jdecode('advertise+with+us'),jdecode(''),'/31715.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Common';
theSitetree.paletteFamily='E2E2E2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26633';
theSitetree.graphicsetId='13445';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Common',
				paletteFamily: 	'E2E2E2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26633',
				graphicsetId: 	'13445',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20100718-191629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20100528-034623'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20100508-152926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100419-090244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20100704-225000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20100718-193213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29715',
internalId:  '',
customField: '20100620-200352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29736',
internalId:  '',
customField: '20100718-195813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31715',
internalId:  '',
customField: '20100707-120838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33815',
internalId:  '',
customField: '20100620-200253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37415',
internalId:  '',
customField: '20100620-201458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39315',
internalId:  '',
customField: '20100704-224828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42115',
internalId:  '',
customField: '20100508-152800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53315',
internalId:  '',
customField: '20100718-191026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53715',
internalId:  '',
customField: '20100718-203834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56015',
internalId:  '',
customField: '20100704-224438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56615',
internalId:  '',
customField: '20100611-002958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57215',
internalId:  '',
customField: '20100629-124458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58915',
internalId:  '',
customField: '20100620-201728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59515',
internalId:  '',
customField: '20100611-011830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59815',
internalId:  '',
customField: '20100620-200512'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3MPV';
var companyName   = 'Generations+the+Magazine';
var htmlTitle	  = '';
var metaKeywords  = 'magazine+for+seniors%3B+senior+magazine%3B+magazine%3B';
var metaContents  = 'senior+magazine%3B+generationsthemagazine%3Bgenerations+magazine%3B++';
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();
};
