/* [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','10212',jdecode('home'),jdecode(''),'/10212.html','true',[],''],
	['PAGE','10263',jdecode('hours+of+operation'),jdecode(''),'/10263.html','true',[],''],
	['PAGE','10305',jdecode('lunch+menu'),jdecode(''),'/10305.html','true',[],''],
	['PAGE','12512',jdecode('dinner+menu'),jdecode(''),'/12512.html','true',[],''],
	['PAGE','10326',jdecode('wine+menu'),jdecode(''),'/10326.html','true',[],''],
	['PAGE','12533',jdecode('banquets+and+catering'),jdecode(''),'/12533/index.html','true',[ 
		['PAGE','12554',jdecode('indoor+dining'),jdecode(''),'/12533/12554.html','true',[],''],
		['PAGE','12575',jdecode('patio+dining'),jdecode(''),'/12533/12575.html','true',[],''],
		['PAGE','12596',jdecode('reservations'),jdecode(''),'/12533/12596.html','true',[],'']
	],''],
	['PAGE','10284',jdecode('contact'),jdecode(''),'/10284.html','true',[],''],
	['PAGE','10431',jdecode('how+to+find+us'),jdecode(''),'/10431.html','true',[],''],
	['PAGE','10452',jdecode('about+us'),jdecode(''),'/10452/index.html','true',[ 
		['PAGE','10473',jdecode('our+team'),jdecode(''),'/10452/10473.html','true',[],''],
		['PAGE','10494',jdecode('our+general+manager'),jdecode(''),'/10452/10494.html','true',[],'']
	],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Sober';
theSitetree.paletteFamily='D3A42A';
theSitetree.keyvisualId='3478';
theSitetree.keyvisualName='kv_3478.jpg';
theSitetree.fontsetId='10757';
theSitetree.graphicsetId='10788';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F4F8D4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Sober',
				paletteFamily: 	'D3A42A',
				keyvisualId: 	'3478',
				keyvisualName: 	'kv_3478.jpg',
				fontsetId: 		'10757',
				graphicsetId: 	'10788',
				contentColor: 	'000000',
				contentBGColor: 'F4F8D4',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D3A42A',
				e_color: 		'707070',
				f_color: 		'979696',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10212',
internalId:  '',
customField: '20090914-031743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10263',
internalId:  '',
customField: '20090914-031803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10284',
internalId:  '',
customField: '20090522-155509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10305',
internalId:  '',
customField: '20090718-164831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10326',
internalId:  '',
customField: '20090522-163954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10431',
internalId:  '',
customField: '20090522-164553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12533',
internalId:  '',
customField: '20090718-214031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12512',
internalId:  '',
customField: '20090718-165212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10452',
internalId:  '',
customField: '20090513-174804'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10212',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12554',
internalId:  '',
customField: '20090515-163728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12575',
internalId:  '',
customField: '20090515-164047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12596',
internalId:  '',
customField: '20090515-164246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10473',
internalId:  '',
customField: '20090914-031412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10494',
internalId:  '',
customField: '20090914-031341'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEKJD';
var companyName   = 'beech+street+pizzeria%7Ecafe+';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
