/* [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','1001',jdecode('Home'),jdecode(''), jdecode('%2F1001.html'), 'true',[],'',''],
	['PAGE','117834',jdecode('VALENTINE%26%23x27%3BS+WEEK+-+Special'),jdecode(''), jdecode('%2F117834.html'), 'true',[],'',''],
	['PAGE','1094',jdecode('How+we+Operate'),jdecode(''), jdecode('%2F1094.html'), 'true',[],'',''],
	['PAGE','110334',jdecode('SPECIAL+-+Shared+Thursday'),jdecode(''), jdecode('%2F110334.html'), 'true',[],'',''],
	['PAGE','110355',jdecode('SPECIAL+-+Happy+Hour+Monday'),jdecode(''), jdecode('%2F110355.html'), 'true',[],'',''],
	['PAGE','1115',jdecode('Dinner+Menu'),jdecode(''), jdecode('%2F1115.html'), 'true',[],'',''],
	['PAGE','105034',jdecode('Dessert+Menu'),jdecode(''), jdecode('%2F105034.html'), 'true',[],'',''],
	['PAGE','19101',jdecode('Beverage+Menu'),jdecode(''), jdecode('%2F19101.html'), 'true',[],'',''],
	['PAGE','73697',jdecode('Happy+Hour+Menu'),jdecode(''), jdecode('%2F73697.html'), 'true',[],'',''],
	['PAGE','19122',jdecode('Art+Gallery'),jdecode(''), jdecode('%2F19122.html'), 'true',[],'',''],
	['PAGE','20922',jdecode('Having+a+Party'),jdecode(''), jdecode('%2F20922.html'), 'true',[],'',''],
	['PAGE','1283',jdecode('Press+%26+Comments'),jdecode(''), jdecode('%2F1283.html'), 'true',[],'',''],
	['PAGE','20901',jdecode('Open%3F+or+Close%3F'),jdecode(''), jdecode('%2F20901.html'), 'true',[],'',''],
	['PAGE','76207',jdecode('Weather+%26+Road+Conditions'),jdecode(''), jdecode('%2F76207.html'), 'true',[],'',''],
	['PAGE','1220',jdecode('Contact%2FLocation'),jdecode(''), jdecode('%2F1220.html'), 'true',[],'',''],
	['PAGE','48601',jdecode('Around+Town'),jdecode(''), jdecode('%2F48601.html'), 'true',[],'',''],
	['PAGE','72153',jdecode('E-Mail+List'),jdecode(''), jdecode('%2F72153.html'), 'true',[],'',''],
	['PAGE','1199',jdecode('*+Jobs+Available+-+OPENING'),jdecode(''), jdecode('%2F1199.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1740';
theSitetree.keyvisualName='delikatessen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1740',
				keyvisualName: 	'delikatessen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				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:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1491588']={
webappId:    '1501',
documentId:  '1001',
internalId:  '1491588',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20120103-004143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73697',
internalId:  '',
customField: '20120122-145354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20120103-004249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20111107-140239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20120121-150728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20110906-020419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20120104-014642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110355',
internalId:  '',
customField: '20111005-174530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117834',
internalId:  '',
customField: '20120201-204949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20110727-222042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1283',
internalId:  '',
customField: '20110727-221342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1220',
internalId:  '',
customField: '20100922-235902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20100923-000308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72153',
internalId:  '',
customField: '20091110-201550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1199',
internalId:  '',
customField: '20111201-175607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76207',
internalId:  '',
customField: '20100922-235619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105034',
internalId:  '',
customField: '20120121-154206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110334',
internalId:  '',
customField: '20120104-014722'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE5W8';
var companyName   = 'A+relaxed%2C+friendly%2C+hip+place+...';
var htmlTitle	  = 'Yummy++wine+bar++bistro';
var metaKeywords  = 'wine%2C+bar%2C+bistro%2C+food%2C+music%2C+fun%2C+entertainment%2C+seaside%2C+oregon%2C+yummy%2C+hip%2C+flight%2C+happy+hour%2C+art%2C+low+brow%2C+small+plates%2C+seasonal+menu%2C+dinner%2C+beer%2C+nice%2C+special++';
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();
};

