/* [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','4598',jdecode('Home'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','10455',jdecode('News'),jdecode(''),'/10455.html','true',[],'',''],
	['PAGE','10401',jdecode('Unser+Team'),jdecode(''),'/10401.html','true',[],'',''],
	['PAGE','10428',jdecode('Steaks'),jdecode(''),'/10428.html','true',[],'',''],
	['PAGE','180972',jdecode('Vorspeisen'),jdecode(''),'/180972.html','true',[],'',''],
	['PAGE','71502',jdecode('Weinkarte'),jdecode(''),'/71502.html','true',[],'',''],
	['PAGE','5496',jdecode('G%C3%A4stebuch'),jdecode(''),'/5496/index.html','true',[ 
		['PAGE','5495',jdecode('neue+Eintr%C3%A4ge'),jdecode(''),'/5496/5495.html','true',[],'','']
	],'',''],
	['PAGE','10482',jdecode('Jobs'),jdecode(''),'/10482.html','true',[],'',''],
	['PAGE','10509',jdecode('Kontakt'),jdecode(''),'/10509/index.html','true',[ 
		['PAGE','17604',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/10509/17604.html','true',[],'','']
	],'',''],
	['PAGE','72418',jdecode('Voting'),jdecode(''),'/72418.html','true',[],'',''],
	['PAGE','1054825',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/1054825.html','true',[],'',''],
	['PAGE','1054835',jdecode('Anfahrt'),jdecode(''),'/1054835.html','true',[],'',''],
	['PAGE','1060212',jdecode('Eink%C3%A4ufe'),jdecode(''),'/1060212.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Bigcity_NYC';
theSitetree.paletteFamily='7C0B0B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17891';
theSitetree.graphicsetId='13164';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7C0B0B';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_NYC',
				paletteFamily: 	'7C0B0B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17891',
				graphicsetId: 	'13164',
				contentColor: 	'FFFFFF',
				contentBGColor: '7C0B0B',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1060212',
internalId:  '',
customField: '20090811-230001'
};
webappMappings['1002']=webappMappings['1002-5495ABW0X0INX295']={
webappId:    '1002',
documentId:  '5495',
internalId:  '5495ABW0X0INX295',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1007299']={
webappId:    '1501',
documentId:  '4598',
internalId:  '1007299',
customField: '1501'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '4598',
internalId:  '1501',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1054835',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '1054825',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['7005']=webappMappings['7005-71']={
webappId:    '7005',
documentId:  '72418',
internalId:  '71',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20100630-194236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10482',
internalId:  '',
customField: '20100614-193008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1054835',
internalId:  '',
customField: '20080613-201413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1054825',
internalId:  '',
customField: '20090210-214112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10455',
internalId:  '',
customField: '20100630-191015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20100630-184456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10428',
internalId:  '',
customField: '20100614-192316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180972',
internalId:  '',
customField: '20100614-192415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71502',
internalId:  '',
customField: '20100614-192840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5496',
internalId:  '',
customField: '20100614-192859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5495',
internalId:  '',
customField: '20030222-124019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10509',
internalId:  '',
customField: '20100614-193049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17604',
internalId:  '',
customField: '20030226-230337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72418',
internalId:  '',
customField: '20090430-225241'
};
webappMappings['7008']=webappMappings['7008-3841']={
webappId:    '7008',
documentId:  '10509',
internalId:  '3841',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX295';
var companyName   = 'Welcome+-+Steakhouse+Bijou';
var htmlTitle	  = 'Steakhouse+Restaurant+Aargau+Suhr+Steakhouse+Restaurant+Aargau';
var metaKeywords  = 'steakhouse%2CAargau%2CRestaurant%2CSteak%2C+Essen%2C+Bar%2C+Drinks%2C+Grill%2C+Food%2C+Menu%2C+Bier%2C+Wein%2C+Kaffee%2C+USA%2C+Schlemmen%2C+Kochen%2C+Bistro%2C+Switzerland%2C+Mustard%2C+Garlic%2C+Florida%2C+Chicken%2CNew+York%2C+Lady%2C+Bijou%2C+Switzerland%2C+Schweiz%2C+the+best%2CExtra+Film%2CBluewin%2CItunes%2C+Spr%EF%BF%BDngli%2CFleisch%2CGrill%2CUSA%2CMenu%2CMittagessen%2CSpezialit%EF%BF%BDten%2CFam.Weber%2CMetzgerei%2CVorspeisen%2CWein%2CSteakhouse%2CTramstrasse%2CSuhr%2CPoppers%2CFitness%2CFleisch%2CKartoffeln%2CSaucen%2CStrassenkaffee%2CEis%2CRed+Bull%2C';
var metaContents  = 'Steakhouse+Aargau+Restaurant+Aargau+gut+Essen+Aargau+Steaks+in+unserem+Steakhouse+auf+verschiedene+Arten+zubereitet+in+unserem+Restaurant+in+Suhr+Aargau+wo+man+gut+Essen+kann%21';
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();
};
