/* [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(''), jdecode('%2F32.html'), 'true',[],'',''],
	['PAGE','62',jdecode('Menu'),jdecode(''), jdecode('%2F62%2Findex.html'), 'true',[ 
		['PAGE','5064',jdecode('Specialty+Drinks'),jdecode(''), jdecode('%2F62%2F5064.html'), 'true',[],'',''],
		['PAGE','4912',jdecode('Breakfast'),jdecode(''), jdecode('%2F62%2F4912.html'), 'true',[],'',''],
		['PAGE','4921',jdecode('Lunch'),jdecode(''), jdecode('%2F62%2F4921.html'), 'true',[],'',''],
		['PAGE','5868',jdecode('Soup+List'),jdecode(''), jdecode('%2F62%2F5868.html'), 'true',[],'',''],
		['PAGE','5524',jdecode('Desserts'),jdecode(''), jdecode('%2F62%2F5524.html'), 'true',[],'','']
	],'',''],
	['PAGE','45601',jdecode('Catering+-+Breakfast'),jdecode(''), jdecode('%2F45601.html'), 'true',[],'',''],
	['PAGE','44701',jdecode('Catering+-+Lunch'),jdecode(''), jdecode('%2F44701.html'), 'true',[],'',''],
	['PAGE','116',jdecode('Black+Cat+Chef%3F'),jdecode(''), jdecode('%2F116.html'), 'true',[],'',''],
	['PAGE','89',jdecode('Contact+Us'),jdecode(''), jdecode('%2F89.html'), 'true',[],'',''],
	['PAGE','2652',jdecode('Recipes'),jdecode(''), jdecode('%2F2652.html'), 'true',[],'',''],
	['PAGE','5769',jdecode('Music+%26+Events'),jdecode(''), jdecode('%2F5769.html'), 'true',[],'',''],
	['PAGE','11701',jdecode('Meet+the+Staff'),jdecode(''), jdecode('%2F11701.html'), 'true',[],'',''],
	['PAGE','470',jdecode('Guestbook'),jdecode(''), jdecode('%2F470%2Findex.html'), 'true',[ 
		['PAGE','469',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F470%2F469.html'), 'false',[],'','']
	],'',''],
	['PAGE','3752',jdecode('Directions'),jdecode(''), jdecode('%2F3752.html'), 'true',[],'',''],
	['PAGE','6146',jdecode('Publicity%21'),jdecode(''), jdecode('%2F6146.html'), 'true',[],'',''],
	['PAGE','13801',jdecode('Le+Chats'),jdecode(''), jdecode('%2F13801.html'), 'true',[],'','']];
var siteelementCount=19;
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 prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
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: '20110502-161403'
};
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: '20110805-081508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5064',
internalId:  '',
customField: '20090707-122525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4912',
internalId:  '',
customField: '20110211-093349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4921',
internalId:  '',
customField: '20110211-093253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45601',
internalId:  '',
customField: '20110503-075650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5868',
internalId:  '',
customField: '20110211-093309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5524',
internalId:  '',
customField: '20110211-093327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20110805-081418'
};
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: '20120103-152426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20110805-081249'
};
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: '20110502-162615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20101116-143327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20110503-074907'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.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();
};

