/* [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','1246',jdecode('Home'),jdecode(''), jdecode('%2F1246.html'), 'true',[],'',''],
	['PAGE','47701',jdecode('Unser+Prospekt'),jdecode(''), jdecode('%2F47701%2Findex.html'), 'true',[ 
		['PAGE','47801',jdecode('Seite+2'),jdecode(''), jdecode('%2F47701%2F47801.html'), 'true',[],'',''],
		['PAGE','47822',jdecode('Seite+3'),jdecode(''), jdecode('%2F47701%2F47822.html'), 'true',[],'',''],
		['PAGE','47843',jdecode('Seite+4'),jdecode(''), jdecode('%2F47701%2F47843.html'), 'true',[],'',''],
		['PAGE','47864',jdecode('Seite+5'),jdecode(''), jdecode('%2F47701%2F47864.html'), 'true',[],'',''],
		['PAGE','47885',jdecode('Seite+6'),jdecode(''), jdecode('%2F47701%2F47885.html'), 'true',[],'','']
	],'',''],
	['PAGE','10501',jdecode('Mittag-Speisekarte'),jdecode(''), jdecode('%2F10501%2Findex.html'), 'true',[ 
		['PAGE','39701',jdecode('Graub%C3%BCnden'),jdecode(''), jdecode('%2F10501%2F39701.html'), 'true',[],'',''],
		['PAGE','39722',jdecode('Vorspeise'),jdecode(''), jdecode('%2F10501%2F39722.html'), 'true',[],'',''],
		['PAGE','39743',jdecode('Hauptspeise'),jdecode(''), jdecode('%2F10501%2F39743.html'), 'true',[],'',''],
		['PAGE','39764',jdecode('Kindermen%C3%BCs'),jdecode(''), jdecode('%2F10501%2F39764.html'), 'true',[],'',''],
		['PAGE','43701',jdecode('Dessert'),jdecode(''), jdecode('%2F10501%2F43701.html'), 'true',[],'','']
	],'',''],
	['PAGE','43722',jdecode('Abend-Speisekarte'),jdecode(''), jdecode('%2F43722%2Findex.html'), 'true',[ 
		['PAGE','43743',jdecode('Graub%C3%BCnden'),jdecode(''), jdecode('%2F43722%2F43743.html'), 'true',[],'',''],
		['PAGE','43764',jdecode('Vorspeisen'),jdecode(''), jdecode('%2F43722%2F43764.html'), 'true',[],'',''],
		['PAGE','43785',jdecode('Hauptgang'),jdecode(''), jdecode('%2F43722%2F43785.html'), 'true',[],'',''],
		['PAGE','43806',jdecode('Kindermen%C3%BCs'),jdecode(''), jdecode('%2F43722%2F43806.html'), 'true',[],'',''],
		['PAGE','45722',jdecode('Dessert'),jdecode(''), jdecode('%2F43722%2F45722.html'), 'true',[],'','']
	],'',''],
	['PAGE','40501',jdecode('Kultur+Teller'),jdecode(''), jdecode('%2F40501.html'), 'true',[],'',''],
	['PAGE','37601',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F37601%2Findex.html'), 'true',[ 
		['PAGE','18001',jdecode('L%C3%A4gelisnacht+Flawil'),jdecode(''), jdecode('%2F37601%2F18001.html'), 'true',[],'',''],
		['PAGE','19801',jdecode('Silvester+im+Park'),jdecode(''), jdecode('%2F37601%2F19801.html'), 'true',[],'',''],
		['PAGE','25022',jdecode('Albanischer+Abend'),jdecode(''), jdecode('%2F37601%2F25022.html'), 'true',[],'',''],
		['PAGE','56901',jdecode('Weihnachts-Ap%C3%A9ro+11'),jdecode(''), jdecode('%2F37601%2F56901.html'), 'true',[],'',''],
		['PAGE','39201',jdecode('Presse+Weihnacht+10'),jdecode(''), jdecode('%2F37601%2F39201.html'), 'true',[],'',''],
		['PAGE','35143',jdecode('Presse+Weihnacht+06'),jdecode(''), jdecode('%2F37601%2F35143.html'), 'true',[],'',''],
		['PAGE','35122',jdecode('Presse+Weihnacht+04'),jdecode(''), jdecode('%2F37601%2F35122.html'), 'true',[],'',''],
		['PAGE','35101',jdecode('Presse+Weihnacht+03'),jdecode(''), jdecode('%2F37601%2F35101.html'), 'true',[],'',''],
		['PAGE','26801',jdecode('Presse+Jazz-Ap%C3%A9ro'),jdecode(''), jdecode('%2F37601%2F26801.html'), 'true',[],'','']
	],'',''],
	['PAGE','1341',jdecode('Kontakt'),jdecode(''), jdecode('%2F1341.html'), 'true',[],'',''],
	['PAGE','1701',jdecode('Ortsplan'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','14201',jdecode('Monday+Night-Music'),jdecode(''), jdecode('%2F14201%2Findex.html'), 'true',[ 
		['PAGE','37101',jdecode('jazzin+-+Nat.+Festival+'),jdecode(''), jdecode('%2F14201%2F37101.html'), 'true',[],'','']
	],'',''],
	['PAGE','15601',jdecode('Nachtcaf%C3%A9'),jdecode(''), jdecode('%2F15601%2Findex.html'), 'true',[ 
		['PAGE','16401',jdecode('Programm'),jdecode(''), jdecode('%2F15601%2F16401.html'), 'true',[],'',''],
		['PAGE','21901',jdecode('Vergangenes'),jdecode(''), jdecode('%2F15601%2F21901.html'), 'true',[],'',''],
		['PAGE','15801',jdecode('Nachtcafe+z%C3%BCgelt'),jdecode(''), jdecode('%2F15601%2F15801.html'), 'true',[],'','']
	],'',''],
	['PAGE','25501',jdecode('Anzeiger+16.7.10'),jdecode(''), jdecode('%2F25501.html'), 'true',[],'',''],
	['PAGE','20901',jdecode('Fotos'),jdecode(''), jdecode('%2F20901.html'), 'true',[],'',''],
	['PAGE','1320',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F1320.html'), 'true',[],'','']];
var siteelementCount=41;
theSitetree.topTemplateName='Picture';
theSitetree.paletteFamily='F6EEDE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10428';
theSitetree.graphicsetId='10751';
theSitetree.contentColor='4D3B17';
theSitetree.contentBGColor='F6EEDE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'webland',
  product: 'WSCSYSSSSLY0XFFS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Picture',
				paletteFamily: 	'F6EEDE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10428',
				graphicsetId: 	'10751',
				contentColor: 	'4D3B17',
				contentBGColor: 'F6EEDE',
				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:  '39743',
internalId:  '',
customField: '20110122-155333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20111221-091155'
};
webappMappings['7002']=webappMappings['7002-3596']={
webappId:    '7002',
documentId:  '1320',
internalId:  '3596',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-4074']={
webappId:    '7008',
documentId:  '1341',
internalId:  '4074',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20111215-191010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20110122-150918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21901',
internalId:  '',
customField: '20111221-090816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20091015-142159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1320',
internalId:  '',
customField: '20091015-144043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1341',
internalId:  '',
customField: '20091016-112349'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1246',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39701',
internalId:  '',
customField: '20110122-153213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39722',
internalId:  '',
customField: '20110122-154231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20101231-174144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20111116-105628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20091028-093510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20111221-092244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20111116-105939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39764',
internalId:  '',
customField: '20110122-154430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20110103-073440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20110306-164902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35101',
internalId:  '',
customField: '20101113-155640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25022',
internalId:  '',
customField: '20100827-075535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20100920-081353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20100716-140401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35122',
internalId:  '',
customField: '20101113-155920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35143',
internalId:  '',
customField: '20101231-165311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37101',
internalId:  '',
customField: '20111025-122945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20111230-121409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39201',
internalId:  '',
customField: '20101231-170416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43701',
internalId:  '',
customField: '20110122-161201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43722',
internalId:  '',
customField: '20110122-150938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43743',
internalId:  '',
customField: '20110122-154535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43764',
internalId:  '',
customField: '20110122-155214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43785',
internalId:  '',
customField: '20110324-105255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43806',
internalId:  '',
customField: '20110122-160414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20110302-074555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45722',
internalId:  '',
customField: '20110122-161137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47801',
internalId:  '',
customField: '20110302-075929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47822',
internalId:  '',
customField: '20110302-080026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47843',
internalId:  '',
customField: '20110302-080142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47864',
internalId:  '',
customField: '20110302-080216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47885',
internalId:  '',
customField: '20110302-080256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56901',
internalId:  '',
customField: '20120208-082353'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010IN2KL6';
var companyName   = 'Herzlichst+willkommen%21';
var htmlTitle	  = 'Restaurant+Park+-+ein+gutes+Restaurant+in+der+Region+St.Gallen';
var metaKeywords  = 'gutes+Restaurant+St.+Gallen%2C+gutes+Restaurant%2C+B%C3%BCndner+Spezialit%C3%A4ten%2C+Restaurant+Park%2C+Restaurant%2C+Beiz%2C+Firmenessen%2C+Hochzeiten%2C+Geburtstage%2C+Restaurant+St.+Gallen%2C+Restaurant+Ostschweiz';
var metaContents  = 'Restaurant+Park+-+ein+gutes+Restaurant+in+der+Region+St.Gallen.+B%C3%BCndner+Spezialit%C3%A4ten%2C+Kulturanl%C3%A4sse%2C++Firmenessen%2C+Hochzeiten%2C+Geburtstage.+Feines+Essen+in+stilvoller+Atmosph%C3%A4re%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();
};

