/* [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','1701',jdecode('Home'),jdecode(''),'/1701.html','true',[],''],
	['PAGE','4901',jdecode('Asheville'),jdecode(''),'/4901/index.html','true',[ 
		['PAGE','4922',jdecode('July+11-17'),jdecode(''),'/4901/4922.html','true',[],''],
		['PAGE','4943',jdecode('July+18-24'),jdecode(''),'/4901/4943.html','true',[],''],
		['PAGE','6201',jdecode('Bridge+Session'),jdecode(''),'/4901/6201.html','true',[],''],
		['PAGE','23501',jdecode('Lodging'),jdecode(''),'/4901/23501.html','true',[],'']
	],''],
	['PAGE','4964',jdecode('Ithaca'),jdecode(''),'/4964.html','true',[],''],
	['PAGE','4985',jdecode('Sonoma'),jdecode(''),'/4985.html','true',[],''],
	['PAGE','5006',jdecode('Paris'),jdecode(''),'/5006/index.html','true',[ 
		['PAGE','5027',jdecode('Our+French+Site'),jdecode(''),'/5006/5027.html','true',[],''],
		['PAGE','5048',jdecode('Travel+%26+Lodging'),jdecode(''),'/5006/5048.html','true',[],'']
	],''],
	['PAGE','5069',jdecode('Chefs'),jdecode(''),'/5069.html','true',[],''],
	['PAGE','5090',jdecode('Sponsors'),jdecode(''),'/5090.html','true',[],''],
	['PAGE','10601',jdecode('Friends'),jdecode(''),'/10601.html','true',[],''],
	['PAGE','16301',jdecode('Events'),jdecode(''),'/16301.html','true',[],''],
	['PAGE','17501',jdecode('Newsletters'),jdecode(''),'/17501.html','true',[],''],
	['PAGE','5111',jdecode('Press'),jdecode(''),'/5111.html','true',[],''],
	['PAGE','5132',jdecode('Praise'),jdecode(''),'/5132.html','true',[],''],
	['PAGE','5153',jdecode('Photos'),jdecode(''),'/5153.html','true',[],''],
	['PAGE','8301',jdecode('Products'),jdecode(''),'/8301.html','true',[],''],
	['PAGE','15001',jdecode('Gifts'),jdecode(''),'/15001.html','true',[],''],
	['PAGE','5174',jdecode('Register'),jdecode(''),'/5174/index.html','true',[ 
		['PAGE','5195',jdecode('Online'),jdecode(''),'/5174/5195.html','true',[],''],
		['PAGE','5216',jdecode('By+Mail'),jdecode(''),'/5174/5216.html','true',[],''],
		['PAGE','15022',jdecode('Preferences'),jdecode(''),'/5174/15022.html','true',[],'']
	],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='ABC600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32114';
theSitetree.graphicsetId='13925';
theSitetree.contentColor='6e6e6d';
theSitetree.contentBGColor='fbfae8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Plainly',
				paletteFamily: 	'ABC600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32114',
				graphicsetId: 	'13925',
				contentColor: 	'6e6e6d',
				contentBGColor: 'fbfae8',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20100503-082021'
};
webappMappings['7060']=webappMappings['7060-68a7eadc780225964dd35a7f1931db65']={
webappId:    '7060',
documentId:  '5153',
internalId:  '68a7eadc780225964dd35a7f1931db65',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20100212-125511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4964',
internalId:  '',
customField: '20100319-060538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20100523-120922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4922',
internalId:  '',
customField: '20100523-121120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4943',
internalId:  '',
customField: '20100503-075351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5006',
internalId:  '',
customField: '20100503-073606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5027',
internalId:  '',
customField: '20100318-115010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5174',
internalId:  '',
customField: '20100503-080116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20100529-165700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5195',
internalId:  '',
customField: '20100319-063056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5132',
internalId:  '',
customField: '20100216-122256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5111',
internalId:  '',
customField: '20100529-163608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4985',
internalId:  '',
customField: '20100319-060628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5048',
internalId:  '',
customField: '20100404-102439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5069',
internalId:  '',
customField: '20100529-165602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5090',
internalId:  '',
customField: '20100319-061518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5153',
internalId:  '',
customField: '20100218-143007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5216',
internalId:  '',
customField: '20100319-062519'
};
webappMappings['4001']=webappMappings['4001-27405474']={
webappId:    '4001',
documentId:  '8301',
internalId:  '27405474',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20100529-170106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20100319-050337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15022',
internalId:  '',
customField: '20100319-062803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20100413-051132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20100523-121340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20100503-081623'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INVH4C';
var companyName   = 'Seasonal+School+of+Culinary+Arts';
var htmlTitle	  = 'Seasonal+School+of+Culinary+Arts%7EAsheville%2C+Ithaca%2C+Sonoma%2C+Paris';
var metaKeywords  = 'culinary%2C+cooking%2C+vacation%2C+travel%2C+leisure%2C+culinary+vacation%2C+seasonal%2C+local%2C+sustainable%2C+adventure%2C+taste%2C+palate%2C+Asheville%2C+Ithaca%2C+Sonoma%2C+Paris%2C+France%2C+market%2C+health%2C+garden%2C+table%2C+culinary+adventure%2C+food%2C+wine%2C+tasting%2C+gastronomy%2C+gastronome%2C+luxury%2C+simple%2C+succulent%2C+wholesome%2C+healthy+choices%2C+CSA%2C+fresh%2C+mindful%2C+mindfulness%2C+culinary+awareness%2C+culinary+skills%2C+recipes%2C+workshops%2C+innovative%2C+chefs%2C+baking%2C+Swannanoa%2C+Warren+Wilson+College%2C+organic%2C+culinary+tourism';
var metaContents  = 'The+Seasonal+School+of+Culinary+Arts+offers+week-long+hands-on+immersion+in+a+variety+of+culinary+experiences+designed+to+awaken+and+broaden+the+palate%2C+lead+you+closer+to+the+source+of+the+food+you+prepare%2C+and+provide+you+with+a+panoply+of+skills+that+will+help+you+celebrate+the+ordinary+in+extraordinary+fashion.++With+sessions+in+Asheville%2C+Ithaca%2C+Sonoma+and+Paris%2C+youll+find+an+answer+to+every+taste.';
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();
};
