/* [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','2501',jdecode('Home'),jdecode(''),'/2501.html','true',[],''],
	['PAGE','3001',jdecode('Current+Events'),jdecode(''),'/3001.html','true',[],''],
	['PAGE','3022',jdecode('Stated+Mission'),jdecode(''),'/3022.html','true',[],''],
	['PAGE','16712',jdecode('About+Us'),jdecode(''),'/16712.html','true',[],''],
	['PAGE','3064',jdecode('Related+Links'),jdecode(''),'/3064.html','true',[],''],
	['PAGE','3085',jdecode('Contact+Us'),jdecode(''),'/3085.html','true',[],''],
	['PAGE','3106',jdecode('Brochure'),jdecode(''),'/3106.html','true',[],''],
	['PAGE','3127',jdecode('Donate'),jdecode(''),'/3127.html','true',[],''],
	['PAGE','3148',jdecode('Lokelani+Waihee'),jdecode(''),'/3148.html','true',[],''],
	['PAGE','24012',jdecode('Work+Exchange'),jdecode(''),'/24012.html','true',[],''],
	['PAGE','16733',jdecode('Lokelani+Makawao'),jdecode(''),'/16733.html','true',[],''],
	['PAGE','3169',jdecode('Saori+Weaving'),jdecode(''),'/3169.html','true',[],''],
	['PAGE','3190',jdecode('Newsletter'),jdecode(''),'/3190.html','true',[],''],
	['PAGE','3211',jdecode('In+The+News'),jdecode(''),'/3211.html','true',[],''],
	['PAGE','64612',jdecode('File+Section'),jdecode(''),'/64612.html','true',[],''],
	['PAGE','3232',jdecode('View+Movie'),jdecode(''),'/3232.html','true',[],''],
	['PAGE','41212',jdecode('VOLUNTEER'),jdecode(''),'/41212.html','true',[],''],
	['PAGE','41912',jdecode('Lokelani+Eco+Village'),jdecode(''),'/41912.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Flowers';
theSitetree.paletteFamily='1B5016';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10485';
theSitetree.graphicsetId='11026';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='AEC2AC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Flowers',
				paletteFamily: 	'1B5016',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10485',
				graphicsetId: 	'11026',
				contentColor: 	'000000',
				contentBGColor: 'AEC2AC',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'365F32',
				e_color: 		'365F32',
				f_color: 		'365F32',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20091008-060444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20091120-141320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3232',
internalId:  '',
customField: '20090310-070321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3211',
internalId:  '',
customField: '20091008-055326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16733',
internalId:  '',
customField: '20091120-142136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3022',
internalId:  '',
customField: '20081003-063144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3190',
internalId:  '',
customField: '20100104-032100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3064',
internalId:  '',
customField: '20091008-060650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3085',
internalId:  '',
customField: '20091008-060823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3106',
internalId:  '',
customField: '20081003-061507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3127',
internalId:  '',
customField: '20091008-061006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3148',
internalId:  '',
customField: '20091008-061146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3169',
internalId:  '',
customField: '20080906-162610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16712',
internalId:  '',
customField: '20080906-031719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24012',
internalId:  '',
customField: '20090114-035735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41212',
internalId:  '',
customField: '20090420-180519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41912',
internalId:  '',
customField: '20091008-063204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64612',
internalId:  '',
customField: '20100102-070049'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2DWA';
var companyName   = 'LOKELANI+%60OHANA++++++';
var htmlTitle	  = '';
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();
};
