/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','5152',jdecode('Menu'),jdecode(''),'/5152.html','true',[],''],
	['PAGE','5173',jdecode('How+to+find+us'),jdecode(''),'/5173.html','true',[],''],
	['PAGE','5215',jdecode('Featured+Artists'),jdecode(''),'/5215/index.html','true',[ 
		['PAGE','32701',jdecode('Mark+Perry'),jdecode(''),'/5215/32701.html','true',[],''],
		['PAGE','28801',jdecode('Chip+Beers'),jdecode(''),'/5215/28801.html','true',[],''],
		['PAGE','23401',jdecode('John+Parker'),jdecode(''),'/5215/23401.html','true',[],''],
		['PAGE','22201',jdecode('Ronnie+Lafferty'),jdecode(''),'/5215/22201.html','true',[],''],
		['PAGE','19101',jdecode('Lara+B.+Sorenson'),jdecode(''),'/5215/19101.html','true',[],''],
		['PAGE','15501',jdecode('Betsy+Krebs'),jdecode(''),'/5215/15501.html','true',[],''],
		['PAGE','13801',jdecode('Kathleen+O%26%23x27%3BDay'),jdecode(''),'/5215/13801.html','true',[],''],
		['PAGE','5236',jdecode('Dannielle+Sullivan'),jdecode(''),'/5215/5236.html','true',[],''],
		['PAGE','5501',jdecode('Kelly+Girard'),jdecode(''),'/5215/5501.html','true',[],''],
		['PAGE','9901',jdecode('Rick+Murtha'),jdecode(''),'/5215/9901.html','true',[],'']
	],''],
	['PAGE','12001',jdecode('Friends+of+Willows+Bistro'),jdecode(''),'/12001.html','true',[],''],
	['PAGE','20301',jdecode('Party+-++Meeting+service'),jdecode(''),'/20301.html','true',[],''],
	['PAGE','24401',jdecode('Readings+at+Willows'),jdecode(''),'/24401.html','true',[],''],
	['PAGE','20701',jdecode('The+Coffee'),jdecode(''),'/20701.html','true',[],''],
	['PAGE','21401',jdecode('Press'),jdecode(''),'/21401.html','true',[],''],
	['PAGE','5257',jdecode('Blog'),jdecode(''),'/5257.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1740';
theSitetree.keyvisualName='delikatessen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FF9393';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1740',
				keyvisualName: 	'delikatessen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FF9393',
				contentBGColor: 'AC2323',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				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['7050']=webappMappings['7050-2344']={
webappId:    '7050',
documentId:  '5257',
internalId:  '2344',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100209-165940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5215',
internalId:  '',
customField: '20100201-154037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20080720-215515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20100202-113004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20080814-151444'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5173',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5236',
internalId:  '',
customField: '20080809-061247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5257',
internalId:  '',
customField: '20080720-224744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20080720-230932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32701',
internalId:  '',
customField: '20100312-000316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20100209-155146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20081030-195452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23401',
internalId:  '',
customField: '20090530-094725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20090106-095056'
};
webappMappings['7060']=webappMappings['7060-44eca50bfc42d3fb7043f1eebddae50a']={
webappId:    '7060',
documentId:  '19101',
internalId:  '44eca50bfc42d3fb7043f1eebddae50a',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090310-151249'
};
webappMappings['7008']=webappMappings['7008-13014']={
webappId:    '7008',
documentId:  '20301',
internalId:  '13014',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20090310-150838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20090310-145652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20100202-111517'
};
webappMappings['7060']=webappMappings['7060-dd096bddf04b6d2ae0e0fb912165214e']={
webappId:    '7060',
documentId:  '22201',
internalId:  'dd096bddf04b6d2ae0e0fb912165214e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20090422-091905'
};
webappMappings['7060']=webappMappings['7060-4c7ad5f11aa587da161078bbafd7969f']={
webappId:    '7060',
documentId:  '28801',
internalId:  '4c7ad5f11aa587da161078bbafd7969f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20091212-101939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20100131-135729'
};
webappMappings['7060']=webappMappings['7060-eda3c18752d2b6760577d852c6d3a067']={
webappId:    '7060',
documentId:  '28801',
internalId:  'eda3c18752d2b6760577d852c6d3a067',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2UEN';
var companyName   = 'Willows+Bistro';
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();
};
