/* [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','8801',jdecode('Home'),jdecode(''),'/8801.html','true',[],'',''],
	['PAGE','8852',jdecode('Hours'),jdecode(''),'/8852.html','true',[],'',''],
	['PAGE','43648',jdecode('Special+Offers'),jdecode(''),'/43648.html','true',[],'',''],
	['PAGE','43948',jdecode('Events'),jdecode(''),'/43948.html','true',[],'',''],
	['PAGE','9901',jdecode('About+Us'),jdecode(''),'/9901/index.html','true',[ 
		['PAGE','23223',jdecode('Meet+the+%26%23x27%3BNew%26%23x27%3B+Owners'),jdecode(''),'/9901/23223.html','true',[],'','']
	],'',''],
	['PAGE','1152',jdecode('Our+Menu'),jdecode(''),'/1152/index.html','true',[ 
		['PAGE','19612',jdecode('Lunch'),jdecode(''),'/1152/19612.html','true',[],'',''],
		['PAGE','15912',jdecode('Appetizers%2C+Soup%2C+%26+Burgers'),jdecode(''),'/1152/15912.html','true',[],'',''],
		['PAGE','16012',jdecode('Salads+%26+Pasta'),jdecode(''),'/1152/16012.html','true',[],'',''],
		['PAGE','16412',jdecode('Steaks+%26+Entrees'),jdecode(''),'/1152/16412.html','true',[],'',''],
		['PAGE','16612',jdecode('Sides+%26+Kids%26%23x27%3B+Menu'),jdecode(''),'/1152/16612.html','true',[],'',''],
		['PAGE','9401',jdecode('Specials'),jdecode(''),'/1152/9401.html','true',[],'',''],
		['PAGE','11343',jdecode('Desserts'),jdecode(''),'/1152/11343.html','true',[],'','']
	],'',''],
	['PAGE','8873',jdecode('Contact+Us'),jdecode(''),'/8873.html','true',[],'',''],
	['PAGE','39848',jdecode('Guest+Book'),jdecode(''),'/39848.html','true',[],'',''],
	['PAGE','46648',jdecode('Press'),jdecode(''),'/46648.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='CAB996';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11064';
theSitetree.graphicsetId='11834';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antique',
				paletteFamily: 	'CAB996',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11064',
				graphicsetId: 	'11834',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				a_color: 		'664F23',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19612',
internalId:  '',
customField: '20100512-203844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8852',
internalId:  '',
customField: '20100712-220129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8873',
internalId:  '',
customField: '20091115-163609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20091008-224043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1152',
internalId:  '',
customField: '20100506-132409'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '8873',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20090907-122540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23223',
internalId:  '',
customField: '20090629-115432'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '8801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20090907-123212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11343',
internalId:  '',
customField: '20100506-132601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43648',
internalId:  '',
customField: '20100210-104115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15912',
internalId:  '',
customField: '20100506-132506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16012',
internalId:  '',
customField: '20100512-204108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16412',
internalId:  '',
customField: '20100512-204221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16612',
internalId:  '',
customField: '20100210-110748'
};
webappMappings['1501']=webappMappings['1501-4403748']={
webappId:    '1501',
documentId:  '8801',
internalId:  '4403748',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39848',
internalId:  '',
customField: '20090706-093938'
};
webappMappings['1002']=webappMappings['1002-39848ahw050inv7a9']={
webappId:    '1002',
documentId:  '39848',
internalId:  '39848ahw050inv7a9',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43948',
internalId:  '',
customField: '20100712-221124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46648',
internalId:  '',
customField: '20091008-223300'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INV7A9';
var companyName   = 'Farwood+Bar+%26+Grill';
var htmlTitle	  = 'Farwood+Bar+and+Grill';
var metaKeywords  = 'hand+cut+steaks%2C+steak%2C+burgers%2C+pasta%2C+salad%2C+kids+menu%2C+dessert%2C+full+bar%2C+happy+hour%2C+local+ingredients%2C+hospitality%2C+friendly+service%2C+nightly+specials%2C+dinner+specials%2C+lunch%2C+buffet%2C+seafood%2C+fish%2C+appetizers';
var metaContents  = 'A+beautifully+decorated+restaurant+with+equestrian+paintings+on+the+walls%2C+elegant+interiors%2C+and+an+amazing+100+year+old+carved+oak+bar.++Food+offererings+include+hand-cut+steaks%2C+pasta%2C+seafood%2C+main+course+salads%2C+home+made+desserts%2C+and+delicious+nightly+specials.++The+bar+features+nightly+drink+specials+and+happy+hour+from+4%3A00-6%3A00pm.++Open+for+lunch+Monday-Friday%2C+Open+for+dinner+Monday-Saturday.';
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();
};
