/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','62',jdecode('Menu'),jdecode(''),'/62/index.html','true',[ 
		['PAGE','5064',jdecode('Specialty+Drinks'),jdecode(''),'/62/5064.html','true',[],'',''],
		['PAGE','4912',jdecode('Breakfast'),jdecode(''),'/62/4912.html','true',[],'',''],
		['PAGE','4921',jdecode('Lunch'),jdecode(''),'/62/4921.html','true',[],'',''],
		['PAGE','4930',jdecode('Take+Home'),jdecode(''),'/62/4930.html','true',[],'',''],
		['PAGE','5868',jdecode('Soup+List'),jdecode(''),'/62/5868.html','true',[],'',''],
		['PAGE','5524',jdecode('Desserts'),jdecode(''),'/62/5524.html','true',[],'','']
	],'',''],
	['PAGE','116',jdecode('Black+Cat+Chef%3F'),jdecode(''),'/116.html','true',[],'',''],
	['PAGE','89',jdecode('Contact+Us'),jdecode(''),'/89.html','true',[],'',''],
	['PAGE','2652',jdecode('Recipes'),jdecode(''),'/2652.html','true',[],'',''],
	['PAGE','5769',jdecode('Music+%26+Events'),jdecode(''),'/5769.html','true',[],'',''],
	['PAGE','11701',jdecode('Meet+the+Staff'),jdecode(''),'/11701.html','true',[],'',''],
	['PAGE','470',jdecode('Guestbook'),jdecode(''),'/470/index.html','true',[ 
		['PAGE','469',jdecode('Read+Guestbook'),jdecode(''),'/470/469.html','false',[],'','']
	],'',''],
	['PAGE','3752',jdecode('Directions'),jdecode(''),'/3752.html','true',[],'',''],
	['PAGE','6146',jdecode('Publicity%21'),jdecode(''),'/6146.html','true',[],'',''],
	['PAGE','13801',jdecode('Le+Chats'),jdecode(''),'/13801.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10561',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20071023-221640'
};
webappMappings['1002']=webappMappings['1002-470AHW050INX2M0']={
webappId:    '1002',
documentId:  '470',
internalId:  '470AHW050INX2M0',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3752',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100815-162826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5064',
internalId:  '',
customField: '20090707-122525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4912',
internalId:  '',
customField: '20100125-153348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4921',
internalId:  '',
customField: '20100125-154304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4930',
internalId:  '',
customField: '20081201-080835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5868',
internalId:  '',
customField: '20081201-080914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5524',
internalId:  '',
customField: '20081201-080943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20100125-154825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20071110-135753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2652',
internalId:  '',
customField: '20071023-131757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5769',
internalId:  '',
customField: '20100815-162524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20100515-120609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '470',
internalId:  '',
customField: '20070308-023801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '469',
internalId:  '',
customField: '20070308-023801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3752',
internalId:  '',
customField: '20071110-222000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6146',
internalId:  '',
customField: '20090707-123805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20091028-110046'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2M0';
var companyName   = 'Black+Cat+Cafe';
var htmlTitle	  = 'Black+Cat+Chef';
var metaKeywords  = 'Kendall+Farm+Road%3B+Friends+of+Kendall+Farm+Road%3B+CVPS%3B+Vermonters%3B+Legal+Defense+Fund%3B+Sub+Station%3B+Section+248%3B+Stratton+Corp%3B+Winhall%3B+jogging%3B+mountain+views%3B+dirt+road';
var metaContents  = 'Kendall+Farm+Road%3B+Friends+of+Kendall+Farm+Road%3B+CVPS%3B+Vermonters%3B+Legal+Defense+Fund%3B+Sub+Station%3B+Section+248%3B+Stratton+Corp%3B+Winhall%3B+jogging%3B+mountain+views%3B+dirt+road';
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();
};
