/* [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','1601',jdecode('Home'),jdecode(''), jdecode('%2F1601.html'), 'true',[],'',''],
	['PAGE','41401',jdecode('Opening+hours'),jdecode(''), jdecode('%2F41401.html'), 'true',[],'',''],
	['PAGE','41601',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F41601.html'), 'true',[],'',''],
	['PAGE','43601',jdecode('Seafood+Specials'),jdecode(''), jdecode('%2F43601.html'), 'true',[],'',''],
	['PAGE','2843',jdecode('menu'),jdecode(''), jdecode('%2F2843%2Findex.html'), 'true',[ 
		['PAGE','2864',jdecode('Appetizers'),jdecode(''), jdecode('%2F2843%2F2864.html'), 'true',[],'',''],
		['PAGE','11201',jdecode('Munchies+menu'),jdecode(''), jdecode('%2F2843%2F11201.html'), 'true',[],'',''],
		['PAGE','2885',jdecode('Soups%2FSalads'),jdecode(''), jdecode('%2F2843%2F2885.html'), 'true',[],'',''],
		['PAGE','2906',jdecode('Lunch+Entrees'),jdecode(''), jdecode('%2F2843%2F2906.html'), 'true',[],'',''],
		['PAGE','12201',jdecode('Lunch+Pastas'),jdecode(''), jdecode('%2F2843%2F12201.html'), 'true',[],'',''],
		['PAGE','7801',jdecode('Dinner+Entrees'),jdecode(''), jdecode('%2F2843%2F7801.html'), 'true',[],'',''],
		['PAGE','12222',jdecode('Dinner+Pastas'),jdecode(''), jdecode('%2F2843%2F12222.html'), 'true',[],'',''],
		['PAGE','7822',jdecode('Sandwiches'),jdecode(''), jdecode('%2F2843%2F7822.html'), 'true',[],'',''],
		['PAGE','10301',jdecode('Wraps'),jdecode(''), jdecode('%2F2843%2F10301.html'), 'true',[],'',''],
		['PAGE','14001',jdecode('Kids+menu%2Fside+items'),jdecode(''), jdecode('%2F2843%2F14001.html'), 'true',[],'',''],
		['PAGE','7843',jdecode('Raw+Bar+Seafood'),jdecode(''), jdecode('%2F2843%2F7843.html'), 'true',[],'','']
	],'',''],
	['PAGE','40701',jdecode('Our+service'),jdecode(''), jdecode('%2F40701%2Findex.html'), 'true',[ 
		['PAGE','40722',jdecode('Catering+Rooms'),jdecode(''), jdecode('%2F40701%2F40722.html'), 'true',[],'',''],
		['PAGE','40764',jdecode('Reservations'),jdecode(''), jdecode('%2F40701%2F40764.html'), 'true',[],'','']
	],'',''],
	['PAGE','13101',jdecode('Holiday+Hours'),jdecode(''), jdecode('%2F13101.html'), 'true',[],'',''],
	['PAGE','16401',jdecode('Catering+Menu'),jdecode(''), jdecode('%2F16401%2Findex.html'), 'true',[ 
		['PAGE','16422',jdecode('Appetizers%2FFinger+foods'),jdecode(''), jdecode('%2F16401%2F16422.html'), 'true',[],'',''],
		['PAGE','16464',jdecode('Main+Dishes'),jdecode(''), jdecode('%2F16401%2F16464.html'), 'true',[],'',''],
		['PAGE','16485',jdecode('Side+Dishes'),jdecode(''), jdecode('%2F16401%2F16485.html'), 'true',[],'',''],
		['PAGE','16506',jdecode('Desserts%2FMisc+'),jdecode(''), jdecode('%2F16401%2F16506.html'), 'true',[],'','']
	],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1740';
theSitetree.keyvisualName='delikatessen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
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: 	'AC2323',
				keyvisualId: 	'1740',
				keyvisualName: 	'delikatessen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20110118-131022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20081024-131916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41401',
internalId:  '',
customField: '20110117-205437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20110125-125617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20090305-121337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20081021-133003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20090305-121627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2906',
internalId:  '',
customField: '20090305-121823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20090305-121913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20090305-124603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12222',
internalId:  '',
customField: '20090305-125004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7822',
internalId:  '',
customField: '20090305-132756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20090305-134256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20081023-181921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7843',
internalId:  '',
customField: '20090305-134627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40701',
internalId:  '',
customField: '20110118-131108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20110117-205118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20110117-114920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16422',
internalId:  '',
customField: '20110117-115743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16464',
internalId:  '',
customField: '20110117-124928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16485',
internalId:  '',
customField: '20110117-131247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16506',
internalId:  '',
customField: '20110117-130905'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-8876483']={
webappId:    '1501',
documentId:  '1601',
internalId:  '8876483',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-073ca55bc8262c3176c0495b6526c3e9']={
webappId:    '7060',
documentId:  '1601',
internalId:  '073ca55bc8262c3176c0495b6526c3e9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40722',
internalId:  '',
customField: '20110117-204415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40764',
internalId:  '',
customField: '20110117-204923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20110117-210353'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVTDN';
var companyName   = 'Finnigan%27s+Cove+Seafood';
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();
};

