/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','6401',jdecode('About+DIHN'),jdecode(''),'/6401/index.html','true',[ 
		['PAGE','23143',jdecode('History'),jdecode(''),'/6401/23143.html','true',[],''],
		['PAGE','23164',jdecode('Board+Members'),jdecode(''),'/6401/23164.html','true',[],''],
		['PAGE','23185',jdecode('Staff'),jdecode(''),'/6401/23185.html','true',[],'']
	],''],
	['PAGE','23101',jdecode('DIHN+News'),jdecode(''),'/23101/index.html','true',[ 
		['PAGE','54112',jdecode('Family+news'),jdecode(''),'/23101/54112.html','true',[],''],
		['PAGE','54612',jdecode('Fall+Gala'),jdecode(''),'/23101/54612.html','true',[],''],
		['PAGE','54133',jdecode('Other+happenings'),jdecode(''),'/23101/54133.html','true',[],'']
	],''],
	['PAGE','23332',jdecode('Congregations'),jdecode(''),'/23332/index.html','true',[ 
		['PAGE','23353',jdecode('Responsibilities'),jdecode(''),'/23332/23353.html','true',[],''],
		['PAGE','23374',jdecode('Host+%26+Support+Congregations'),jdecode(''),'/23332/23374.html','true',[],'']
	],''],
	['PAGE','23395',jdecode('How+You+Can+Help'),jdecode(''),'/23395/index.html','true',[ 
		['PAGE','23416',jdecode('Volunteer'),jdecode(''),'/23395/23416.html','true',[],''],
		['PAGE','23437',jdecode('Donate'),jdecode(''),'/23395/23437.html','true',[],''],
		['PAGE','23458',jdecode('Wish+List'),jdecode(''),'/23395/23458.html','true',[],''],
		['PAGE','62512',jdecode('Host+a+fund+raiser'),jdecode(''),'/23395/62512.html','true',[],'']
	],''],
	['PAGE','6422',jdecode('Contact+Us'),jdecode(''),'/6422.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='AD1D1D';
theSitetree.keyvisualId='5841';
theSitetree.keyvisualName='kv_5841.jpg';
theSitetree.fontsetId='11095';
theSitetree.graphicsetId='11868';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Easylife',
				paletteFamily: 	'AD1D1D',
				keyvisualId: 	'5841',
				keyvisualName: 	'kv_5841.jpg',
				fontsetId: 		'11095',
				graphicsetId: 	'11868',
				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:  '5101',
internalId:  '',
customField: '20100307-151812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100130-131525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6422',
internalId:  '',
customField: '20091004-153235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20091218-131811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62512',
internalId:  '',
customField: '20100308-151546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23143',
internalId:  '',
customField: '20091218-102930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54112',
internalId:  '',
customField: '20100307-172748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54612',
internalId:  '',
customField: '20100130-101254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23332',
internalId:  '',
customField: '20091217-193653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23395',
internalId:  '',
customField: '20091220-094618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23164',
internalId:  '',
customField: '20100130-095916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23185',
internalId:  '',
customField: '20100130-144539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54133',
internalId:  '',
customField: '20100307-170758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23353',
internalId:  '',
customField: '20090930-102236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23374',
internalId:  '',
customField: '20100130-133511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23416',
internalId:  '',
customField: '20100130-123312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23437',
internalId:  '',
customField: '20091220-095709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23458',
internalId:  '',
customField: '20091220-095538'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLD9C';
var companyName   = 'Durham+Interfaith+Hospitality+Network';
var htmlTitle	  = 'Durham+Interfaith+Hospitality+Network';
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();
};
