/* [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','4101',jdecode('Home'),jdecode(''), jdecode('%2F4101.html'), 'true',[],'',''],
	['PAGE','31929',jdecode('OUR+BLOG%21'),jdecode(''), jdecode('%2F31929.html'), 'true',[],'',''],
	['PAGE','4243',jdecode('Upcoming+Events'),jdecode(''), jdecode('%2F4243.html'), 'true',[],'',''],
	['PAGE','79629',jdecode('Our+Cafeteria+%26+Staff'),jdecode(''), jdecode('%2F79629.html'), 'true',[],'',''],
	['PAGE','20829',jdecode('Our+School+Garden'),jdecode(''), jdecode('%2F20829.html'), 'true',[],'',''],
	['PAGE','74129',jdecode('Farm+to+Classroom'),jdecode(''), jdecode('%2F74129.html'), 'true',[],'',''],
	['PAGE','49129',jdecode('Student+Chef+Competition'),jdecode(''), jdecode('%2F49129.html'), 'true',[],'',''],
	['PAGE','4264',jdecode('Our+Farms'),jdecode(''), jdecode('%2F4264.html'), 'true',[],'',''],
	['PAGE','4201',jdecode('The+Beginning'),jdecode(''), jdecode('%2F4201.html'), 'true',[],'',''],
	['PAGE','4222',jdecode('How+We%26%23x27%3Bre+Doing'),jdecode(''), jdecode('%2F4222.html'), 'true',[],'',''],
	['PAGE','66529',jdecode('Farm+Festival+Event'),jdecode(''), jdecode('%2F66529.html'), 'false',[],'',''],
	['PAGE','4306',jdecode('Donating+%26+Volunteering'),jdecode(''), jdecode('%2F4306.html'), 'true',[],'',''],
	['PAGE','13129',jdecode('Links+%26+News'),jdecode(''), jdecode('%2F13129.html'), 'true',[],'',''],
	['PAGE','4285',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F4285.html'), 'true',[],'',''],
	['PAGE','4327',jdecode('Contact+F2C'),jdecode(''), jdecode('%2F4327.html'), 'true',[],'',''],
	['PAGE','45729',jdecode('Wanted'),jdecode(''), jdecode('%2F45729.html'), 'false',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='E99C2E';
theSitetree.keyvisualId='9691';
theSitetree.keyvisualName='kv_9691.gif';
theSitetree.fontsetId='10662';
theSitetree.graphicsetId='11182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dispose',
				paletteFamily: 	'E99C2E',
				keyvisualId: 	'9691',
				keyvisualName: 	'kv_9691.gif',
				fontsetId: 		'10662',
				graphicsetId: 	'11182',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20120203-140048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20111228-163826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4264',
internalId:  '',
customField: '20111228-163937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4243',
internalId:  '',
customField: '20120203-141000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20111228-163719'
};
webappMappings['7008']=webappMappings['7008-24286']={
webappId:    '7008',
documentId:  '4327',
internalId:  '24286',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4327',
internalId:  '',
customField: '20111228-163444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4306',
internalId:  '',
customField: '20110913-165012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4285',
internalId:  '',
customField: '20111211-181951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13129',
internalId:  '',
customField: '20111110-203502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20829',
internalId:  '',
customField: '20120118-162635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31929',
internalId:  '',
customField: '20111030-145842'
};
webappMappings['7050']=webappMappings['7050-16686']={
webappId:    '7050',
documentId:  '31929',
internalId:  '16686',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45729',
internalId:  '',
customField: '20101019-124737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49129',
internalId:  '',
customField: '20120206-153940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66529',
internalId:  '',
customField: '20110927-130631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74129',
internalId:  '',
customField: '20111207-164105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79629',
internalId:  '',
customField: '20120208-114921'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INV298';
var companyName   = 'The+Orcas+Island+Farm+to+Cafeteria+Program';
var htmlTitle	  = 'The+Orcas+Island+Farm+to+Cafeteria+Program';
var metaKeywords  = 'school+garden%2C+farm+to+school%2C+farm+to+cafeteria%2C+orcas+island%2C+nutrition%2C+food%2C+cooking%2C+eating%2C+farmers%2C+growth%2C+farms%2C+healthy%2C+organic%2C+local+produce%2C+habits%2C+f2c%2C+F2C%2C+community%2C+farming%2C+public+school';
var metaContents  = 'The+Orcas+Island+Farm+to+Cafeteria+Program%2C+Farm+to+Classroom+Project+and+the+School+Garden+provide+a+place+for+its+public+school+students+to+learn+about+food%2C+good+nutrition%2C+sustainability%2C+cooking+and+healthy+eating%2C+as+well+as+provide+an+outdoor+classroom+to+discover+lessons+in+about+every+subject+its+public+school+has+to+offer.';
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();
};

