/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','53',jdecode('Captains+Photo+Gallery'),jdecode(''),'/53.html','true',[],''],
	['PAGE','71',jdecode('Contact'),jdecode(''),'/71/index.html','true',[ 
		['PAGE','80',jdecode('Adresses'),jdecode(''),'/71/80.html','true',[],'']
	],''],
	['PAGE','89',jdecode('Opening+hours'),jdecode(''),'/89.html','true',[],''],
	['PAGE','2981',jdecode('Guestbook'),jdecode(''),'/2981/index.html','true',[ 
		['PAGE','2980',jdecode('Read+Guestbook'),jdecode(''),'/2981/2980.html','true',[],'']
	],''],
	['PAGE','13301',jdecode('Dinner+Menu'),jdecode(''),'/13301/index.html','true',[ 
		['PAGE','13322',jdecode('Appetizers'),jdecode(''),'/13301/13322.html','true',[],''],
		['PAGE','31601',jdecode('Soups+%26+Salads'),jdecode(''),'/13301/31601.html','true',[],''],
		['PAGE','31622',jdecode('Fried%2C+Broiled%2C+Sauteed'),jdecode(''),'/13301/31622.html','true',[],''],
		['PAGE','31643',jdecode('Bistro+Menu'),jdecode(''),'/13301/31643.html','true',[],''],
		['PAGE','31664',jdecode('Signature+Dishes'),jdecode(''),'/13301/31664.html','true',[],''],
		['PAGE','13343',jdecode('Not+So+Fishy'),jdecode(''),'/13301/13343.html','true',[],''],
		['PAGE','13364',jdecode('Kids+Menu'),jdecode(''),'/13301/13364.html','true',[],''],
		['PAGE','31685',jdecode('Desserts+%26+Beverages'),jdecode(''),'/13301/31685.html','true',[],'']
	],''],
	['PAGE','15001',jdecode('Specials'),jdecode(''),'/15001/index.html','true',[ 
		['PAGE','15022',jdecode('Coupons'),jdecode(''),'/15001/15022.html','true',[],'']
	],''],
	['PAGE','39801',jdecode('Catering+Menu'),jdecode(''),'/39801.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 theTemplate={
				name: 			'Medium',
				paletteFamily: 	'000000',
				keyvisualId: 	'2167',
				keyvisualName: 	'imbiss.jpg',
				fontsetId: 		'357',
				graphicsetId: 	'408',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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: '20090822-165201'
};
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:  '13301',
internalId:  '',
customField: '20081014-173245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13322',
internalId:  '',
customField: '20081014-173918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20090420-163216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31622',
internalId:  '',
customField: '20090420-165655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31643',
internalId:  '',
customField: '20090420-165736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31664',
internalId:  '',
customField: '20081014-204842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13343',
internalId:  '',
customField: '20081014-204943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13364',
internalId:  '',
customField: '20081014-205103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31685',
internalId:  '',
customField: '20081015-120430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20090822-170618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15022',
internalId:  '',
customField: '20090822-170015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39801',
internalId:  '',
customField: '20081209-073003'
};
var canonHostname = 'wsc-worker01.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();
};
