/* [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','4655',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/4655.html','true',[],'',''],
	['PAGE','4682',jdecode('R%C3%A4umlichkeiten'),jdecode(''),'/4682.html','true',[],'',''],
	['PAGE','4709',jdecode('Speisekarte'),jdecode(''),'/4709.html','true',[],'',''],
	['PAGE','4736',jdecode('G%C3%A4stezimmer'),jdecode(''),'/4736.html','true',[],'',''],
	['PAGE','4763',jdecode('Aktuelles'),jdecode(''),'/4763/index.html','true',[ 
		['PAGE','4790',jdecode('Wochenvorschau'),jdecode(''),'/4763/4790.html','true',[],'',''],
		['PAGE','4817',jdecode('Spezialit%C3%A4ten'),jdecode(''),'/4763/4817.html','true',[],'',''],
		['PAGE','4844',jdecode('Jahresagenda'),jdecode(''),'/4763/4844.html','true',[],'','']
	],'',''],
	['PAGE','4871',jdecode('Kontakt'),jdecode(''),'/4871/index.html','true',[ 
		['PAGE','4898',jdecode('Adresse+'),jdecode(''),'/4871/4898.html','true',[],'',''],
		['PAGE','4925',jdecode('So+finden+Sie+uns'),jdecode(''),'/4871/4925.html','true',[],'','']
	],'',''],
	['PAGE','5216',jdecode('G%C3%A4stebuch'),jdecode(''),'/5216/index.html','true',[ 
		['PAGE','5217',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5216/5217.html','false',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Eatdrink';
theSitetree.paletteFamily='7575CE';
theSitetree.keyvisualId='3359';
theSitetree.keyvisualName='kv_3359.jpg';
theSitetree.fontsetId='10621';
theSitetree.graphicsetId='10738';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Eatdrink',
				paletteFamily: 	'7575CE',
				keyvisualId: 	'3359',
				keyvisualName: 	'kv_3359.jpg',
				fontsetId: 		'10621',
				graphicsetId: 	'10738',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'1B1B6F',
				e_color: 		'1B1B6F',
				f_color: 		'1B1B6F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20080829-143249'
};
webappMappings['1002']=webappMappings['1002-5216ABW0X0INXXQ5']={
webappId:    '1002',
documentId:  '5216',
internalId:  '5216ABW0X0INXXQ5',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20100827-205931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20100827-210229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20070901-173544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20100820-223631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20100226-000129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20090821-130251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4817',
internalId:  '',
customField: '20100820-223514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4844',
internalId:  '',
customField: '20100820-224144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4871',
internalId:  '',
customField: '20060601-212404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4898',
internalId:  '',
customField: '20090901-221459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4925',
internalId:  '',
customField: '20060601-224009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5216',
internalId:  '',
customField: '20060601-181215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5217',
internalId:  '',
customField: '20060601-181215'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXQ5';
var companyName   = 'Landgasthof+Grossteil';
var htmlTitle	  = 'www.restaurant-grossteil.ch';
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();
};
