/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('Menu'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','10501',jdecode('Breakfast'),jdecode(''),'/452/10501.html','true',[],'',''],
		['PAGE','10522',jdecode('Lunch'),jdecode(''),'/452/10522.html','true',[],'',''],
		['PAGE','10543',jdecode('Dinner'),jdecode(''),'/452/10543.html','true',[],'',''],
		['PAGE','10564',jdecode('Kids+%26+Seniors'),jdecode(''),'/452/10564.html','true',[],'',''],
		['PAGE','473',jdecode('Pie+List'),jdecode(''),'/452/473.html','true',[],'','']
	],'',''],
	['PAGE','494',jdecode('Our+Services'),jdecode(''),'/494/index.html','true',[ 
		['PAGE','515',jdecode('Pies+To-Go'),jdecode(''),'/494/515.html','true',[],'',''],
		['PAGE','536',jdecode('Gifts+%26+Hats'),jdecode(''),'/494/536.html','true',[],'',''],
		['PAGE','557',jdecode('Cards+%26+Certificates'),jdecode(''),'/494/557.html','true',[],'',''],
		['PAGE','6501',jdecode('Going+Green'),jdecode(''),'/494/6501.html','true',[],'','']
	],'',''],
	['PAGE','599',jdecode('Our+Community'),jdecode(''),'/599/index.html','true',[ 
		['PAGE','620',jdecode('Fun+Days+Parade+'),jdecode(''),'/599/620.html','true',[],'',''],
		['PAGE','641',jdecode('Pet+Food+Drives'),jdecode(''),'/599/641.html','true',[],'',''],
		['PAGE','6564',jdecode('Links'),jdecode(''),'/599/6564.html','true',[],'','']
	],'',''],
	['PAGE','662',jdecode('Business+Hours'),jdecode(''),'/662/index.html','true',[ 
		['PAGE','683',jdecode('Reservations'),jdecode(''),'/662/683.html','true',[],'',''],
		['PAGE','6585',jdecode('Location'),jdecode(''),'/662/6585.html','true',[],'','']
	],'',''],
	['PAGE','725',jdecode('Job+Opportunities'),jdecode(''),'/725.html','true',[],'',''],
	['PAGE','746',jdecode('Contact+Us'),jdecode(''),'/746.html','true',[],'',''],
	['PAGE','2306',jdecode('Guestbook'),jdecode(''),'/2306/index.html','true',[ 
		['PAGE','2301',jdecode('Read+Guestbook'),jdecode(''),'/2306/2301.html','false',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='4C5C9E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11067';
theSitetree.graphicsetId='11842';
theSitetree.contentColor='FAD7A9';
theSitetree.contentBGColor='6476B8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Boston',
				paletteFamily: 	'4C5C9E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11067',
				graphicsetId: 	'11842',
				contentColor: 	'FAD7A9',
				contentBGColor: '6476B8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-2306ahw050invg86']={
webappId:    '1002',
documentId:  '2306',
internalId:  '2306ahw050invg86',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100629-151420'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6585',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090921-221647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100629-153020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100204-203631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20100629-153250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20090921-225402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090311-145606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20100114-014320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20100113-031349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20100113-051755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20100204-204039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20100317-001655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '683',
internalId:  '',
customField: '20081003-124950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100204-203141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '725',
internalId:  '',
customField: '20081003-124950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '746',
internalId:  '',
customField: '20081003-124950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2306',
internalId:  '',
customField: '20081003-132654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20081003-132654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10522',
internalId:  '',
customField: '20100629-151731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6564',
internalId:  '',
customField: '20081210-030819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6585',
internalId:  '',
customField: '20100317-001924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10543',
internalId:  '',
customField: '20100629-152514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10564',
internalId:  '',
customField: '20100629-152231'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVG86';
var companyName   = 'Hockinson+Cafe+at+Battle+Ground';
var htmlTitle	  = 'Hockinson+Cafe+at+Battle+Ground';
var metaKeywords  = 'Hockinson%2C+Restaurant%2C+Family+Dining%2C+Small+Business%2C+Vancouver%2C+Washington%2C+Homemade+Pies%2C+Brush+Prairie%2C+Food%2C+Battle+Ground%2C+Cafe.';
var metaContents  = 'Restaurant+';
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();
};
