/* [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','60623',jdecode('Chesed+Store+Home'),jdecode(''),'/60623.html','true',[],''],
	['PAGE','21401',jdecode('Sharing+for+Life'),jdecode(''),'/21401/index.html','true',[ 
		['PAGE','5001',jdecode('Maos+Chitim+Campaign'),jdecode(''),'/21401/5001.html','true',[],''],
		['PAGE','60444',jdecode('Chinese+Auction'),jdecode(''),'/21401/60444.html','true',[],'']
	],''],
	['PAGE','63023',jdecode('Citation'),jdecode(''),'/63023.html','true',[],''],
	['PAGE','11701',jdecode('Chesed+In+Action'),jdecode(''),'/11701.html','true',[],''],
	['PAGE','11901',jdecode('Donate+Now'),jdecode(''),'/11901.html','true',[],''],
	['PAGE','52323',jdecode('Directions'),jdecode(''),'/52323.html','true',[],''],
	['PAGE','7222',jdecode('Contact+Us'),jdecode(''),'/7222.html','true',[],''],
	['PAGE','29123',jdecode('Chinese+Auction'),jdecode(''),'/29123/index.html','false',[ 
		['PAGE','7201',jdecode('Grand+Prize'),jdecode(''),'/29123/7201.html','true',[],''],
		['PAGE','29723',jdecode('%2420+Tickets'),jdecode(''),'/29123/29723.html','true',[],''],
		['PAGE','29744',jdecode('%2410+Tickets'),jdecode(''),'/29123/29744.html','true',[],''],
		['PAGE','29823',jdecode('%245+Tickets'),jdecode(''),'/29123/29823.html','true',[],'']
	],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='2354B7';
theSitetree.keyvisualId='2698';
theSitetree.keyvisualName='blanco.jpg';
theSitetree.fontsetId='10404';
theSitetree.graphicsetId='10633';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C6E2FE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Match',
				paletteFamily: 	'2354B7',
				keyvisualId: 	'2698',
				keyvisualName: 	'blanco.jpg',
				fontsetId: 		'10404',
				graphicsetId: 	'10633',
				contentColor: 	'000000',
				contentBGColor: 'C6E2FE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2354B7',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100420-090705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20100224-094151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7222',
internalId:  '',
customField: '20100207-114533'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '60623',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1056']={
webappId:    '7008',
documentId:  '7222',
internalId:  '1056',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-12db0b992a6dc7dac2a5fe60132ae297']={
webappId:    '7060',
documentId:  '11701',
internalId:  '12db0b992a6dc7dac2a5fe60132ae297',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20100207-114619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100105-063616'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '52323',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29744',
internalId:  '',
customField: '20100224-102839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29723',
internalId:  '',
customField: '20100209-090813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20100209-151256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29123',
internalId:  '',
customField: '20100224-102751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29823',
internalId:  '',
customField: '20100209-090601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52323',
internalId:  '',
customField: '20100224-055434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60623',
internalId:  '',
customField: '20100420-090508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60444',
internalId:  '',
customField: '20100329-072942'
};
webappMappings['7060']=webappMappings['7060-fef8b6fbf9665220a5f05300ff91252f']={
webappId:    '7060',
documentId:  '60444',
internalId:  'fef8b6fbf9665220a5f05300ff91252f',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-c68d55d40c7e6ad0f40d81e802d16b25']={
webappId:    '7060',
documentId:  '63023',
internalId:  'c68d55d40c7e6ad0f40d81e802d16b25',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63023',
internalId:  '',
customField: '20100329-065102'
};
var canonHostname = 'localhost';
var accountId     = 'ANFI10INXLXI';
var companyName   = 'Bnai+Raphael+Chesed+Organization';
var htmlTitle	  = 'Bnai+Raphael+Chesed+Org.';
var metaKeywords  = 'Chesed+Store+Food+Pantry+Bnai+Raphael+Free+Clothing+Free+Food';
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();
};
