/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','14801',jdecode('Aktuell'),jdecode(''), jdecode('%2F14801%2Findex.html'), 'true',[ 
		['PAGE','39722',jdecode('Mittagsmenues'),jdecode(''), jdecode('%2F14801%2F39722.html'), 'true',[],'',''],
		['PAGE','67001',jdecode('Wine+%26+Dine'),jdecode(''), jdecode('%2F14801%2F67001.html'), 'true',[],'',''],
		['PAGE','61501',jdecode('Antipasti'),jdecode(''), jdecode('%2F14801%2F61501.html'), 'true',[],'','']
	],'',''],
	['PAGE','573',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F573.html'), 'true',[],'',''],
	['PAGE','6801',jdecode('Unser+Lokal'),jdecode(''), jdecode('%2F6801.html'), 'true',[],'',''],
	['PAGE','5901',jdecode('Speisen'),jdecode(''), jdecode('%2F5901%2Findex.html'), 'true',[ 
		['PAGE','615',jdecode('Antipasti'),jdecode(''), jdecode('%2F5901%2F615.html'), 'true',[],'',''],
		['PAGE','54701',jdecode('Antipasti+Caldi'),jdecode(''), jdecode('%2F5901%2F54701.html'), 'true',[],'',''],
		['PAGE','636',jdecode('Pizze'),jdecode(''), jdecode('%2F5901%2F636.html'), 'true',[],'',''],
		['PAGE','18601',jdecode('Pasta'),jdecode(''), jdecode('%2F5901%2F18601.html'), 'true',[],'',''],
		['PAGE','25901',jdecode('Risotti'),jdecode(''), jdecode('%2F5901%2F25901.html'), 'true',[],'',''],
		['PAGE','18622',jdecode('Carni'),jdecode(''), jdecode('%2F5901%2F18622.html'), 'true',[],'',''],
		['PAGE','18643',jdecode('Pesce'),jdecode(''), jdecode('%2F5901%2F18643.html'), 'true',[],'',''],
		['PAGE','18664',jdecode('Dolci'),jdecode(''), jdecode('%2F5901%2F18664.html'), 'true',[],'','']
	],'',''],
	['PAGE','18685',jdecode('Getr%C3%A4nke'),jdecode(''), jdecode('%2F18685%2Findex.html'), 'true',[ 
		['PAGE','29001',jdecode('Aperitifs'),jdecode(''), jdecode('%2F18685%2F29001.html'), 'true',[],'',''],
		['PAGE','29022',jdecode('Mineralwasser'),jdecode(''), jdecode('%2F18685%2F29022.html'), 'true',[],'',''],
		['PAGE','29043',jdecode('Biere'),jdecode(''), jdecode('%2F18685%2F29043.html'), 'true',[],'',''],
		['PAGE','29085',jdecode('Weissweine'),jdecode(''), jdecode('%2F18685%2F29085.html'), 'true',[],'',''],
		['PAGE','29064',jdecode('Ros%C3%A9weine'),jdecode(''), jdecode('%2F18685%2F29064.html'), 'true',[],'',''],
		['PAGE','29106',jdecode('Rotweine'),jdecode(''), jdecode('%2F18685%2F29106.html'), 'true',[],'',''],
		['PAGE','29127',jdecode('Spirituosen'),jdecode(''), jdecode('%2F18685%2F29127.html'), 'true',[],'',''],
		['PAGE','30801',jdecode('Heisse+Getr%C3%A4nke'),jdecode(''), jdecode('%2F18685%2F30801.html'), 'true',[],'','']
	],'',''],
	['PAGE','17043',jdecode('Anl%C3%A4sse'),jdecode(''), jdecode('%2F17043.html'), 'true',[],'',''],
	['PAGE','678',jdecode('Reservationen'),jdecode(''), jdecode('%2F678.html'), 'true',[],'',''],
	['PAGE','699',jdecode('Take-away'),jdecode(''), jdecode('%2F699.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('Lageplan'),jdecode(''), jdecode('%2F5401%2Findex.html'), 'true',[ 
		['PAGE','5501',jdecode('Anfahrtsroute'),jdecode(''), jdecode('%2F5401%2F5501.html'), 'true',[],'','']
	],'',''],
	['PAGE','720',jdecode('Kontakt'),jdecode(''), jdecode('%2F720.html'), 'true',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Eatdrink';
theSitetree.paletteFamily='C63C41';
theSitetree.keyvisualId='3375';
theSitetree.keyvisualName='kv_3375.jpg';
theSitetree.fontsetId='10621';
theSitetree.graphicsetId='10736';
theSitetree.contentColor='C63C41';
theSitetree.contentBGColor='FFFFFF';
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: 			'Eatdrink',
				paletteFamily: 	'C63C41',
				keyvisualId: 	'3375',
				keyvisualName: 	'kv_3375.jpg',
				fontsetId: 		'10621',
				graphicsetId: 	'10736',
				contentColor: 	'C63C41',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4E1416',
				e_color: 		'4E1416',
				f_color: 		'4E1416',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9830519']={
webappId:    '1501',
documentId:  '501',
internalId:  '9830519',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5401',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '5501',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110623-174923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20070109-205037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54701',
internalId:  '',
customField: '20111004-153442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61501',
internalId:  '',
customField: '20120109-215526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39722',
internalId:  '',
customField: '20111004-152254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20120109-211038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20111016-224551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20111004-152702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20111004-153212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20091003-135437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20111004-154413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25901',
internalId:  '',
customField: '20111004-154441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18622',
internalId:  '',
customField: '20111004-154709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18643',
internalId:  '',
customField: '20120109-211110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18664',
internalId:  '',
customField: '20091003-152021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18685',
internalId:  '',
customField: '20110623-155453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20091003-143615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29022',
internalId:  '',
customField: '20110623-160536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29043',
internalId:  '',
customField: '20100927-165929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29085',
internalId:  '',
customField: '20110623-160251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29064',
internalId:  '',
customField: '20110623-160622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29106',
internalId:  '',
customField: '20110623-161945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29127',
internalId:  '',
customField: '20100307-182159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30801',
internalId:  '',
customField: '20100307-182331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17043',
internalId:  '',
customField: '20091003-145624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20070108-182619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20070109-202726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20070110-174401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20061230-210054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20111016-224025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67001',
internalId:  '',
customField: '20120109-213631'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN27LW';
var companyName   = 'Restaurant+R%C3%B6ssli+Itingen';
var htmlTitle	  = 'Restaurant+R%C3%B6ssli+Itingen+Telefon+%2B41+61+973+09+09';
var metaKeywords  = 'Restaurant+R%C3%B6ssli++Restaurant+R%C3%B6ssli+Itingen+Basel-Land+CH-4452+Tel.%2B41+61+973+09+09+Restaurant++Italienische+K%C3%BCche++Italienisches+Restaurant++Italienische+Spezialit%C3%A4ten++Antipasti++Pizza++Pasta++Itingen+Pino+Di+Venere+Nicole+F%C3%A4ssler';
var metaContents  = 'Restaurant+R%C3%B6ssli+%2C+4452+Itingen+%2F+Basel-Land.+Telefon+%2B41+61+973+09+09%0D%0AItalienische+Spezialit%C3%A4ten.+Lokal+-+S%C3%A4li+und+Gartenwirtschaft.+';
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();
};

