/* [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','2301',jdecode('Home'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','2352',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F2352.html'), 'true',[],'',''],
	['PAGE','2373',jdecode('Speisekarte'),jdecode(''), jdecode('%2F2373.html'), 'true',[],'',''],
	['PAGE','2394',jdecode('Unser+Service'),jdecode(''), jdecode('%2F2394%2Findex.html'), 'true',[ 
		['PAGE','2415',jdecode('Partyservice'),jdecode(''), jdecode('%2F2394%2F2415.html'), 'true',[],'',''],
		['PAGE','2436',jdecode('Reservierungen'),jdecode(''), jdecode('%2F2394%2F2436.html'), 'true',[],'','']
	],'',''],
	['PAGE','2457',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F2457.html'), 'true',[],'',''],
	['PAGE','2478',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F2478.html'), 'true',[],'',''],
	['PAGE','3901',jdecode('Links'),jdecode(''), jdecode('%2F3901.html'), 'true',[],'',''],
	['PAGE','5901',jdecode('die+Gastro-Galerie'),jdecode(''), jdecode('%2F5901.html'), 'true',[],'',''],
	['PAGE','9101',jdecode('e+gm%C3%BCetleche+Obe+im+R%C3%B6ssli'),jdecode(''), jdecode('%2F9101.html'), 'true',[],'',''],
	['PAGE','9122',jdecode('R%C3%B6sslifahrten'),jdecode(''), jdecode('%2F9122.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Kochkurs'),jdecode(''), jdecode('%2F15201.html'), 'true',[],'',''],
	['PAGE','12901',jdecode('Routenplaner+zum+R%C3%B6ssli'),jdecode(''), jdecode('%2F12901.html'), 'true',[],'',''],
	['PAGE','12922',jdecode('Lageplan+vom+R%C3%B6ssli'),jdecode(''), jdecode('%2F12922.html'), 'true',[],'',''],
	['PAGE','12501',jdecode('Worte+eines+Sioux-Indianers'),jdecode(''), jdecode('%2F12501.html'), 'true',[],'',''],
	['PAGE','18601',jdecode('Augenblicke'),jdecode(''), jdecode('%2F18601.html'), 'true',[],'',''],
	['PAGE','33201',jdecode('s+Keiser-Ch%C3%B6rli'),jdecode(''), jdecode('%2F33201.html'), 'true',[],'',''],
	['PAGE','37701',jdecode('d+Kl%C3%A4us+vo+Oberbipp'),jdecode(''), jdecode('%2F37701.html'), 'true',[],'',''],
	['PAGE','46801',jdecode('dr+Wenger+Kilian+by+%C3%BCs'),jdecode(''), jdecode('%2F46801.html'), 'true',[],'',''],
	['PAGE','54801',jdecode('Fasnacht+2011'),jdecode(''), jdecode('%2F54801.html'), 'true',[],'',''],
	['PAGE','65601',jdecode('L%C3%B6schzugch%C3%B6rli+Interlaken'),jdecode(''), jdecode('%2F65601.html'), 'true',[],'',''],
	['PAGE','80901',jdecode('ExpoSolar'),jdecode(''), jdecode('%2F80901.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Aliment';
theSitetree.paletteFamily='5375E5';
theSitetree.keyvisualId='8085';
theSitetree.keyvisualName='kv_8085.jpg';
theSitetree.fontsetId='16991';
theSitetree.graphicsetId='12389';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='f3f2f2';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aliment',
				paletteFamily: 	'5375E5',
				keyvisualId: 	'8085',
				keyvisualName: 	'kv_8085.jpg',
				fontsetId: 		'16991',
				graphicsetId: 	'12389',
				contentColor: 	'000000',
				contentBGColor: 'f3f2f2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20120101-145353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20110604-142034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2373',
internalId:  '',
customField: '20110325-193937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2394',
internalId:  '',
customField: '20110519-155542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2436',
internalId:  '',
customField: '20100811-122752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2415',
internalId:  '',
customField: '20100919-175843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2457',
internalId:  '',
customField: '20100912-142051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2478',
internalId:  '',
customField: '20100815-185239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80901',
internalId:  '',
customField: '20120126-233353'
};
webappMappings['1501']=webappMappings['1501-31835862']={
webappId:    '1501',
documentId:  '2301',
internalId:  '31835862',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20110604-142325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20110319-163959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20101012-191930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9122',
internalId:  '',
customField: '20101127-154306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20110604-142837'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '12901',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '12922',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20100817-220101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20100817-220228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20110519-160255'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20110515-162112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33201',
internalId:  '',
customField: '20101127-114442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20101215-095338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20110106-160222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54801',
internalId:  '',
customField: '20110319-165618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65601',
internalId:  '',
customField: '20110403-142900'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INE663';
var companyName   = 'bym+Vreni+%26+Noldi+im+Restaurant+R%C3%B6ssli+z+Oberbipp';
var htmlTitle	  = 'Restaurant+R%C3%B6ssli+Oberbipp';
var metaKeywords  = 'Restaurant+R%C3%B6ssli%2C+Oberbipp%2C+Fisch%2C+Restaurant%2C+R%C3%B6ssli%2C+Fisch+Restaurant%2C+Essen%2C+Hunger%2C+gem%C3%BCtlich%2C+Trinken%2C+Bier%2C+Fischrestaurant%2C+Jura%2C+Juras%C3%BCdfuss%2C+Beiz%2C+Gaststube%2C+Stube%2C+St%C3%BCbli%2C+Gasthof%2C+Bern%2C+Solothurn%2C+Lunch%2C+Snack%2C+Mahlzeit%2C+Menu%2C+Koch%2C+K%C3%BCche%2C+G%C3%A4ste%2C+kochen';
var metaContents  = 'Hier+isst+man+Fisch%2C+Restaurant+R%C3%B6ssli+Oberbipp%2C+Restaurant+R%C3%B6ssli%2C+Oberbipp%2C+Restaurant';
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();
};

