/* [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','5701',jdecode('Home'),jdecode(''),'/5701.html','true',[],''],
	['PAGE','10501',jdecode('About+Us'),jdecode(''),'/10501.html','true',[],''],
	['PAGE','10522',jdecode('Bistro+Menus'),jdecode(''),'/10522/index.html','true',[ 
		['PAGE','10543',jdecode('Lunch'),jdecode(''),'/10522/10543.html','true',[],''],
		['PAGE','14501',jdecode('Dinner'),jdecode(''),'/10522/14501.html','true',[],''],
		['PAGE','10585',jdecode('Dessert'),jdecode(''),'/10522/10585.html','true',[],''],
		['PAGE','10606',jdecode('Wine'),jdecode(''),'/10522/10606.html','true',[],'']
	],''],
	['PAGE','10627',jdecode('Catering'),jdecode(''),'/10627/index.html','true',[ 
		['PAGE','10648',jdecode('Menus'),jdecode(''),'/10627/10648.html','true',[],''],
		['PAGE','10669',jdecode('Venues'),jdecode(''),'/10627/10669.html','true',[],'']
	],''],
	['PAGE','10690',jdecode('Current+Events'),jdecode(''),'/10690.html','true',[],''],
	['PAGE','10711',jdecode('Contact+Us'),jdecode(''),'/10711.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='CECEA9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10571';
theSitetree.graphicsetId='10772';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F3F9FC';
var theTemplate={
				name: 			'Borders',
				paletteFamily: 	'CECEA9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10571',
				graphicsetId: 	'10772',
				contentColor: 	'692643',
				contentBGColor: 'F3F9FC',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100126-182507'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20090716-201327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10522',
internalId:  '',
customField: '20090611-165237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10543',
internalId:  '',
customField: '20091216-201937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10585',
internalId:  '',
customField: '20091216-201907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10606',
internalId:  '',
customField: '20091104-141018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10627',
internalId:  '',
customField: '20091030-134807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10648',
internalId:  '',
customField: '20090716-201945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10669',
internalId:  '',
customField: '20090409-180821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10690',
internalId:  '',
customField: '20100126-182858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10711',
internalId:  '',
customField: '20091030-135042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20091216-200256'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INECJF';
var companyName   = 'all+seasons+';
var htmlTitle	  = 'All+Seasons+Bistro';
var metaKeywords  = 'napa+valley%2C+napa+valley+restaurants%2C+calistoga%2C+calistoga+restaurants%2C+california+cuisine%2C+wine+retail%2C+wine+shop%2C+catering%2C+napa+valley+catering%2C+gourmet%2C+gourmet+restaurants%2C+calistoga+catering%2C+napa+valley+weddings%2C+wedding+planning%2C+wedding+planner%2C+wine+country+wedding%2C+wine+country+restaurants%2C+wine+country+gourmet%2C+special+events%2C+wine+pairing%2C+napa+valley+special+events%2C+food+and+wine+pairing%2C+calistoga+special+events';
var metaContents  = 'napa+valley%2C+napa+valley+restaurants%2C+calistoga%2C+calistoga+restaurants%2C+california+cuisine%2C+wine+retail%2C+wine+shop%2C+catering%2C+napa+valley+catering%2C+gourmet%2C+gourmet+restaurants%2C+calistoga+catering%2C+napa+valley+weddings%2C+wedding+planning%2C+wedding+planner%2C+wine+country+wedding%2C+wine+country+restaurants%2C+wine+country+gourmet%2C+special+events%2C+wine+pairing%2C+napa+valley+special+events%2C+food+and+wine+pairing%2C+calistoga+special+events';
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();
};
