/* [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','32',jdecode('Home'),jdecode(''), jdecode('%2F32.html'), 'true',[],'',''],
	['PAGE','53',jdecode('Captains+Photo+Gallery'),jdecode(''), jdecode('%2F53.html'), 'true',[],'',''],
	['PAGE','71',jdecode('Contact'),jdecode(''), jdecode('%2F71%2Findex.html'), 'true',[ 
		['PAGE','80',jdecode('Adresses'),jdecode(''), jdecode('%2F71%2F80.html'), 'true',[],'','']
	],'',''],
	['PAGE','89',jdecode('Opening+hours'),jdecode(''), jdecode('%2F89.html'), 'true',[],'',''],
	['PAGE','2981',jdecode('Guestbook'),jdecode(''), jdecode('%2F2981%2Findex.html'), 'true',[ 
		['PAGE','2980',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F2981%2F2980.html'), 'true',[],'','']
	],'',''],
	['PAGE','45741',jdecode('Dinner+Menu'),jdecode(''), jdecode('%2F45741%2Findex.html'), 'true',[ 
		['PAGE','48841',jdecode('Soups%2C+Salads+%26+Raw+bar'),jdecode(''), jdecode('%2F45741%2F48841.html'), 'true',[],'',''],
		['PAGE','48862',jdecode('Appetizers'),jdecode(''), jdecode('%2F45741%2F48862.html'), 'true',[],'',''],
		['PAGE','48883',jdecode('Seafood'),jdecode(''), jdecode('%2F45741%2F48883.html'), 'true',[],'',''],
		['PAGE','45762',jdecode('Bistro+%26+Platters'),jdecode(''), jdecode('%2F45741%2F45762.html'), 'true',[],'',''],
		['PAGE','45804',jdecode('chicken+%26+Steak'),jdecode(''), jdecode('%2F45741%2F45804.html'), 'true',[],'',''],
		['PAGE','49541',jdecode('Pannini%26%23x27%3Bs%2C+Sandwiches+%26+Wraps'),jdecode(''), jdecode('%2F45741%2F49541.html'), 'true',[],'',''],
		['PAGE','49562',jdecode('Kids+Menu'),jdecode(''), jdecode('%2F45741%2F49562.html'), 'true',[],'','']
	],'',''],
	['PAGE','45825',jdecode('Lunch+menu'),jdecode(''), jdecode('%2F45825.html'), 'true',[],'',''],
	['PAGE','15001',jdecode('Specials'),jdecode(''), jdecode('%2F15001%2Findex.html'), 'true',[ 
		['PAGE','15022',jdecode('Coupons'),jdecode(''), jdecode('%2F15001%2F15022.html'), 'true',[],'','']
	],'',''],
	['PAGE','39801',jdecode('Catering+Menu'),jdecode(''), jdecode('%2F39801.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='2167';
theSitetree.keyvisualName='imbiss.jpg';
theSitetree.fontsetId='357';
theSitetree.graphicsetId='408';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'000000',
				keyvisualId: 	'2167',
				keyvisualName: 	'imbiss.jpg',
				fontsetId: 		'357',
				graphicsetId: 	'408',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1850093']={
webappId:    '1501',
documentId:  '32',
internalId:  '1850093',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20081013-094025'
};
webappMappings['1002']=webappMappings['1002-2981AHW050IN3GOW']={
webappId:    '1002',
documentId:  '2981',
internalId:  '2981AHW050IN3GOW',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20091212-142934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20081014-171107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20081014-172736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20080922-121042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2981',
internalId:  '',
customField: '20080329-210854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2980',
internalId:  '',
customField: '20080329-210854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48862',
internalId:  '',
customField: '20110323-065805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48883',
internalId:  '',
customField: '20110323-081419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45804',
internalId:  '',
customField: '20110323-081851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45825',
internalId:  '',
customField: '20110323-084302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45762',
internalId:  '',
customField: '20110323-071603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49541',
internalId:  '',
customField: '20110323-081954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49562',
internalId:  '',
customField: '20110323-082049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45741',
internalId:  '',
customField: '20110323-075416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20110322-145233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15022',
internalId:  '',
customField: '20090822-170015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39801',
internalId:  '',
customField: '20101229-115653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48841',
internalId:  '',
customField: '20110323-085041'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3GOW';
var companyName   = 'Peter%27s+Fishery';
var htmlTitle	  = 'Peters+Fishery';
var metaKeywords  = 'Fishery%2C+Seafood%2C+Bistro%2C+Food%2C+Dinning%2C+Fish%2C+Eatery%2C+Restaurant%2C+Lobster%2C+Clams%2C+Italian%2C+American%2C+International%2C+';
var metaContents  = 'Fishery%2C+Seafood%2C+Bistro%2C+Food%2C+Dinning%2C+Fish%2C+Eatery%2C+Restaurant%2C+Lobster%2C+Clams%2C+Italian%2C+American%2C+International%2C+Seafood';
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();
};

