/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','18601',jdecode('Our+Clients'),jdecode(''),'/18601.html','true',[],''],
	['PAGE','13601',jdecode('About+Us'),jdecode(''),'/13601/index.html','true',[ 
		['PAGE','13622',jdecode('Staff'),jdecode(''),'/13601/13622.html','true',[],''],
		['PAGE','13643',jdecode('Board+of+Directors'),jdecode(''),'/13601/13643.html','true',[],''],
		['PAGE','13664',jdecode('Volunteers'),jdecode(''),'/13601/13664.html','true',[],'']
	],''],
	['PAGE','552',jdecode('Events'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','13706',jdecode('Can+Man'),jdecode(''),'/552/13706.html','true',[],''],
		['PAGE','13685',jdecode('Dine+for+Hunger'),jdecode(''),'/552/13685.html','true',[],''],
		['PAGE','33778',jdecode('DFH+Coupon'),jdecode(''),'/552/33778.html','true',[],''],
		['PAGE','13748',jdecode('Food+Drives'),jdecode(''),'/552/13748.html','true',[],''],
		['PAGE','13727',jdecode('Hunt+for+Hunger'),jdecode(''),'/552/13727.html','true',[],''],
		['PAGE','33326',jdecode('Operation+Back-to-School'),jdecode(''),'/552/33326.html','true',[],'']
	],''],
	['PAGE','573',jdecode('Donate'),jdecode(''),'/573.html','true',[],''],
	['PAGE','28601',jdecode('Employment'),jdecode(''),'/28601.html','true',[],''],
	['PAGE','18622',jdecode('Links'),jdecode(''),'/18622.html','true',[],''],
	['PAGE','32651',jdecode('Photo+Album'),jdecode(''),'/32651.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Care';
theSitetree.paletteFamily='993333';
theSitetree.keyvisualId='213';
theSitetree.keyvisualName='kind_spielt.jpg';
theSitetree.fontsetId='24';
theSitetree.graphicsetId='14';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Care',
				paletteFamily: 	'993333',
				keyvisualId: 	'213',
				keyvisualName: 	'kind_spielt.jpg',
				fontsetId: 		'24',
				graphicsetId: 	'14',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'993333',
				b_color: 		'FFFFCC',
				c_color: 		'000000',
				d_color: 		'6A8493',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090220-210332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090525-181126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20080717-174909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20080926-185943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13622',
internalId:  '',
customField: '20090513-170732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13643',
internalId:  '',
customField: '20080926-185707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13664',
internalId:  '',
customField: '20080717-174829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13706',
internalId:  '',
customField: '20090505-140146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13685',
internalId:  '',
customField: '20090525-181621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13748',
internalId:  '',
customField: '20080717-174630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13727',
internalId:  '',
customField: '20080805-203733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33326',
internalId:  '',
customField: '20080805-203241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090424-181954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28601',
internalId:  '',
customField: '20080717-174017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18622',
internalId:  '',
customField: '20080717-173811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32651',
internalId:  '',
customField: '20080717-173920'
};
webappMappings['1501']=webappMappings['1501-3699904']={
webappId:    '1501',
documentId:  '501',
internalId:  '3699904',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33778',
internalId:  '',
customField: '20090512-134945'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXG8';
var companyName   = 'Investing+in+Human+Dignity';
var htmlTitle	  = 'Emergency+Crisis+Assistance%2C+Cheyenne%2C+Wyoming';
var metaKeywords  = 'emergency+services%2C+food+bank%2C+Cheyenne%2C+Wyoming%2C+volunteers%2C+volunteer%2C+food%2C+assistance%2C+school+supplies%2C+referrals%2C+clothing%2C+household+items%2C+cheyenne%2C+crisis%2C+social+services%2C+volunteer%2C+food+pantry%2C+dine+for+hunger%2C+non-profit%2C+human+services%2C+poverty%2C+food+drives%2C+donations%2C+hunt+for+hunger%2C+day+of+giving%2C+laramie+county';
var metaContents  = 'Cheyenne%2C+Wyomings+only+emergency+services+food+bank.';
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();
};
