/* [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','24101',jdecode('Welcome'),jdecode(''),'/24101.html','true',[],'',''],
	['PAGE','24194',jdecode('Calendar'),jdecode(''),'/24194.html','false',[],'',''],
	['PAGE','24215',jdecode('History'),jdecode(''),'/24215/index.html','true',[ 
		['PAGE','24152',jdecode('Mitzvah+day+2009+Event+Descriptions'),jdecode(''),'/24215/24152.html','false',[],'',''],
		['PAGE','24236',jdecode('Mitzvah+Day+2008'),jdecode(''),'/24215/24236.html','false',[],'',''],
		['PAGE','24257',jdecode('Music+Mitzvah+Month'),jdecode(''),'/24215/24257.html','false',[],'',''],
		['PAGE','24278',jdecode('Previous+Activities'),jdecode(''),'/24215/24278.html','true',[],'','']
	],'',''],
	['PAGE','89612',jdecode('Donation+Partners+2011'),jdecode(''),'/89612/index.html','true',[ 
		['PAGE','88612',jdecode('Donate-Who+Needs+What'),jdecode(''),'/89612/88612.html','false',[],'',''],
		['PAGE','86612',jdecode('Mitzvah+Day+Events'),jdecode(''),'/89612/86612.html','false',[],'','']
	],'',''],
	['PAGE','86012',jdecode('Mitzvah+Day+2011'),jdecode(''),'/86012.html','true',[],'',''],
	['PAGE','86033',jdecode('Eco-Film+Festival+2011'),jdecode(''),'/86033.html','true',[],'',''],
	['PAGE','85612',jdecode('Traditional+Registration'),jdecode(''),'/85612.html','false',[],'',''],
	['PAGE','95312',jdecode('Links'),jdecode(''),'/95312.html','true',[],'',''],
	['PAGE','24341',jdecode('Privacy+Policy'),jdecode(''),'/24341.html','true',[],'',''],
	['PAGE','24362',jdecode('Contact+Us'),jdecode(''),'/24362.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Gaudy';
theSitetree.paletteFamily='5C5D96';
theSitetree.keyvisualId='5940';
theSitetree.keyvisualName='kv_5940.jpg';
theSitetree.fontsetId='11113';
theSitetree.graphicsetId='11905';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6E8BCE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Gaudy',
				paletteFamily: 	'5C5D96',
				keyvisualId: 	'5940',
				keyvisualName: 	'kv_5940.jpg',
				fontsetId: 		'11113',
				graphicsetId: 	'11905',
				contentColor: 	'FFFFFF',
				contentBGColor: '6E8BCE',
				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:  '24215',
internalId:  '',
customField: '20110518-083705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20110503-200135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88612',
internalId:  '',
customField: '20110429-165240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89612',
internalId:  '',
customField: '20110418-213325'
};
webappMappings['7008']=webappMappings['7008-609']={
webappId:    '7008',
documentId:  '24362',
internalId:  '609',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-2906374']={
webappId:    '1501',
documentId:  '24101',
internalId:  '2906374',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24152',
internalId:  '',
customField: '20100331-121628'
};
webappMappings['7008']=webappMappings['7008-4038']={
webappId:    '7008',
documentId:  '85612',
internalId:  '4038',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24194',
internalId:  '',
customField: '20090419-130925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24236',
internalId:  '',
customField: '20090330-162707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24257',
internalId:  '',
customField: '20090327-211626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24278',
internalId:  '',
customField: '20110518-090028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95312',
internalId:  '',
customField: '20110505-192043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24341',
internalId:  '',
customField: '20101112-202144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24362',
internalId:  '',
customField: '20110309-220027'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '24101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86612',
internalId:  '',
customField: '20110514-183455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85612',
internalId:  '',
customField: '20110418-192127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86012',
internalId:  '',
customField: '20110415-164611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86033',
internalId:  '',
customField: '20110518-110054'
};
var canonHostname = 'localhost';
var accountId     = 'ANFI10INX3O2';
var companyName   = '++++++++UNITED+IN+SOCIAL+ACTION';
var htmlTitle	  = 'Bayview+Corridor+of+Synagogues-United+in+Social+Action';
var metaKeywords  = 'Volunteer%2C+Social+Action%2C+Advocacy%2C+Community%2C+Partnership%2C+Tikkun%2C+Olam%2C+Act+of+Kindness%2C+Charity';
var metaContents  = 'BayviewCorridor-Partners+in+Social+Action+';
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();
};

